Autor Beitrag
Pankower_92
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 31



BeitragVerfasst: Di 09.10.07 13:52 
Guten tag,

ich hab mal ne frage was ist den der unterschied zwischen lokale und globale variablen.


mfg

Pankower_92


Moderiert von user profile iconNarses: Topic aus Sonstiges (Delphi) verschoben am Di 09.10.2007 um 15:01
GericasS
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 540

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: Di 09.10.07 13:53 
Globale gelten für die ganze Unit
lokale nur für einen bereich bzw. für eine funktion !

hoffe das ist so richtig bitte verbessern wenns falsch ist !

GericasS

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300
Pankower_92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 31



BeitragVerfasst: Di 09.10.07 13:56 
danke schön für die antwort GericasS :D
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Di 09.10.07 13:57 
Das ist korrekt, wobei man noch etwas anfügen könnte:
Globale Variablen kann ich auch aus anderen Units erreichen und sie werden nicht Freigegeben, bis das Programm beendet ist, während der Speicher lokaler Variablen am Ende der Prozedur oder Funktion freigegeben wird (natürlich nicht bei Variablen, bei denen du den Speicher manuell reservierst! )

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