Field question

Eric Chatonet eric.chatonet at sosmartsoftware.com
Thu Jul 19 13:49:33 EDT 2007


Hi Charles,

Stephen did give you good advice.
It depends on your environment but a repeat loop could do the job:

repeat for each item tFldName in "a,b,c,d,e,f,g"
   put fld tFldName & cr after tData
end repeat

Or:
repeat with i = 1006 to 1024
   put fld ID i & cr after tData
end repeat

Or:
repeat with i = 5 to 12
   put fld i & cr after tData
   -- note that this formulation assumes you don't change objects layers
end repeat

etc.

Le 19 juil. 07 à 19:41, Stephen Barncard a écrit :

>> When I check the contents of tData, only the last field, field "l"  
>> was in
>> tData
>
> right now you are just replacing the last contents with the next.
> into   = replace what was there
> after  = put after
> before = put before
>
>>
>> How do I correct this?
>
> depends on what you want to do...
> If you are appending the data to the var
>
> local tData
> put empty into tData
> put field "a" & return after tData
> put field "b"  & return after tData
> put field "c"  & return after tData
> put field "d"  & return after tData
>
> you could compact each field into a single line
> for decoding later.
>
> local tData
> put empty into tData
> put URLEncode(field "a") & return after tData
> put URLEncode(field "b") & return after tData
> put URLEncode(field "c") & return after tData
> put URLEncode(field "d") & return after tData
>
>
> If you want each field available in an array do this
>
> local tDataA
>
> put field "a" into tDataA [a]
> put field "b" into tDataA [b]
> put field "c" into tDataA [c]
> put field "d" into tDataA [d]
> put field "e" into tDataA [e]
>
> sqb
>
>
>
>> I have tried putting fields into a temporary variable:
>>
>> put field "a" into tData
>> put field "b" into tData
>> put field "c" into tData
>> put field "d" into tData
>> put field "e" into tData
>> put field "f" into tData
>> put field "g" into tData
>> put field "h" into tData
>> put field "i" into tData
>> put field "j" into tData
>> put field "k" into tData
>> put field "l" into tData
>>
>> When I check the contents of tData, only the last field, field "l"  
>> was in
>> tData
>>
>> How do I correct this?

Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list