1
1
Fork 0
mirror of https://github.com/boxgaming/qbjs.git synced 2024-09-19 20:14:58 +00:00

Fixed issue with array declaration introduced with update from 0.7.0 to correctly handle (x To y) formatted array declarations

This commit is contained in:
boxgaming 2023-06-02 16:11:38 -05:00
parent 565c1369b9
commit 87bdf14eb8
2 changed files with 19 additions and 12 deletions

View file

@ -1550,15 +1550,17 @@ var FormatArraySize = null;
if ( i > 1) {
sizeParams = sizeParams + ",";
}
if ( scount == 1) {
var j = 0; /* INTEGER */ var toIndex = 0; /* INTEGER */
toIndex = 0;
var ___v2793420 = 0; for ( j= 0; j <= scount; j= j + 1) { if (QB.halted()) { return; } ___v2793420++; if (___v2793420 % 100 == 0) { await QB.autoLimit(); }
if ("TO" == (QB.func_UCase( QB.arrayValue(subparts, [ j]).value)) ) {
toIndex = j;
break;
}
}
if ( toIndex == 0) {
sizeParams = sizeParams + "{l:0,u:" + QB.arrayValue(subparts, [ 1]).value + "}";
} else {
var toIndex = 0; /* INTEGER */
var ___v2793420 = 0; for ( toIndex= 0; toIndex <= scount; toIndex= toIndex + 1) { if (QB.halted()) { return; } ___v2793420++; if (___v2793420 % 100 == 0) { await QB.autoLimit(); }
if ("TO" == (QB.func_UCase( QB.arrayValue(subparts, [ toIndex]).value)) ) {
break;
}
}
var lb = ''; /* STRING */ var ub = ''; /* STRING */
lb = (await func_Join( subparts , 1, toIndex - 1, " "));
ub = (await func_Join( subparts , toIndex + 1, - 1, " "));

View file

@ -1687,14 +1687,19 @@ Function FormatArraySize$ (sizeString As String)
If i > 1 Then sizeParams = sizeParams + ","
If scount = 1 Then
Dim As Integer j, toIndex
toIndex = 0
For j = 0 To scount
If "TO" = UCase$(subparts(j)) Then
toIndex = j
Exit For
End If
Next j
If toIndex = 0 Then
sizeParams = sizeParams + "{l:0,u:" + subparts(1) + "}"
Else
' This must be the "x To y" format
Dim toIndex As Integer
For toIndex = 0 To scount
If "TO" = UCase$(subparts(toIndex)) Then Exit For
Next toIndex
Dim As String lb, ub
lb = Join(subparts(), 1, toIndex - 1, " ")
ub = Join(subparts(), toIndex + 1, -1, " ")