1
0

INKEY$()を実装

This commit is contained in:
otya128
2016-08-31 18:19:14 +09:00
parent 8eb2790b0f
commit ed8017b4e0
2 changed files with 14 additions and 0 deletions

View File

@@ -1447,6 +1447,10 @@ class BuiltinFunction
{
return (label in p.vm.currentSlot.globalLabel) != null;
}
static wstring INKEY(PetitComputer p)
{
return p.inkey();
}
//alias void function(PetitComputer, Value[], Value[]) BuiltinFunc;
static BuiltinFunctions[wstring] builtinFunctions;
static wstring getBasicName(BFD)(const wstring def)

View File

@@ -1536,6 +1536,16 @@ class PetitComputer
//display = olddisplay;
return buffer;
}
wstring inkey()
{
if (!keybufferlen)
{
return "";
}
auto result = keybuffer[(keybufferpos - keybufferlen)];
keybufferlen--;
return result.key.to!wstring;
}
int CSRX;
int CSRY;
int CSRZ;