I can't send a message with a field to another handler

dunbarx at aol.com dunbarx at aol.com
Thu Aug 2 16:34:00 EDT 2012


Hi.


If you do not specify a full pathname (or LC-type "pathname"), LC will assume you are on the same card.


So just change your code to ...fld tgt of cd "yourcard" [of stack "otherStack"]


Craig Newman


-----Original Message-----
From: Dr. Hawkins <dochawk at gmail.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Thu, Aug 2, 2012 3:25 pm
Subject: I can't send a message with a field to another handler


I've written functions/handlers to convert between pennies and
formatted dollars.

I'm trying to write a function or handler that can add them, but am
getting caught up in the parsing.

I've tried a handler  like


on dlrAdd amt, tgt
   put dlrStr(dlrVal(amt) + dlrVal(  "fld " & quote & tgt & quote))
into field the long name of fld tgt

end dlrAdd

but this only works when the target is on the same page--a tgt name
like "myTot of Card 1" results in an unfound error (it's looking for a
field with that name on the current page, i believe)

I've tried

on dlrAdd amt
   --send to a field to add a dollar amount to it
   put dlrStr(dlrVal(amt) + dlrVal(the target)) into the target
end dlrAdd

and then

send  "dlrAdd" && field sbFld  to fld  ("sbt_" & sbFld)

to get the target field to add the amount to itself, but this doesn't
get the field amount passed.

I'm trying to have a single handler here to make this all maintainable.

-- 
The Hawkins Law Firm
Richard E. Hawkins, Esq.
(702) 508-8462
HawkinsLawFirm at gmail.com
3025 S. Maryland Parkway
Suite A
Las Vegas, NV  89109

_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 



More information about the use-livecode mailing list