Autor Beitrag
DanyLux
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 55

Win 2000, WinXP SP2
D7 Ent
BeitragVerfasst: Fr 03.06.05 14:36 
Hallo

Ich hab ein Projekt in Delphi geschrieben und muss jetzt net dokumentation schreiben. Und moechte dann den code von delphi mit intigrieren. Aber wenn ich jetzt copy paste mache wird ja die formatieren von delphi nicht mitgenommen. Kennt irgend jemand ein Programm der die .pas dann nach Microsoft Word exportieren kann mit Delphi-Formatierung

Danke fuer eure Hilfe

_________________
MfG aus Luxemburg
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 03.06.05 16:42 
Installiere Dir die GExperts. Dann kannst Du über die Funktion "Source Export" formatierte Source-Stücke nach Word kopieren.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
DanyLux Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 55

Win 2000, WinXP SP2
D7 Ent
BeitragVerfasst: Fr 03.06.05 17:03 
Ist nicht schlecht das programm
Aber kann mann da auch die zeilenanzahl mit exportieren???

_________________
MfG aus Luxemburg
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 03.06.05 18:06 
Naja, dann mißbrauch doch die Vorschaufunktion des Delphi-Forums ;-)

Source in Editor, Zeilennummer im Delphi-Tag setzen, Vorschau klicken, Source rauskopieren: Fertig!

ausblenden Delphi-Quelltext
 
4711:
4712:
4713:
4714:
{ ... }
procedure Hallo;
begin
    WriteLn('Hallo Welt!');
end;

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Fr 03.06.05 18:12 
das mit den zeilen wusste ich noch garnet, is ja cool:
ausblenden Delphi-Quelltext
 
839484938:
839484939:
839484940:
839484941:
{ ... }
procedure test;
begin
  showmessage('hello world !');
end;

:D

und die klammern, hübsch :shock:`


aber wenn man des in word einfügt fehlen die zeilen und highlighting ist auch net drinne, du könntest das aber selbst machen
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
var
  Form1: TForm1;
  ReservedWords: array[0..75] of string =
    ('and', 'array', 'as', 'asm', 'at', 'begin', 'case', 'class', 'const',
     'constructor', 'default', 'destructor', 'dispinterface', 'div', 'do',
     'downto', 'else', 'end', 'except', 'exports', 'file', 'finalization',
     'finally', 'for', 'function', 'goto', 'if', 'implementation', 'in',
     'inherited', 'initialization', 'inline', 'interface', 'is', 'label',
     'library', 'message', 'mod', 'nil', 'not', 'object', 'of', 'on', 'or',
     'out', 'packed', 'procedure', 'program', 'property', 'raise', 'read',
     'record', 'repeat', 'resourcestring', 'set', 'shl', 'shr', 'string',
     'stored', 'then', 'threadvar', 'to', 'try', 'type', 'unit', 'until',
     'uses', 'var', 'while', 'with', 'write', 'xor', 'private', 'protected',
     'public', 'published');
  AllowedChars: array[0..5] of string =
    ('(', ')', '[', ']', ' ', '');
  t, t1, t2, t3: boolean;

{...}

procedure HighlightReservedWords(re: Trichedit);
var
  i, j, k: integer;
  rword, str: string;
begin
  for i:= 1 to length(re.Text) do
    for j:= 0 to High(ReservedWords) do
      begin
        application.processmessages;
        rword:= ReservedWords[j];
        str:= Copy(re.text, i, Length(rword));
        if (str = rword) then
          begin
            re.SelStart:= i - 1;
            re.Sellength:= length(rword);
            re.SelAttributes.Color:= clnavy;
            re.SelAttributes.style:= [fsbold];
          end;
      end;
end;

procedure HighlightStrings(re: TRichedit);
var
  i: integer;
begin
  t:= false;
  for i:= 1 to length(re.text) do
    begin
      application.processmessages;
      if not (t) then
        begin
          if re.text[i] = '''' then
            begin
              t:= true;
              re.selstart:= i - 1;
            end;
        end else
          if (t) and (re.Text[i] = '''') then
            begin
              t:= false;
              re.SelLength:= i - re.selstart;
              re.SelAttributes.Color:= clblue;
              re.SelAttributes.Style:= [];
            end;
    end;
end;

procedure HighLightComments(re: TRichedit);
var
  i: integer;
  str: string;
begin
  t1:= false;
  t2:= false;
  t3:= false;
  for i:= 1 to length(re.text) do
    begin
      application.processmessages;
      str:= copy(re.text, i, 2);
      if not ((t1) or (t2) or (t3)) then
        begin
          if str = '//' then
            t1:= true;
          if str = '(*' then
            t2:= true;
          if str[1] = '{' then
            t3:= true;
          if ((t1) or (t2) or (t3)) then
            re.SelStart:= i - 1;
        end else
          begin
            if (t1) and (str = #13#10) then
              begin
                t1:= false;
                re.SelLength:= i - re.selstart + 1;
                re.SelAttributes.Color:= clgreen;
                re.SelAttributes.Style:= [];
              end;
            if (t2) and (str = '*)') then
              begin
                t2:= false;
                re.SelLength:= i - re.SelStart + 1;
                re.SelAttributes.Color:= clgreen;
                re.SelAttributes.Style:= [];
              end;
            if (t3) and (str[1] = '}') then
              begin
                t3:= false;
                re.SelLength:= i - re.SelStart;
                re.SelAttributes.Color:= clgreen;
                re.SelAttributes.Style:= [];
              end;
          end;
    end;
end;

aber kommentare + strings funktionieren leider noch net, hab ich bis jetzt net hinbekommen, hm naja, aber ist halt n ansatz, kannst es dann kopieren und in word einfügen :D

integer fehlen auch noch :lol:
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Fr 03.06.05 21:55 
Naja: HTML-Seite der Vorschau speichern, mit Word öffnen --> Text kopieren.
Dann geht's ...

@TUFKAPL: Siehst'd ;-) Wieder einer, der's nutzt ^^

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.