Hi. This has me baffled.
I have a form with SourceTable T
The form calls T's function (call it T.F1) to pass values to the table.
The call looks like F1(value1,value2,value3, etc.)
T.F1 sets globals in the table to the passed values and returns.
The form calls another function (call it 'T.F2') in the table.
In T.F2, the globals set before are all there.
T.F2 then calls another function in the same table (T.F3)
In T.F3 all the globals are empty/zero.
I know there has to be a good explanation for this ... :-k
Can anyone shed some light on this?
Thanks!
0
Comments
viewtopic.php?f=23&t=41868
RIS Plus, LLC
By the way Denster - there is no collision between local and global variables.
I tried modifying the code as follows:
Form calls Table function T.F1 with several parameters.
T.F1 sets globals in the table to the passed values.
T.F1 then calls function T.F2 to verify the variables all have values.
In T.F2 the global values all have the expected values.
T.F1 then calls T.F3 to do some work using the global variables.
In T.F3 the variables are all empty.
The behaviour is weird - especially since this is all happening in one function call to the table that spawns other function calls (presumably) withing the same table/record.
But, this is NAV, so things can get "interesting" ... and in this case it looks like the scope/persistence of globals in a record is somewhat "undefined".
Thanks all, I've already worked around it (by holding my nose and pulling the code into the form.)
B
http://www.mibuso.com/forum/viewtopic.php?f=23&t=42760
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
not confusion,it's looking as when a local variable has same name to global variable then the local variable overright to global in his scope(you can not use global variable in local scope it hide to global).