INKEY$()を実装

This commit is contained in:
otya128 committed 2016-08-31 18:19:14 +09:00
1 parent 8eb2790b0f
commit ed8017b4e0
2 files changed
+14

No files matched your search

+4
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)
+10
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;