Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 21.07.06 22:18 
Könnte man nicht an einer zentralen Stelle einen unverbindlichen Styleguide anlegen?
Meine eigentliche Frage allerdings: Wann schreibt man vor den Parameternamen ein A (z.B. AColor: TCOlor) und wann nicht (filename: string)?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Fr 21.07.06 22:31 
Also ich mache es bei meinen Prozeduren dann, wenn ich z.B. den Parameter Color habe und mit einem RichEdit arbeite und dann with MyRichEdt do ... mache.. sonst ist es denke ich egal..

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 21.07.06 22:34 
user profile iconBorn-to-Frag hat folgendes geschrieben:
Also ich mache es bei meinen Prozeduren dann, wenn ich z.B. den Parameter Color habe und mit einem RichEdit arbeite und dann with MyRichEdt do ... mache.. sonst ist es denke ich egal..

Hab das jetzt mehrmal gelesen und kann das jetzt nicht auf die Frage beziehen. Was hat 'with MyRichEdit do' mit AColor oder nur Color zu tun? :gruebel:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Fr 21.07.06 22:38 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
with RichEdit do
begin
  SelAttributes.Color := Color //Machts jetzt klick?
  ...
end;


:idea:

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.


Zuletzt bearbeitet von Born-to-Frag am Fr 21.07.06 22:39, insgesamt 1-mal bearbeitet
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 21.07.06 22:39 
Hm nee, ich glaube wir reden aneinander vorbei :mrgreen:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Fr 21.07.06 22:40 
:roll:

Ein RichEdit hat auch die Eigenschaft .Color.. welches Color mein ich denn jetzt? Parameter oder RichEdit.Color?
Also lieber SelAttributes.Color := AColor; :mrgreen:

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Fr 21.07.06 22:41 
Wenn ich kennzeichnen will, was die Variable für ein Typ ist, wird sie wie der Typ + ein 'a' an den Anfang gennant.
ausblenden Delphi-Quelltext
1:
2:
aString:  String;
aInteger: Integer;

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 21.07.06 22:42 
:think: Achso!
Jetzt versteh ichs :zwinker:
@GTA: Genau das wollte ich wissen :zustimm:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Fr 21.07.06 22:43 
Genau. AColor hab ich immer englisch aufgefasst: a im sinne von "ein/eine". Also wenn ich schreibe aRichEdit:TRichEdit dann meine ich damit: Hier haben wir ein RichEdit (=this is aRichEdit).
Ähm - Das ist sicher nicht die korrekte Interpretation, aber ich glaub man darfs ruhig so benutzen ^^
Ich verstehe allerdings was du mit dem Styleguide meinst und wäre auch daran interessiert...
Meinst du damit Codeformatting insgesammt oder nur Variablennamen und sowas? Ich würde gern leuten einen Link zu diesem Topic geben können, wenn sie wieder kommen mit
ausblenden Delphi-Quelltext
1:
2:
3:
var a,b,c,d,x,y,z,v,h,i,h5,n1,ohrenschmalz:Integer;
//oder
var geschwindigkeits_korrelations_konstanten_verschiebung_horizontale_achse:Single;

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 21.07.06 22:47 
user profile iconJayEff hat folgendes geschrieben:

Ich verstehe allerdings was du mit dem Styleguide meinst und wäre auch daran interessiert...
Meinst du damit Codeformatting insgesammt oder nur Variablennamen und sowas?

Beides.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Fr 21.07.06 22:53 
Nun, das Formatieren des Codes überlasse ich (fauler Informatiker) dem SourceFormatter(DelForExp). Strg+D, Enter, und schon wird aus
ausblenden Delphi-Quelltext
1:
2:
3:
4:
var hallo:String;x,i:integer;s:TStringList;
begin
x:=1;i:=2;hallo:='blubb';s:=TStringList.Create;if x=v then s.add('sad'+hallo) else s.add('fuubar');
end;
das:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
Var
    hallo: String;
    x, i: integer;
    s: TStringList;
Begin
    x := 1;
    i := 2;
    hallo := 'blubb';
    s := TStringList.Create;
    If x = v Then
        s.add('sad' + hallo)
    Else
        s.add('fuubar');
End;

Schön, gell? :D Man kann das Formatieren übrigens frei nach Schnautze einstellen, aber so wies hier is find ichs besonders schön :D

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 21.07.06 22:55 
Du erinnerst mich glücklicherweise dran, dass ich das Tool gestern geladen habe. Gleich mal installieren. :tongue:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Fr 21.07.06 23:14 
Hier gibts den offiziellen Delphi Styleguide auf Deutsch:
www.dsdt.info/grundlagen/styleguide/
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Fr 21.07.06 23:22 
DelForExp ist ja echt nich schlecht, werd das Tool jetzt auch mal ausprobieren!

Danke :beer:

EDIT: Wow! Den werd ich jetzt immer benutzen, das is ja total geil das Ding :mrgreen:

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 22.07.06 08:20 
user profile iconJayEff hat folgendes geschrieben:
AColor hab ich immer englisch aufgefasst: a im sinne von "ein/eine". Also wenn ich schreibe aRichEdit:TRichEdit dann meine ich damit: Hier haben wir ein RichEdit (=this is aRichEdit).

dito.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 22.07.06 13:14 
Ich krieg immer die Meldung:

---------------------------
LinkedListDemo - Borland Delphi 2005 - LinkedList
---------------------------
Censored.pas: File or buffer is read only, or not yet saved
---------------------------
OK
---------------------------

wenn ich DelForExp benutzen will. Gespeichert ist sie auf jeden Fall.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Sa 22.07.06 15:03 
das is zwar n bissl OT aber ich hatte das auch, und das ging weg, sobald das projekt gespeichert war :shock:

user profile iconBorn-to-Frag hat folgendes geschrieben:
DelForExp ist ja echt nich schlecht, werd das Tool jetzt auch mal ausprobieren!

Danke :beer:

EDIT: Wow! Den werd ich jetzt immer benutzen, das is ja total geil das Ding :mrgreen:

Yup, ganz meine meinung ^^

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 22.07.06 15:05 
Ich kann das hundert mal speichern und es geht nicht.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Sa 22.07.06 23:55 
Das ist, wenn du ein neues Project machst und das Project noch nirgens gespeichert hast ;)

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: So 23.07.06 12:59 
user profile iconMarco D. hat folgendes geschrieben:
Ich kann das hundert mal speichern und es geht nicht.

user profile iconBorn-to-Frag hat folgendes geschrieben:
Das ist, wenn du ein neues Project machst und das Project noch nirgens gespeichert hast ;)

... :roll:

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.