如何在运行时添加和附加代码? - livecode

时间:2014-05-09 09:20:18

标签: livecode

我想添加代码并将其附加到运行时。

实施例: 此代码是在运行时添加代码之前的

on opencard
   emptyvariable
end opencard

command selectvdofile
   answer file "Select Video file"
   put it into fld "txt_namefile"
   put it into namefile
end selectvdofile

此代码是在运行时

上添加代码之后
    on opencard
       emptyvariable
       ------------------------- 
       put "test" into TestV << This line
    end opencard

    command selectvdofile
       answer file "Select Video file"
       put it into fld "txt_namefile"
       put it into namefile
    end selectvdofile

任何人都可以为我显示代码?

1 个答案:

答案 0 :(得分:0)

这是一个例子。最好在测试前保存堆栈!

on mouseUp
   local tScript, tLine

   put the script of card "MyCard" into tScript
   put lineOffset("end opencard", tScript) into tLine

   if tLine > 0 then
     put format("put \"test\" into TestV") & LF before line tLine of tScript
     set the script of card "MyCard" to tScript
   end if
end mouseUp