我有一段代码正在尝试运行,但是我试图将变量包含在我的字符串中。这可以在
行中找到put" A"进入字段"字段_(位置)_( lettersinword )
这两个带星号的单词是我想要包含的变量。我该怎么做呢?
global finalword
global lettersinword
global position
position = 0
on mouseUp
repeat until position = lettersinword
add 1 to position
if char(position) of finalword = "a" then
put "A" into field "Field_(*position*)_(*lettersinword*)
end if
end repeat
end mouseUp
答案 0 :(得分:0)
您可以在LiveCode中使用字符串连接&
,但您还需要将连接括在括号中:
...
put "A" into field ("Field_" & position & "_" & lettersinword)
...