Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

Global variables in Delphi???

Is it possible to declare global variables in Delphi 3 so it's available from the whole modules of the app?
0
forns
Asked:
forns
  • 2
  • 2
1 Solution
 
ThaddyCommented:
Yes. Simple include the unit where the global variable is declared in the uses clause of the units where you want to access it.
0
 
fornsAuthor Commented:
Isn't it possible to declare them in the Project Source (the main, let's say)?

Don't comment to this question, answer it, so i'll be able to give you the points.
0
 
fornsAuthor Commented:
Isn't it possible to declare them in the Project Source (the main, let's say)?

Don't comment to this question, answer it, so i'll be able to give you the points.
0
 
ThaddyCommented:
No, that's not possible, you can't refer to the project source from the other units. But you can put the globals in their own unit and include them where needed.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now