Normal Topic global values explanation request (Read 655 times)
billgordon
Junior Member
**
Offline


No personal text

Posts: 61
Joined: Dec 31st, 2003
global values explanation request
Feb 25th, 2004 at 4:09pm
Print Post Print Post  
Can someone tell me are global values only useful in single user installations?

If a record  identification number is saved into a global value to be used to automatically update a field in a subform if more then one person was doing this type of task with different clients would not each person end up with the same record  identification number incorrectly?

What is the correct method for transferring a relational identification number from the parent record to child record in the subform?

  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: global values explanation request
Reply #1 - Feb 25th, 2004 at 4:21pm
Print Post Print Post  
Depends on what you mean by a global value.

A value accessed using the @GlobalValue function in SBasic comes from the server. Multiple clients using @GlobalValue will get the correct value.

A variable declared in the global code area is only accessible to the Client that declared it. Each Client would have only their own variable value.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: global values explanation request
Reply #2 - Feb 25th, 2004 at 4:43pm
Print Post Print Post  
Quote:
Can someone tell me are global values only useful in single user installations? 


Extremely. They allow resources and information to be shared globally across both forms and users. They provide an extremely simple and flexible lookup mechanism that can store a variety of information that is globally available. If anything, they are more valuable with multiple users because it gives those users access to the same information, and they stay "on the same page". They can also serve as communications vehicle between users.

Quote:
What is the correct method for transferring a relational identification number from the parent record to child record in the subform?


You could use two GlobalValues: one that gets set to indicate that a user "owns" the other one, and the other one that holds the "identification" value. When you need to transfer the "id" check the "owner", if it is set - wait for it to be cleared, then set it, transfer the "id", and clear the "owner". Given that the transfer is likely to be very brief, you could put some sort of timeout on the "wait".
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: global values explanation request
Reply #3 - Feb 25th, 2004 at 7:33pm
Print Post Print Post  
If you are simply trying to set a value in the child record to match a value in the parent record, you can assign the parent id once, using @GlobalValue, then use that value to assign a matching key to each child record.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged