Fix LEFT$
This commit is contained in:
@@ -1224,6 +1224,10 @@ class BuiltinFunction
|
|||||||
//INSTRSUSBTLEFT
|
//INSTRSUSBTLEFT
|
||||||
static wstring LEFT(wstring str, int len)
|
static wstring LEFT(wstring str, int len)
|
||||||
{
|
{
|
||||||
|
if (len >= str.length)
|
||||||
|
{
|
||||||
|
return str[0..$];
|
||||||
|
}
|
||||||
return str[0..len];
|
return str[0..len];
|
||||||
}
|
}
|
||||||
static wstring RIGHT(wstring str, int len)
|
static wstring RIGHT(wstring str, int len)
|
||||||
|
|||||||
@@ -1180,7 +1180,7 @@ class PetitComputer
|
|||||||
writeln(sbe.to!string);
|
writeln(sbe.to!string);
|
||||||
writeln(sbe.getErrorMessage2);
|
writeln(sbe.getErrorMessage2);
|
||||||
auto loc = vm.currentLocation;
|
auto loc = vm.currentLocation;
|
||||||
console.print(loc.line, ":", loc.pos, ":", slot[vm.currentSlotNumber].getLine(loc));
|
console.print(vm.currentSlotNumber, ":", loc.line, ":", loc.pos, ":", slot[vm.currentSlotNumber].getLine(loc));
|
||||||
}
|
}
|
||||||
catch(Throwable t)
|
catch(Throwable t)
|
||||||
{
|
{
|
||||||
@@ -1193,9 +1193,10 @@ class PetitComputer
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
console.print(t.to!string);
|
console.print(t.to!string);
|
||||||
|
console.print("\n");
|
||||||
writeln(t);
|
writeln(t);
|
||||||
auto loc = vm.currentLocation;
|
auto loc = vm.currentLocation;
|
||||||
console.print(slot[vm.currentSlotNumber].getLine(loc));
|
console.print(vm.currentSlotNumber, ":", loc.line, ":", loc.pos, ":", slot[vm.currentSlotNumber].getLine(loc));
|
||||||
}
|
}
|
||||||
catch(Throwable t)
|
catch(Throwable t)
|
||||||
{
|
{
|
||||||
@@ -1248,7 +1249,7 @@ class PetitComputer
|
|||||||
writeln(sbe.getErrorMessage2);
|
writeln(sbe.getErrorMessage2);
|
||||||
writeln(sbe.func);
|
writeln(sbe.func);
|
||||||
loc = vm.currentLocation;
|
loc = vm.currentLocation;
|
||||||
console.print(loc.line, ":", loc.pos, ":", slot[vm.currentSlotNumber].getLine(loc));
|
console.print(vm.currentSlotNumber, ":", loc.line, ":", loc.pos, ":", slot[vm.currentSlotNumber].getLine(loc));
|
||||||
}
|
}
|
||||||
catch(Throwable t)
|
catch(Throwable t)
|
||||||
{
|
{
|
||||||
@@ -1261,8 +1262,9 @@ class PetitComputer
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
console.print(t.to!string);
|
console.print(t.to!string);
|
||||||
|
console.print("\n");
|
||||||
writeln(t);
|
writeln(t);
|
||||||
console.print(slot[vm.currentSlotNumber].getLine(vm.currentLocation));
|
console.print(vm.currentSlotNumber, ":", loc.line, ":", loc.pos, ":", slot[vm.currentSlotNumber].getLine(vm.currentLocation));
|
||||||
}
|
}
|
||||||
catch(Throwable t)
|
catch(Throwable t)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user