diff --git a/2.10/Source/ScriptForm.pas b/2.10/Source/ScriptForm.pas index 25d8c73..7b5e40c 100644 --- a/2.10/Source/ScriptForm.pas +++ b/2.10/Source/ScriptForm.pas @@ -377,6 +377,8 @@ type procedure SetVariation(AMachine: TatVirtualMachine); procedure GetVariable(AMachine: TatVirtualMachine); procedure SetVariable(AMachine: TatVirtualMachine); + procedure GetVariableStr(AMachine: TatVirtualMachine); + procedure SetVariableStr(AMachine: TatVirtualMachine); procedure CalculateScale(AMachine: TatVirtualMachine); procedure NormalizeVars(AMachine: TatVirtualMachine); procedure CalculateBounds(AMachine: TatVirtualMachine); @@ -1169,6 +1171,8 @@ begin Scripter.DefineMethod('SetVariation', 1, tkInteger, nil, SetVariation); Scripter.DefineMethod('GetVariable', 1, tkFloat, nil, GetVariable); Scripter.DefineMethod('SetVariable', 2, tkNone, nil, SetVariable); + Scripter.DefineMethod('GetVariableStr', 1, tkFloat, nil, GetVariableStr); + Scripter.DefineMethod('SetVariableStr', 2, tkNone, nil, SetVariableStr); Scripter.DefineMethod('CalculateScale', 0, tkNone, nil, CalculateScale); Scripter.DefineMethod('CalculateBounds', 0, tkNone, nil, CalculateBounds); Scripter.DefineMethod('NormalizeVars', 0, tkNone, nil, NormalizeVars); @@ -1747,6 +1751,32 @@ begin end end; +procedure TOperationLibrary.GetVariableStr(AMachine: TatVirtualMachine); +var + variable: string; + vb: double; +begin + with AMachine do + begin + variable := GetInputArgAsString(0); + ScriptEditor.cp.xform[ActiveTransform].GetVariable(variable, vb); + ReturnOutputArg(vb); + end +end; + +procedure TOperationLibrary.SetVariableStr(AMachine: TatVirtualMachine); +var + variable: string; + vb: double; +begin + with AMachine do + begin + variable := GetInputArgAsString(0); + vb := GetInputArgAsFloat(1); + ScriptEditor.cp.xform[ActiveTransform].SetVariable(variable, vb); + end +end; + procedure TOperationLibrary.FileCountProc(AMachine: TatVirtualMachine); begin with AMachine do