プレイ日記
Lukas dogcutie
How do you SAVE files involving numerical data?
4そうだね
プレイ済み
返信[1]
親投稿
V360 TheV360
If it's in an array, SAVE the array as a DAT file. VAR ARRAY[5] …code to do stuff with the array… SAVE "DAT:FILENAME",ARRAY,0
0そうだね
プレイ済み
返信[2]
親投稿
Lukas dogcutie
How do you use arrays?
0そうだね
プレイ済み
返信[3]
親投稿
Font Megafont
An array is basically a list of variables. In his code above, he created it with "VAR ARRAY[5]" meaning its a list of 5 variables. You can access any one by writing ARRAY[n]. To set one you might say ARRAY[3] = 2. This would set variable at index 3 to a value of 2. Keep in mind that the indices start at 0 though. So n can be any number in the range of 0-4 in this case to access your 5 variables.
1そうだね
プレイ済み
返信[4]
親投稿
Lukas dogcutie
One more question: Is there a way to save by just using a numerical varible
0そうだね
プレイ済み
返信[5]
親投稿
Font Megafont
If you want to save data for the next time the program is run, you will have to use the SAVE command like TheV360 showed to write that data into a file so you can load it the next time the program is run (using the LOAD command). You can check if the save file exists before loading it too by using the CHKFILE command.
1そうだね
プレイ済み