1
0

Implement function key

This commit is contained in:
otya128
2016-12-23 20:52:39 +09:00
parent aa3c8af549
commit 26ad351c70
2 changed files with 26 additions and 6 deletions

View File

@@ -2889,6 +2889,20 @@ class BuiltinFunction
array.doubleArray.array[offset..offset + len] = value.castDouble;
}
}
static void KEY(PetitComputer p, int index, wstring key)
{
index--;
if (index < 0 || index >= p.functionKey.length)
throw new OutOfRange("KEY", 1);
p.functionKey[index] = key.dup;
}
static void KEY(PetitComputer p, int index, out Array!wchar key)
{
index--;
if (index < 0 || index >= p.functionKey.length)
throw new OutOfRange("KEY", 1);
key = new Array!wchar(cast(wchar[])p.functionKey[index]);
}
//alias void function(PetitComputer, Value[], Value[]) BuiltinFunc;
static BuiltinFunctions[wstring] builtinFunctions;
static wstring getBasicName(BFD)(const wstring def)