Replace first number with another number in list field

Charles Szasz cszasz at mac.com
Fri Jun 6 14:59:30 EDT 2008


I have a list field (field "content", containing lines of two numbers
separated by commas. I want to replace the first number in each row with the
number that the user types in a field "new" There is also another field
(field "old"). 

For some reason, the following script get error messages (replace item 1 of
field "content" with tVar) when I compile it.

on mouseUp 
     put field "old" into theMatch
     put field "new" into tVar
     get the htmltext of field "content"
     
     repeat for each line theMatch in field "content"
          if item 1 of field "content" = item 1 of theMatch then
               replace item 1 of field "content" with tVar
               exit repeat
          end if
     end repeat
end mouseUp

This is my first venture into dealing with text. Does anybody have any
suggestions??
-- 
View this message in context: http://www.nabble.com/Replace-first-number-with-another-number-in-list-field-tp17699087p17699087.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list