As a learning project, am working with variables & scope.
Can anyone tell me what is wrong with this function?
(I assume problem is in red text area, but thus far have been unable to fix)
FUNCTION ShowGlobalVars AS C ( )
dim pGlobalVars as p = global_variables()
dim cGlobalValues as c
cGlobalValues = ""
for each foo in pGlobalVars
cGlobalValues = cGlobalValues + " " + *GlobalVars.value
next
ShowGlobalVars = cGlobalValues
END FUNCTION
*Amongst many other small mods, I tried substituting foo for GlobalVars here.
I am trying to dislpay all the global variables on a forms field using the "Set 'value' property of field" action script.
(and trying to specify the function as the expression)
The initial creation of the function, saves without any problem. But upon attaching the function to a buttons on_push event, I run into a problem, and Alpha won't let me finish.
When I try to close the parentheses on the function I immediately get an error and the action script won't save. The debugger opens and an error is immediately displayed. (Before I even save or run the form.)
Here is the error:
Property not found (& debugger stops @ the "next" statement in the code.)
After exiting the debugger, I receive a second warning that the expression does not evaluate to a character value.
I can't tell if the error is due to improper use of the for statement, improper reference to the global variable pointer, or the possibility of the global variables not being instantantiated during action script building. (since the form is only being created)
Any help would be appreciated.
Can anyone tell me what is wrong with this function?
(I assume problem is in red text area, but thus far have been unable to fix)
FUNCTION ShowGlobalVars AS C ( )
dim pGlobalVars as p = global_variables()
dim cGlobalValues as c
cGlobalValues = ""
for each foo in pGlobalVars
cGlobalValues = cGlobalValues + " " + *GlobalVars.value
next
ShowGlobalVars = cGlobalValues
END FUNCTION
*Amongst many other small mods, I tried substituting foo for GlobalVars here.
I am trying to dislpay all the global variables on a forms field using the "Set 'value' property of field" action script.
(and trying to specify the function as the expression)
The initial creation of the function, saves without any problem. But upon attaching the function to a buttons on_push event, I run into a problem, and Alpha won't let me finish.
When I try to close the parentheses on the function I immediately get an error and the action script won't save. The debugger opens and an error is immediately displayed. (Before I even save or run the form.)
Here is the error:
Property not found (& debugger stops @ the "next" statement in the code.)
After exiting the debugger, I receive a second warning that the expression does not evaluate to a character value.
I can't tell if the error is due to improper use of the for statement, improper reference to the global variable pointer, or the possibility of the global variables not being instantantiated during action script building. (since the form is only being created)
Any help would be appreciated.
Comment