プレイ日記
stepa stepi03
what is wrong with this code? when i try to run it it says subscript out of range... i'll show you all the variables in next screenshot
4そうだね
プレイ済み
返信[1]
親投稿
stepa stepi03
here are the variables... and how do i save multiple variables in one .DAT file? these are my 2 questions
0そうだね
プレイ済み
返信[2]
親投稿
wakame wakame1289
First I want you to hear, Where on what line was put out an error? I wish for a easy to understand hint .
0そうだね
未プレイ
返信[3]
親投稿
stepa stepi03
On the first screenshot the line PRINT [SAV2], once it gets to this line it says "subscript out of range". I don't get it because the SAV variable was firstly SAV[2] then i tried changing it to SAV[5] (as you see on the second screenshot), but it still says "subscript out of range" error
0そうだね
プレイ済み
返信[4]
親投稿
Nicole moesaku
DIM SAV[5] means that you're creating a list of values (a.k.a. an array) called SAV with 5 values stored in it. However, items in an array are numbered starting from 0, not 1. What this means is, DIM SAV[5] has five items in it: SAV[0], SAV[1], SAV[2], SAV[3], and SAV[4]. Notice that the last item is SAV[4], not SAV[5], so printing SAV[5] is an error.
0そうだね
未プレイ
返信[5]
親投稿
stepa stepi03
I know i don't have it like that... I started from 0 but it still says the that there is an error. And sorry it wasn't DIM SAV[2] before, it was DIM SAV[3]
0そうだね
プレイ済み
返信[6]
親投稿
Jonas oPYd erik20008
kapot makkelijk hartstikkenoemen uitgebreidemensenopnieuw people menselijke mlk kieskeurignatuurlijk
0そうだね
未プレイ
返信[7]
親投稿
stepa stepi03
i found out that when you write PRINT SAV[2] before the LOAD... command it will print it without any errors, however when you write it after LOAD... command it'll result an error. somebody please help me
1そうだね
プレイ済み
返信[8]
親投稿
Nicole moesaku
LOAD automatically resizes the array to the size of the file. Your save file seems to be less than three values long, so it shrinks and SAV[2] is no longer valid.
0そうだね
未プレイ