【发布时间】:2018-04-04 21:17:45
【问题描述】:
我对此很陌生,所以希望您能帮帮我。
我正在编程灯光,我喜欢做的是从我的灯光台上获取一个变量(一个名为“4 Mythos Stage”的文本字符串),然后拆分成不同的变量。
从我使用的桌子上获取变量:
return function ()
local Layer1 = gma.user.getvar("Layer1") -- I placed "4 Mythos Stage" variable in Layer1
gma.feedback(Layer1) -- gives feedback 4 Mythos Stage
end
现在我想将字符串拆分为 3 个新的局部变量,名为:
local number -- should produce 4
local fixturetype -- should produce Mythos
local location -- should produce Stage
我尝试了以下方法:
local number = string.match('Layer1', '%d+')
local fixturetype = string.match('Layer1', '%a+')
local location = string.match('Layer1', '%a+')
这不起作用,所以有人可以帮助我朝着正确的方向前进。我会非常感激的。
致以诚挚的问候,
马丁
【问题讨论】: