Global variables when using Form Designer

You need some new stunning features ? Tell us here.
BjornF
User
User
Posts: 35
Joined: Mon Jun 23, 2008 11:09 am
Location: Copenhagen

Global variables when using Form Designer

Post by BjornF »

I suspect that this is a newbie question but since I don't know the answer... :D

I'm trying to write a new project using the Form Designer. The project uses a SQLite database and the database should be accessible on different forms within the project. Because of this I created a global variable "dbFileName" which I defined in the file Main.pb. However when I try to access the variable in the different form.pb files it is not recognised.

So my questions are:
1. Am I correct in that the "Global" is only valid for one file in the project?
2. Is there any smart way of accessing the file name dbFileName in the different forms?

all the best,

Björn
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Global variables when using Form Designer

Post by Polo »

The global variable is defined for all files, but you need to ensure you've defined it before including the form.pb file :)
BjornF
User
User
Posts: 35
Joined: Mon Jun 23, 2008 11:09 am
Location: Copenhagen

Re: Global variables when using Form Designer

Post by BjornF »

Thank you for the rapid answer :) That solved the problem.

/Björn
Post Reply