Autor Beitrag
NetZwerg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 448

Slackware 10.1
Kylix 3, D5 Standard
BeitragVerfasst: Mo 05.04.04 21:00 
Hallo,

in manchen Programmiersprachen gibt es ja die Möglichkeit, eine Variable um 1 zu erhöhen, etwa so:

ausblenden Quelltext
1:
2:
Variable ++; (C++)
Variable += 1; (Java glaubich)


gibt es sowas auch in delphi/pascal?

cya, dave

_________________
"Manche Leute drücken nur deshalb ein Auge zu, damit sie besser zielen können."
Billy Wilder, amer. Filmregisseur
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: Mo 05.04.04 21:10 
ausblenden Delphi-Quelltext
1:
inc(Variable)					


Veriable ist dann = i oder so
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mo 05.04.04 21:14 
ausblenden Quelltext
1:
x++					

entspricht
ausblenden Delphi-Quelltext
1:
Inc(x)					


ausblenden Quelltext
1:
x += y;					

entspricht
ausblenden Delphi-Quelltext
1:
x := x + y;					

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
NetZwerg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 448

Slackware 10.1
Kylix 3, D5 Standard
BeitragVerfasst: Mo 05.04.04 21:44 
thx, das wollte ich wissen! das mit dem inc() brauchte ich... user defined image

_________________
"Manche Leute drücken nur deshalb ein Auge zu, damit sie besser zielen können."
Billy Wilder, amer. Filmregisseur
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: Mo 05.04.04 21:54 
ausblenden Quelltext
1:
x += y;					

entspricht eher
ausblenden Delphi-Quelltext
1:
inc(x,y);					
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mo 05.04.04 22:02 
Stimmt.. Inc() hat ja noch einen zweiten Parameter..! :roll:

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 05.04.04 22:43 
Als Ergänzung:
ausblenden Quelltext
1:
2:
++a = succ(a)
--a = pred(a)

Nachfolger und Vorgänger
UC-Chewie
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 531

WinXP
D5 Ent
BeitragVerfasst: Di 06.04.04 00:01 
MathiasSimmack hat folgendes geschrieben:
Als Ergänzung:
ausblenden Quelltext
1:
2:
++a = succ(a)
--a = pred(a)

Nachfolger und Vorgänger


Na ja, nicht ganz...
succ und pred nehmen den Parameter als Wert, nicht als Referenz. Soll heißen, a wird nicht verändert (bei C dagegen schon).

_________________
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind