Skip to content

Commit 9cf26c1

Browse files
Merge pull request #202 from QB64Team/master-hotfix
Master hotfix
2 parents 56f5386 + 1c6bb37 commit 9cf26c1

File tree

6 files changed

+41
-42
lines changed

6 files changed

+41
-42
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
- Fixes issue with `Put #` and variable-length strings in UDTs (`Binary` files).
4646
- Fixes issue with recursive functions without parameters.
4747

48+
### Fixed in 2.0.1
49+
- Fix "Duplicate definition" error with Static arrays in Subs/Functions with active On Error trapping.
50+
- Fix internal UDT arrays not resetting when a new file is loaded.
51+
- Fix issue preventing `$Debug` from working in Windows versions prior to Windows 10.
52+
4853
### Windows
4954
- Allows `$Console:Only` programs to return `_WindowHandle`.
5055
- Saving a file to the root of a drive would display double backslashes in the Recent Files list.

internal/c/libqb.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12671,19 +12671,22 @@ int32 func__blink(){
1267112671
}
1267212672

1267312673
int64 func__handle(){
12674-
//#ifdef QB64_GUI
12675-
#ifdef QB64_WINDOWS
12676-
#ifdef DEPENDENCY_CONSOLE_ONLY
12674+
#ifdef QB64_WINDOWS
12675+
#ifdef DEPENDENCY_CONSOLE_ONLY
12676+
if (!window_handle) {
1267712677
char pszConsoleTitle[1024];
1267812678
GetConsoleTitle(pszConsoleTitle,1024);
1267912679
window_handle = FindWindow(NULL, pszConsoleTitle);
12680-
#else
12681-
if (!window_exists) return 0;
12682-
#endif
12683-
while (!window_handle){Sleep(100);}
12680+
}
1268412681
return (ptrszint)window_handle;
1268512682
#endif
12686-
//#endif
12683+
12684+
if (!screen_hide){
12685+
while (!window_exists){Sleep(100);}
12686+
while (!window_handle){Sleep(100);}
12687+
return (ptrszint)window_handle;
12688+
}
12689+
#endif
1268712690

1268812691
return 0;
1268912692
}

internal/support/vwatch/vwatch.bm

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,14 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
2424
SUB unlockvWatchHandle
2525
SUB set_qbs_size (target AS _OFFSET, BYVAL length&)
2626
SUB call_setbits (BYVAL bsize AS _UNSIGNED LONG, array AS _OFFSET, BYVAL index AS _OFFSET, BYVAL value AS _INTEGER64)
27+
SUB set_foreground_window (BYVAL hwnd AS _OFFSET)
2728
FUNCTION stop_program_state&
2829
FUNCTION check_lbound%& (array AS _OFFSET, BYVAL index AS LONG, BYVAL num_indexes AS LONG)
2930
FUNCTION check_ubound%& (array AS _OFFSET, BYVAL index AS LONG, BYVAL num_indexes AS LONG)
3031
FUNCTION call_getubits~&& (BYVAL bsize AS _UNSIGNED LONG, array AS _OFFSET, BYVAL index AS _OFFSET)
3132
FUNCTION call_getbits&& (BYVAL bsize AS _UNSIGNED LONG, array AS _OFFSET, BYVAL index AS _OFFSET)
3233
END DECLARE
3334

34-
$IF WIN THEN
35-
DECLARE CUSTOMTYPE LIBRARY
36-
FUNCTION vwSetForegroundWindow& ALIAS "SetForegroundWindow" (BYVAL hWnd AS _OFFSET)
37-
END DECLARE
38-
$END IF
39-
4035
IF vw_bypass THEN EXIT SUB
4136

4237
vwatch_goto = 0
@@ -130,9 +125,7 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
130125
GOSUB SendCallStack
131126
vw_cmd$ = "error:" + MKL$(vw_lastLine)
132127
GOSUB SendCommand
133-
$IF WIN THEN
134-
vw_i = vwSetForegroundWindow&(vw_ideHwnd)
135-
$END IF
128+
set_foreground_window vw_ideHwnd
136129
EXIT SUB
137130
ELSEIF vwatch_linenumber = -2 THEN
138131
'report a new sub/function has been "entered"
@@ -228,9 +221,7 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
228221
vw_cmd$ = "current sub:" + LEFT$(vwatch_stack(vwatch_sublevel), INSTR(vwatch_stack(vwatch_sublevel), ",") - 1)
229222
GOSUB SendCommand
230223

231-
$IF WIN THEN
232-
vw_i = vwSetForegroundWindow&(vw_ideHwnd)
233-
$END IF
224+
set_foreground_window vw_ideHwnd
234225

235226
DO 'main loop
236227
IF stop_program_state& THEN vw_bypass = -1: EXIT DO

source/global/version.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ DIM SHARED Version AS STRING
22
DIM SHARED DevChannel AS STRING
33
DIM SHARED AutoBuildMsg AS STRING
44

5-
Version$ = "2.0"
5+
Version$ = "2.0.1"
66
DevChannel$ = "Stable Release"
77
IF _FILEEXISTS("internal/version.txt") THEN
88
versionfile = FREEFILE

source/icon.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
0 ICON "qb64.ico"
22

33
1 VERSIONINFO
4-
FILEVERSION 2,0,0,0
5-
PRODUCTVERSION 2,0,0,0
4+
FILEVERSION 2,0,1,0
5+
PRODUCTVERSION 2,0,1,0
66
BEGIN
77
BLOCK "StringFileInfo"
88
BEGIN
99
BLOCK "040904E4"
1010
BEGIN
1111
VALUE "CompanyName","QB64\0"
1212
VALUE "FileDescription","QB64 Compiler\0"
13-
VALUE "FileVersion","2.0\0"
13+
VALUE "FileVersion","2.0.1\0"
1414
VALUE "InternalName","qb64.bas\0"
1515
VALUE "LegalCopyright","LGPL\0"
1616
VALUE "LegalTrademarks","\0"
1717
VALUE "OriginalFilename","qb64.exe\0"
1818
VALUE "ProductName","QB64\0"
19-
VALUE "ProductVersion","2.0\0"
19+
VALUE "ProductVersion","2.0.1\0"
2020
VALUE "Comments","QB64 is a modern extended BASIC programming language that retains QB4.5/QBasic compatibility and compiles native binaries for Windows, Linux and macOS.\0"
2121
END
2222
END

source/qb64.bas

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -640,22 +640,7 @@ REDIM SHARED constdefined(constmax) AS LONG
640640
'UDT
641641
'names
642642
DIM SHARED lasttype AS LONG
643-
REDIM SHARED udtxname(1000) AS STRING * 256
644-
REDIM SHARED udtxcname(1000) AS STRING * 256
645-
REDIM SHARED udtxsize(1000) AS LONG
646-
REDIM SHARED udtxbytealign(1000) AS INTEGER 'first element MUST be on a byte alignment & size is a multiple of 8
647-
REDIM SHARED udtxnext(1000) AS LONG
648-
REDIM SHARED udtxvariable(1000) AS INTEGER 'true if the udt contains variable length elements
649-
'elements
650-
REDIM SHARED lasttypeelement AS LONG
651-
REDIM SHARED udtename(1000) AS STRING * 256
652-
REDIM SHARED udtecname(1000) AS STRING * 256
653-
REDIM SHARED udtebytealign(1000) AS INTEGER
654-
REDIM SHARED udtesize(1000) AS LONG
655-
REDIM SHARED udtetype(1000) AS LONG
656-
REDIM SHARED udtetypesize(1000) AS LONG
657-
REDIM SHARED udtearrayelements(1000) AS LONG
658-
REDIM SHARED udtenext(1000) AS LONG
643+
DIM SHARED lasttypeelement AS LONG
659644

660645
TYPE idstruct
661646

@@ -1427,6 +1412,21 @@ addmetainclude$ = ""
14271412
nextrunlineindex = 1
14281413
lasttype = 0
14291414
lasttypeelement = 0
1415+
REDIM SHARED udtxname(1000) AS STRING * 256
1416+
REDIM SHARED udtxcname(1000) AS STRING * 256
1417+
REDIM SHARED udtxsize(1000) AS LONG
1418+
REDIM SHARED udtxbytealign(1000) AS INTEGER 'first element MUST be on a byte alignment & size is a multiple of 8
1419+
REDIM SHARED udtxnext(1000) AS LONG
1420+
REDIM SHARED udtxvariable(1000) AS INTEGER 'true if the udt contains variable length elements
1421+
'elements
1422+
REDIM SHARED udtename(1000) AS STRING * 256
1423+
REDIM SHARED udtecname(1000) AS STRING * 256
1424+
REDIM SHARED udtebytealign(1000) AS INTEGER
1425+
REDIM SHARED udtesize(1000) AS LONG
1426+
REDIM SHARED udtetype(1000) AS LONG
1427+
REDIM SHARED udtetypesize(1000) AS LONG
1428+
REDIM SHARED udtearrayelements(1000) AS LONG
1429+
REDIM SHARED udtenext(1000) AS LONG
14301430
definingtype = 0
14311431
definingtypeerror = 0
14321432
constlast = -1
@@ -13923,7 +13923,7 @@ FUNCTION allocarray (n2$, elements$, elementsize, udt)
1392313923
'REDIM (not DIM) must be used to redefine an array
1392413924
IF redimoption = 0 THEN
1392513925
f12$ = f12$ + CRLF + "if (" + n$ + "[2]&1){" 'array is defined
13926-
f12$ = f12$ + CRLF + "error(10);" 'cannot redefine an array without using REDIM!
13926+
f12$ = f12$ + CRLF + "if (!error_occurred) error(10);" 'cannot redefine an array without using REDIM!
1392713927
f12$ = f12$ + CRLF + "}else{"
1392813928
ELSE
1392913929
'--------ERASE EXISTING ARRAY IF NECESSARY--------

0 commit comments

Comments
 (0)