Dependence on Programming Experts
Brian Yennie
briany at qldlearning.com
Fri Jul 14 00:11:21 EDT 2006
For fun, try inserting this as a front script:
on returnInField
get offset(("field ""e&"script""e&" of card
""e&"revscript""e), the long name of the target)
if (it = 1) then
put word 2 of the selectedLine into lineNum
put line (lineNum) of fld "script" of card "revscript" into prevLine
if (token 2 of prevLine is "=") then
put ("put"&&(token 3 to -1 of prevLine)&&"into"&&(token 1 of
prevLine)) into line (lineNum) of fld "script" of card "revscript"
select empty
send "revFormatField lineNum,lineNum" to card "revscript"
select after line (lineNum) of fld "script" of card "revscript"
end if
end if
pass returnInField
end returnInField
Now edit any script and enter "x=5" or some other simple assignment on
a line by itself. Hit return. Voila, translation to "verbose" =)!
I'm sure there are various ways a plugin could use this sort of magic
to allow customized syntax, without needing changes to the Rev engine.
It would just become a script editor convenience. You could always trap
script editing messages to even hide the conversion rather than
converting it on the fly.
- Brian
More information about the use-livecode
mailing list