two questions: send and references

Mark Wieder mwieder at ahsoftware.net
Tue Sep 20 11:23:02 EDT 2005


All-

I've run up against a couple of problems here:

1. I'm trying to pass parameters using the "send" command. The problem
is that "send" insists on interpreting these for me rather than
sending them verbatim. In other words, if I try

send "hi" && the long id of field "xyz" to field "abc" of card "argh"

What field "abc" of card "argh" receives is the *contents* of field
"xyz" rather than the long id. For my purpose I really need to send
the long id as a long id. Is there a way to coerce "send" into doing
what I tell it to do? Am I missing something simple here? Does someone
have an alternative way of doing this?

2. I can pass a parameter by reference once. That is,

local someArray

on stuff @pArray, pIndex, pValue
  put pValue into pArray[pIndex]
end stuff

stuff someArray, tUserID, tPassword

works fine. But I need to pass a reference to someArray to another
handler down the line. Is there a syntax that will allow me to do
this? I need a second level of indirection and I can't figure out how
to do it. I don't think passing the entire array back and forth is
going to be an option. I miss pointers...

on stuff @pArray, pIndex, pValue
  stuff2 pArray, pIndex, pValue
end stuff

on stuff2 @pArray, pIndex, pValue
  put pValue into pArray[pIndex]
end stuff2

stuff2 someArray, tUserID, tPassword

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the Use-livecode mailing list