@USER0 Problem (OpenInsight Specific)
At 04 DEC 2001 01:46:33PM a becker wrote:
I am using @USER0 and I set various variables in this area using @FM between variables.
Initially, @USER0 is set with field1:@FM:field2:@FM:field3:@FM:field4
In a GOTFOCUS script, I add field5 and field6 to @USER0. Of course I build the whole string starting with field1 thru field6. Debug confirms that all 6 fields are included in @USER0. Setting @USER0 is the command directly before the RETURN 1.
When the next step, a POSCHANGE, is executed, field5 and field6 are not there.
Both events are in an edit table.
Any ideas??
At 04 DEC 2001 02:12PM Bob Carten wrote:
Instead of using @user0 try using a custom property, for example
in gotfocus
…
gotfocus_Arr=1:@fm:2:@fm:3
was=Set_Property(CtrlEntId,'@GOTFOCUS_ARR',gotfocus_arr)
…
poschanged
…
Gotfocus_arr=Get_Property(CtrlEntId,'@GOTFOCUS_ARR')
…
I have not really solved your problem, just tried to steer you away from global variables which might get changed elsewhere.
Bob
At 04 DEC 2001 06:49PM Scott, LMS wrote:
I agree with Bob. The custom @ variable works really well. So long as you don't make coding misteaks.
The way I managed to stuff it up though was to put in an extra parameter like 'TEXT' which doesn't belong with the GET_PROPERTY and SET_PROPERTY for an @CUSTOM_VAR.
And then I wondered why my custom var didn't get updated when I thought it should. It's a bit like doing a GET_PROPERTY and spelling the control name inconsistantly. It compiles and runs ok but it doesn't actually do what it is supposed to.
Scott, LMS
This change is so trivial it doesn't need testing.
(But my spelling needs checking.)
Why can't you code right the first time without making any mistakes?
At 05 DEC 2001 09:57AM a becker wrote:
Thanks for your input - I'll give it a try and see what happens.
Andy
At 05 DEC 2001 10:14AM Oystein Reigem wrote:
Andy,
If the values you want to save and pass on all have to do with the edit table and its fields, and nothing else, it does make sense to store them in a "container" "owned" by the edit table, i.e, in a user-defined property (@SOMETHING) of the edit table. Much more sense than having them in totally global variables like @USER0, which are accessible to everybody everywhere.
Take into consideration how long you want the values to live, and who they should be accessible to. User-defined properties of controls and windows will be destroyed when their windows are closed, while @USER0 lasts forever. (Well, not quite forever.)
- Oystein -