Hi folks,
Please could someone explain to me...
function functionname as v (vars as p)
with vars
I have read and read the manual & message boards and I understand...
- namespaces,
- local vs gobal etc. scope
- dot variables
- functions with "normal" variable types (n, c, d etc.)
...but...
1. What is "v" as in "as v"? It is not one of the designated variable types. Does this mean we are just setting values for variables?
2. Now that we have multi-level dot variables, are namespaces pretty much obsolete? If not, when/why would you use which?
3. In script such as this one...
http://msgboard.alphasoftware.com/alphaphorum/read.php3?sortby=lastreply&direction=desc&num=15&id=13053&thread=13053#MSG13094
... "vars" points to the local variables only...
dim lv as p
lv = local_variables()
functionname(lv)
...
function functionname as v (vars as p)
with vars
...What if I wanted the function to access a local variable AND one in a different namespace as well?
4. Why do you even have "with vars" in a function? Is the function not effectively a child script of the calling script and thus would have access to all variables in the calling script anyway?
5. How would you convert a script such as this to take variables as p instead of as c?
http://msgboard.alphasoftware.com/alphaphorum/files/200411/a5v6/07/6107/script1.txt
It's clearly more than just
lv = local_variables()
tempstate_expanded = get_state_data(lv)
and
function get_state_data as V (vars as p )
Thanks in advance.
Regards,
Trevor
Please could someone explain to me...
function functionname as v (vars as p)
with vars
I have read and read the manual & message boards and I understand...
- namespaces,
- local vs gobal etc. scope
- dot variables
- functions with "normal" variable types (n, c, d etc.)
...but...
1. What is "v" as in "as v"? It is not one of the designated variable types. Does this mean we are just setting values for variables?
2. Now that we have multi-level dot variables, are namespaces pretty much obsolete? If not, when/why would you use which?
3. In script such as this one...
http://msgboard.alphasoftware.com/alphaphorum/read.php3?sortby=lastreply&direction=desc&num=15&id=13053&thread=13053#MSG13094
... "vars" points to the local variables only...
dim lv as p
lv = local_variables()
functionname(lv)
...
function functionname as v (vars as p)
with vars
...What if I wanted the function to access a local variable AND one in a different namespace as well?
4. Why do you even have "with vars" in a function? Is the function not effectively a child script of the calling script and thus would have access to all variables in the calling script anyway?
5. How would you convert a script such as this to take variables as p instead of as c?
http://msgboard.alphasoftware.com/alphaphorum/files/200411/a5v6/07/6107/script1.txt
It's clearly more than just
lv = local_variables()
tempstate_expanded = get_state_data(lv)
and
function get_state_data as V (vars as p )
Thanks in advance.
Regards,
Trevor
Comment