mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-06-29 11:40:38 +00:00
Reduces preventable errors (IDE).
This commit is contained in:
parent
0f8d345cb1
commit
3480d74d32
|
@ -141,6 +141,7 @@ FUNCTION ide2 (ignore)
|
||||||
|
|
||||||
c$ = idecommand$
|
c$ = idecommand$
|
||||||
|
|
||||||
|
IDEerrorMessage:
|
||||||
'report any IDE errors which have occurred
|
'report any IDE errors which have occurred
|
||||||
IF ideerror THEN
|
IF ideerror THEN
|
||||||
IF IdeDebugMode THEN
|
IF IdeDebugMode THEN
|
||||||
|
@ -165,9 +166,13 @@ FUNCTION ide2 (ignore)
|
||||||
|
|
||||||
IF (ideerror > 1) THEN
|
IF (ideerror > 1) THEN
|
||||||
'Don't show too much detail if user just tried loading an invalid file
|
'Don't show too much detail if user just tried loading an invalid file
|
||||||
ideerrormessageTITLE$ = ideerrormessageTITLE$ + " (" + str2$(_ERRORLINE) + "-" + str2$(_INCLERRORLINE)
|
ideerrormessageTITLE$ = ideerrormessageTITLE$ + " ("
|
||||||
|
IF _ERRORLINE > 0 OR _INCLERRORLINE > 0 THEN
|
||||||
|
ideerrormessageTITLE$ = ideerrormessageTITLE$ + str2$(_ERRORLINE) + "-" + str2$(_INCLERRORLINE)
|
||||||
|
END IF
|
||||||
IF LEN(AutoBuildMsg$) THEN ideerrormessageTITLE$ = ideerrormessageTITLE$ + "-" + MID$(AutoBuildMsg$, 10)
|
IF LEN(AutoBuildMsg$) THEN ideerrormessageTITLE$ = ideerrormessageTITLE$ + "-" + MID$(AutoBuildMsg$, 10)
|
||||||
ideerrormessageTITLE$ = ideerrormessageTITLE$ + ")"
|
ideerrormessageTITLE$ = ideerrormessageTITLE$ + ")"
|
||||||
|
IF ideerrormessageTITLE$ = "Error ()" THEN ideerrormessageTITLE$ = "Error"
|
||||||
IF AttemptToLoadRecent = -1 THEN
|
IF AttemptToLoadRecent = -1 THEN
|
||||||
'Offer to cleanup recent file list, removing invalid entries
|
'Offer to cleanup recent file list, removing invalid entries
|
||||||
PCOPY 2, 0
|
PCOPY 2, 0
|
||||||
|
@ -543,10 +548,11 @@ FUNCTION ide2 (ignore)
|
||||||
f$ = RIGHT$(c$, LEN(c$) - 1)
|
f$ = RIGHT$(c$, LEN(c$) - 1)
|
||||||
IF FileHasExtension(f$) = 0 THEN f$ = f$ + ".bas"
|
IF FileHasExtension(f$) = 0 THEN f$ = f$ + ".bas"
|
||||||
path$ = idezgetfilepath$(ideroot$, f$)
|
path$ = idezgetfilepath$(ideroot$, f$)
|
||||||
|
IF ideerror > 1 THEN PCOPY 3, 0: SCREEN , , 3, 0: GOTO IDEerrorMessage
|
||||||
|
|
||||||
'(copied from ideopen)
|
'(copied from ideopen)
|
||||||
ideerror = 2
|
ideerror = 2
|
||||||
OPEN path$ + idepathsep$ + f$ FOR INPUT AS #150: CLOSE #150
|
IF _FILEEXISTS(path$ + idepathsep$ + f$) = 0 THEN GOTO IDEerrorMessage
|
||||||
PCOPY 3, 0
|
PCOPY 3, 0
|
||||||
IF BinaryFormatCheck%(path$, idepathsep$, f$) > 0 THEN GOTO skipload
|
IF BinaryFormatCheck%(path$, idepathsep$, f$) > 0 THEN GOTO skipload
|
||||||
ideerror = 3
|
ideerror = 3
|
||||||
|
@ -3314,6 +3320,7 @@ FUNCTION ide2 (ignore)
|
||||||
ELSE
|
ELSE
|
||||||
a$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
a$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
||||||
END IF
|
END IF
|
||||||
|
IF ideerror > 1 THEN PCOPY 3, 0: SCREEN , , 3, 0: GOTO IDEerrorMessage
|
||||||
ELSE
|
ELSE
|
||||||
idesave idepath$ + idepathsep$ + ideprogname$
|
idesave idepath$ + idepathsep$ + ideprogname$
|
||||||
END IF
|
END IF
|
||||||
|
@ -5922,9 +5929,9 @@ FUNCTION ide2 (ignore)
|
||||||
ELSE
|
ELSE
|
||||||
r$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
r$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
||||||
END IF
|
END IF
|
||||||
IF r$ = "C" THEN
|
PCOPY 3, 0: SCREEN , , 3, 0
|
||||||
PCOPY 3, 0: SCREEN , , 3, 0: GOTO ideloop
|
IF ideerror > 1 THEN GOTO IDEerrorMessage
|
||||||
END IF
|
IF r$ = "C" THEN GOTO ideloop
|
||||||
ELSE
|
ELSE
|
||||||
idesave idepath$ + idepathsep$ + ideprogname$
|
idesave idepath$ + idepathsep$ + ideprogname$
|
||||||
END IF
|
END IF
|
||||||
|
@ -5951,6 +5958,7 @@ FUNCTION ide2 (ignore)
|
||||||
r$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
r$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
||||||
END IF
|
END IF
|
||||||
PCOPY 3, 0: SCREEN , , 3, 0
|
PCOPY 3, 0: SCREEN , , 3, 0
|
||||||
|
IF ideerror > 1 THEN GOTO IDEerrorMessage
|
||||||
IF r$ = "C" THEN GOTO ideloop
|
IF r$ = "C" THEN GOTO ideloop
|
||||||
ELSE
|
ELSE
|
||||||
idesave idepath$ + idepathsep$ + ideprogname$
|
idesave idepath$ + idepathsep$ + ideprogname$
|
||||||
|
@ -6052,6 +6060,7 @@ FUNCTION ide2 (ignore)
|
||||||
ELSE
|
ELSE
|
||||||
r$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
r$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
||||||
END IF
|
END IF
|
||||||
|
IF ideerror > 1 THEN PCOPY 3, 0: SCREEN , , 3, 0: GOTO IDEerrorMessage
|
||||||
IF r$ = "C" THEN GOTO ideloop
|
IF r$ = "C" THEN GOTO ideloop
|
||||||
ELSE
|
ELSE
|
||||||
idesave idepath$ + idepathsep$ + ideprogname$
|
idesave idepath$ + idepathsep$ + ideprogname$
|
||||||
|
@ -6060,6 +6069,7 @@ FUNCTION ide2 (ignore)
|
||||||
END IF '"Y"
|
END IF '"Y"
|
||||||
END IF 'unsaved
|
END IF 'unsaved
|
||||||
r$ = idefiledialog$("", 1)
|
r$ = idefiledialog$("", 1)
|
||||||
|
IF ideerror > 1 THEN PCOPY 3, 0: SCREEN , , 3, 0: GOTO IDEerrorMessage
|
||||||
IF r$ <> "C" THEN ideunsaved = -1: idechangemade = 1: idelayoutallow = 2: ideundobase = 0: QuickNavTotal = 0: ModifyCOMMAND$ = "": idefocusline = 0
|
IF r$ <> "C" THEN ideunsaved = -1: idechangemade = 1: idelayoutallow = 2: ideundobase = 0: QuickNavTotal = 0: ModifyCOMMAND$ = "": idefocusline = 0
|
||||||
PCOPY 3, 0: SCREEN , , 3, 0
|
PCOPY 3, 0: SCREEN , , 3, 0
|
||||||
GOSUB redrawItAll: GOTO ideloop
|
GOSUB redrawItAll: GOTO ideloop
|
||||||
|
@ -6074,6 +6084,7 @@ FUNCTION ide2 (ignore)
|
||||||
ELSE
|
ELSE
|
||||||
a$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
a$ = idefiledialog$(ProposedTitle$ + ".bas", 2)
|
||||||
END IF
|
END IF
|
||||||
|
IF ideerror > 1 THEN PCOPY 3, 0: SCREEN , , 3, 0: GOTO IDEerrorMessage
|
||||||
ELSE
|
ELSE
|
||||||
idesave idepath$ + idepathsep$ + ideprogname$
|
idesave idepath$ + idepathsep$ + ideprogname$
|
||||||
END IF
|
END IF
|
||||||
|
@ -6093,7 +6104,9 @@ FUNCTION ide2 (ignore)
|
||||||
ELSE
|
ELSE
|
||||||
a$ = idefiledialog$(ideprogname$, 2)
|
a$ = idefiledialog$(ideprogname$, 2)
|
||||||
END IF
|
END IF
|
||||||
PCOPY 3, 0: SCREEN , , 3, 0: GOTO ideloop
|
PCOPY 3, 0: SCREEN , , 3, 0
|
||||||
|
IF ideerror > 1 THEN GOTO IDEerrorMessage
|
||||||
|
GOTO ideloop
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
IF LEFT$(menu$(m, s), 1) = "~" THEN 'Ignore disabled items (starting with "~")
|
IF LEFT$(menu$(m, s), 1) = "~" THEN 'Ignore disabled items (starting with "~")
|
||||||
|
@ -7296,7 +7309,7 @@ SUB DebugMode
|
||||||
END IF
|
END IF
|
||||||
CASE "global var", "local var"
|
CASE "global var", "local var"
|
||||||
tempIndex& = CVL(LEFT$(value$, 4))
|
tempIndex& = CVL(LEFT$(value$, 4))
|
||||||
address%& = _CV(_OFFSET, MID$(value$, 5))
|
address%& = VAL(MID$(value$, 5))
|
||||||
varType$ = usedVariableList(tempIndex&).varType
|
varType$ = usedVariableList(tempIndex&).varType
|
||||||
IF INSTR(varType$, "STRING *") THEN varType$ = "STRING"
|
IF INSTR(varType$, "STRING *") THEN varType$ = "STRING"
|
||||||
SELECT CASE varType$
|
SELECT CASE varType$
|
||||||
|
@ -7310,7 +7323,7 @@ SUB DebugMode
|
||||||
CASE "_OFFSET", "_UNSIGNED _OFFSET": varSize& = LEN(dummy%&)
|
CASE "_OFFSET", "_UNSIGNED _OFFSET": varSize& = LEN(dummy%&)
|
||||||
CASE "STRING": varSize& = LEN(dummy%&) + LEN(dummy&)
|
CASE "STRING": varSize& = LEN(dummy%&) + LEN(dummy&)
|
||||||
END SELECT
|
END SELECT
|
||||||
cmd$ = "get address:" + MKL$(tempIndex&) + MKI$(1) + MKL$(varSize&) + _MK$(_OFFSET, address%&)
|
cmd$ = "get address:" + MKL$(tempIndex&) + MKI$(1) + MKL$(varSize&) + STR$(address%&)
|
||||||
GOSUB SendCommand
|
GOSUB SendCommand
|
||||||
CASE "address read"
|
CASE "address read"
|
||||||
tempIndex& = CVL(LEFT$(value$, 4))
|
tempIndex& = CVL(LEFT$(value$, 4))
|
||||||
|
@ -7342,7 +7355,7 @@ SUB DebugMode
|
||||||
strLength& = CVL(MID$(recvData$, 5))
|
strLength& = CVL(MID$(recvData$, 5))
|
||||||
END IF
|
END IF
|
||||||
address$ = LEFT$(recvData$, LEN(dummy%&)) 'Pointer to data
|
address$ = LEFT$(recvData$, LEN(dummy%&)) 'Pointer to data
|
||||||
cmd$ = "get address:" + MKL$(tempIndex&) + MKI$(2) + MKL$(strLength&) + _MK$(_OFFSET, address%&)
|
cmd$ = "get address:" + MKL$(tempIndex&) + MKI$(2) + MKL$(strLength&) + STR$(address%&)
|
||||||
GOSUB SendCommand
|
GOSUB SendCommand
|
||||||
GOTO vwatch_string_seq1_done
|
GOTO vwatch_string_seq1_done
|
||||||
END IF
|
END IF
|
||||||
|
@ -9794,6 +9807,8 @@ FUNCTION idefiledialog$(programname$, mode AS _BYTE)
|
||||||
IF _DIREXISTS(path$ + idepathsep$ + f$) THEN
|
IF _DIREXISTS(path$ + idepathsep$ + f$) THEN
|
||||||
'check/acquire file path
|
'check/acquire file path
|
||||||
path$ = idezgetfilepath$(path$, f$ + idepathsep$) 'note: path ending with pathsep needn't contain a file
|
path$ = idezgetfilepath$(path$, f$ + idepathsep$) 'note: path ending with pathsep needn't contain a file
|
||||||
|
IF ideerror > 1 THEN EXIT FUNCTION
|
||||||
|
|
||||||
IF LEN(newpath$) = 0 THEN
|
IF LEN(newpath$) = 0 THEN
|
||||||
idetxt(o(1).txt) = ""
|
idetxt(o(1).txt) = ""
|
||||||
focus = 1
|
focus = 1
|
||||||
|
@ -9812,6 +9827,7 @@ FUNCTION idefiledialog$(programname$, mode AS _BYTE)
|
||||||
IF INSTR(f$, "/") > 0 OR INSTR(f$, "\") > 0 THEN
|
IF INSTR(f$, "/") > 0 OR INSTR(f$, "\") > 0 THEN
|
||||||
'path + wildcards
|
'path + wildcards
|
||||||
path$ = idezgetfilepath$(path$, f$) 'note: path ending with pathsep needn't contain a file
|
path$ = idezgetfilepath$(path$, f$) 'note: path ending with pathsep needn't contain a file
|
||||||
|
IF ideerror > 1 THEN EXIT FUNCTION
|
||||||
idetxt(o(3).txt) = idezpathlist$(path$)
|
idetxt(o(3).txt) = idezpathlist$(path$)
|
||||||
o(3).sel = -1
|
o(3).sel = -1
|
||||||
END IF
|
END IF
|
||||||
|
@ -9831,6 +9847,7 @@ FUNCTION idefiledialog$(programname$, mode AS _BYTE)
|
||||||
|
|
||||||
DirectLoad:
|
DirectLoad:
|
||||||
path$ = idezgetfilepath$(path$, f$) 'repeat in case of DirectLoad
|
path$ = idezgetfilepath$(path$, f$) 'repeat in case of DirectLoad
|
||||||
|
IF ideerror > 1 THEN EXIT FUNCTION
|
||||||
|
|
||||||
IF mode = 1 THEN
|
IF mode = 1 THEN
|
||||||
IF _FILEEXISTS(path$ + idepathsep$ + f$) = 0 THEN
|
IF _FILEEXISTS(path$ + idepathsep$ + f$) = 0 THEN
|
||||||
|
@ -9840,7 +9857,7 @@ FUNCTION idefiledialog$(programname$, mode AS _BYTE)
|
||||||
|
|
||||||
'check file exists
|
'check file exists
|
||||||
ideerror = 2
|
ideerror = 2
|
||||||
OPEN path$ + idepathsep$ + f$ FOR INPUT AS #150: CLOSE #150
|
IF _FILEEXISTS(path$ + idepathsep$ + f$) = 0 THEN EXIT FUNCTION
|
||||||
|
|
||||||
IF BinaryFormatCheck%(path$, idepathsep$, f$) > 0 THEN
|
IF BinaryFormatCheck%(path$, idepathsep$, f$) > 0 THEN
|
||||||
IF LEN(IdeOpenFile) THEN
|
IF LEN(IdeOpenFile) THEN
|
||||||
|
@ -12453,6 +12470,7 @@ FUNCTION idezgetfilepath$ (root$, f$)
|
||||||
IF os$ = "WIN" THEN
|
IF os$ = "WIN" THEN
|
||||||
IF RIGHT$(p2$, 1) = ":" THEN p2$ = p2$ + "\" 'force change to root of drive
|
IF RIGHT$(p2$, 1) = ":" THEN p2$ = p2$ + "\" 'force change to root of drive
|
||||||
END IF
|
END IF
|
||||||
|
IF _DIREXISTS(p2$) = 0 THEN EXIT FUNCTION
|
||||||
|
|
||||||
CHDIR p2$
|
CHDIR p2$
|
||||||
ideerror = 1
|
ideerror = 1
|
||||||
|
|
Loading…
Reference in a new issue