Re:Q:Global variables??
Quote
Stefan <Stefan.arvids...@hexagon.se> wrote:
>[snip]
>Just one extra quest. Have U tried and succeded with the model in which
>U declare a global variable in the dpr-file? I've tried it and the
>compiler buys the declaration but....when it reaches the actual variable
>in an event handler it stops and cries "undeclared identifier". Must i
>treat the global one in some special way or what??
>once again: ThankYou for lending me Ur time.
>//Stefan
Its no ptoblem at all. I do have a solution for the dpr-declaration...
sort of. It's more a combination of the two. Since the compiler won't
let you reference a variable till it's declared, the straight
declaration won't cut it unless you can "trick" the compiler into
taking it (which I'm not sure, can be done). It's been a while since
I've needed global variables, and I'm not sure if this solution would
work, but instead of declaring the one VarsUnit in every other unit,
try declaring the VarsUnit first in the dpr file. If Pascal acts the
same way C++ does in respect to units and #includes, then everything
should be hunky-doory. If not, well, you'll just have to declare it
over and over again...
- FireHawk