Field data Assignment
Elon Close
erclose at dakotacom.net
Tue Feb 5 22:12:07 PST 2008
Let Summary be a field name with value "TEXT"
Local Temp
Summary = "TEXT"
Temp=Summary
message "Temp = "+Temp
;This will fetch from the field Summary the value TEXT and display it
properly.
Summary = "NewText" ; puts the value NewText into the field
Temp = "MoreText" ; puts the value MoreText into the variable
Temp
; Note: Temp when used above to fetch data, fetches from the field.
; After the assignment if will forever be a variable and will store
or fetch data from the variable location.
Temp = Summary ; will again allow fetches from the field Summary.
========================================================================
=
Question: is there a way to store a data item in a field *without*
using the actual field name?
The simple assignment changes the character of the variable name. And
the assign( function does the same.
This came up because I had 11 fields from which data was fetched and
stored and rather than write explicit code for each field, it was
simple to write a ShortCall section of code and thus eliminate a lot
of duplicate code. The Field name can easily be put into a variable
and data fetched in the ShortCall. But the storage of results cannot
be done by that variable, it turns into a local variable.
Not a big problem, and easy to work around, but it does raise the
above question. One can easily imagine a subroutine for which it
would be nice to not have to furnish in that routine the explicit
field names, but instead use a temporary FileGlobal, or subroutine
argument.
Elon
erclose at dakotacom.net
More information about the Qna
mailing list