1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-05 00:40:26 +00:00

Allows setting fixed-length strings from the IDE.

Displaying them was buggy too, due to them having CHR$(0) before being initialized.
This commit is contained in:
FellippeHeitor 2021-08-03 15:14:18 -03:00
parent 7f0649aa33
commit 600fa69786
2 changed files with 5 additions and 5 deletions

View file

@ -279,11 +279,11 @@ SUB vwatch (globalVariables AS _OFFSET, localVariables AS _OFFSET)
vw_address = _CV(_OFFSET, LEFT$(vw_buf$, LEN(vw_address))) 'pointer to actual data
vw_varSize = CVL(MID$(vw_buf$, LEN(vw_address) + 1))
IF vw_varSize = LEN(vw_value$) THEN
'resize was successful
vw_m = _MEM(vw_address, vw_varSize)
_MEMPUT vw_m, vw_m.OFFSET, vw_value$
IF vw_varSize < LEN(vw_value$) THEN
vw_value$ = LEFT$(vw_value$, vw_varSize)
END IF
vw_m = _MEM(vw_address, vw_varSize)
_MEMPUT vw_m, vw_m.OFFSET, vw_value$
CASE "current sub"
vw_cmd$ = "current sub:" + LEFT$(vwatch_stack(vwatch_sublevel), INSTR(vwatch_stack(vwatch_sublevel), ",") - 1)
GOSUB SendCommand

View file

@ -8070,7 +8070,7 @@ FUNCTION idevariablewatchbox$(currentScope$, filter$, selectVar)
IF IdeDebugMode > 0 THEN
IF usedVariableList(x).subfunc = currentScope$ OR usedVariableList(x).subfunc = "" THEN
IF usedVariableList(x).watch THEN
l$ = l$ + " = " + CHR$(16) + CHR$(variableNameColor) + usedVariableList(x).mostRecentValue
l$ = l$ + " = " + CHR$(16) + CHR$(variableNameColor) + StrReplace$(usedVariableList(x).mostRecentValue, CHR$(0), " ")
END IF
ELSE
l$ = l$ + " <out of scope>"