Repeat variable name changing

Ken Ray kray at sonsothunder.com
Sat Mar 8 12:35:26 EST 2008


On Sat, 08 Mar 2008 13:52:38 +0000, Jim Hamlyn wrote:

> on mouseUp
>   put fld "StartTime" into tTime1
>   convert tTime1 to dateItems
>   add fld "Add" to item 5 of tTime1
>   put tTime1 into tTime2
>   add fld "Add" to item 5 of tTime2
>   put tTime2 into tTime3
>   add fld "Add" to item 5 of tTime3
>   convert tTime1 to time
>   put tTime & ":" & Tab before line 1 of fld "myField"
> etc

So the idea is to put the time and a tab before each line in the field 
after adding the duration to the StartTime? If that's the case, you can 
do:

on mouseUp
  put fld "myField" into tNames
  put fld "StartTime" into tTime
  convert tTime to dateItems
  add fld "Add" to item 5 of tTime
  convert tTime to time
  repeat with x = 1 to the number of lines of tNames
    put (tTime & ":" & tab) before line x of tNames
  end repeat
  put tNames into fld "myField"
end mouseUp

Enjoy!

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list