Replace in Vars's
hershrev
hershbp at realtorsgroup.us
Thu Feb 26 18:28:45 EST 2004
I cleared all Var.'s Local and Global and now it works properly.
Thanks to all . hershrev
By the way this the basic recipe for edit SQL for not connected fields.
put these scripts in your card or stack
on openField
put the text of the selectedField into lOldText
end openField
on closeField
if gAction = "Edit"
then
put the name of the selectedField into lModifyFieldName
put the text of the selectedField into lFieldText
delete word 1 of lModifyFieldName
delete char 1 of word 1 of lModifyFieldName
delete char -1 of word 1 of lModifyFieldName
if lEquery contains lModifyFieldName
then
if lOldText <> lFieldText
then
replace lOldText with lFieldText in lEquery
end if
else
put lModifyFieldName &&"="&"'"& the Text of the selectedField
&"',"& space after lEquery
end if
end if
put lEquery into gtest
end closeField
on go
put "UPDATE databaseName&&"SET"&&lEquery&&"WHERE text = text"
end go
in your button put
on mouseUp
go
end mouseUp
and comments would be appreciated (even critics)
Thanks hershrev
On Thursday, February 26, 2004, at 05:57 PM, Dar Scott wrote:
>
> On Thursday, February 26, 2004, at 03:31 PM, hershrev wrote:
>
>>>> I need to replace oneVar with anotherVar in athirdVar ?
>>>
>>> Do you meant replacing all substrings equal to the value of oneVar
>>> with the value of anotherVar in some variable athirdVar?
>>>
>>> replace oneVar with anotherVar in athirdVar
>> compiler complains.
>>
> This works OK at my house with handler local vars.
>
> Typo? It should be "with" and not "wiht".
>
> Sometimes a weird character shows up in the script and breaks
> compiling. Try replacing [hee hee] the entire line.
>
> If that fails, let us know the compiling error.
>
> Dar Scott
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list