when sent a message, the target can't find itself!
Dr. Hawkins
dochawk at gmail.com
Sat Aug 4 18:37:24 EDT 2012
On Sat, Aug 4, 2012 at 2:58 PM, J. Landman Gay <jacque at hyperactivesw.com> wrote:
> If you substitute "field x of card y" for every instance of "the long name
> of the target" in your script, you'll probably see the problem right away.
> As Alex mentioned, the "put" line evaluates to:
>
> put 45 into fld (field x of card y)
The catch is that the handler has no advance knowledge of what field
or card it can be called from--I'm trying to make something generic
that can add a currency formatted value to a field that already
contains a currency formatted value.
In several places, the names of the fields are actually being
constructed by string manipulation (e.g., val_sbt comes from [ fldNam
& "_sbt" ], and then I want to add the $123.45 in val (or possibly
fld fal) to the $852.87 already in fld_sbt.)
And then, when I"m done on the page, I have to add fld_sbt to a
totalling field on yet another page.
So the solution *seems* to be to send a message to the field to add
something to itself. But the handler only knows the name by "the
target", and it seems to take several lines of code to parse a long
name into a card X and Field Y.
My real need is the very narrow issue of a handler pulling the value
of the field that called it, and then putting something back in. It
seems that this should take one line of code, not 8 or 10.
Thanks
hawk
--
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
More information about the use-livecode
mailing list