| Posted: 03:50pm 13 Jul 2019 |
Copy link to clipboard |
 Print this post |
|
MMBasic for DOS version 5.05.01. Error: Array Dimensions
I get the following eror message

Sub saveGame() Local loc as Integer, ext as Integer, obj As Integer, prp As Integer, evt As Integer, act As Integer Open "SITS2.DAT" For Output As #1 Print #1, curLoc For loc = 1 To maxLoc For ext = 1 to maxLocExt Print #1, locExt(loc,ext)e Next ext Next loc For obj = 1 To maxObj For prp = 1 to maxObjPrp Print #1, objPrp(obj,prp) Next prp Next obj For evt = 1 To maxEvt For act = 1 to maxEvtAct Print #1, evtAct(evt,act) Next act Next evt Close #1 End Sub
Sub loadGame() Local loc as Integer, ext as Integer, obj As Integer, prp As Integer, evt As Integer, act As Integer Local crLc$, locExit$, objPrp$, evtAct$ Open "SITS2.DAT" For Input As #1 Line Input #1, crLc$ : curLoc = Val(crLc$) For loc = 1 To maxLoc For ext = 1 to maxLocExt Line Input #1, locExit$ : locExt(loc,ext) = Val(locExit$) Next ext Next loc For obj = 1 To maxObj For prp = 1 to maxObjPrp Print "obj, prp=", obj, prp Line Input #1, objPrp$ Print "objPrp$=", objPrp$ objPrp(obj,prp) = Val(objPrp$) Error occurs here Next prp Next obj For evt = 1 To maxEvt For act = 1 to maxEvtAct Line Input #1, evtAct$ evtAct(evt,act) = Val(evtAct$) and here Next act Next evt Close #1 End Sub
when executing the load routine in the code below. The save routine works flawlessly. I am baffled.
Print "obj, prp=", obj, prp and Print "objPrp$=", objPrp$
give the expected variable values (see image).
Can anyone help
yours Henk Koetzier
Edited by hkoetz 2019-07-15 |