トピック
Clayton DarkClay88

Saving $trings

How do you save $trings? I tried saving it with my other variables like, (Example:) DIM SAVARR[3] SAVARR[0]=VARIABLE1 SAVARR[1]=VARIABLE2 SAVARR[2]=STRING$ It says type mismatch too. How do I save it?
5そうだね
プレイ済み
返信[1]
親投稿
HoRiz0n ClashStudios125
hey, just a question, where did you code Megalovania in Miners Life, like where in the code (What line to what line)
0そうだね
プレイ済み
返信[2]
親投稿
Clayton DarkClay88
It should be a separate file in the Miner Life folder. You can copy it and put it in your own folder and load into your program.
0そうだね
プレイ済み
返信[3]
親投稿
HoRiz0n ClashStudios125
file name please?
0そうだね
プレイ済み
返信[4]
親投稿
Hanzo rzsense
Unfortunately, different types cannot share an array. If I have a chance, I'd write as follows. DIM SAVARR$[3] SAVARR$[0]=STR$(VARIABLE1) SAVARR$[1]=STR$(VARIABLE2) SAVARR$[2]=STRING$
0そうだね
未プレイ
返信[5]
親投稿
Oscar PwnageBlock
You can only save numerical values when saving with an array. This means you can't save text in a binary (DAT) file. At least, not directly. However, there's a SAVE instruction specially designed to save text. You just need to call SAVE like this... SAVE "TXT:<Filename>",<String$> What's more, you can keep the same filename for both the DAT and the TXT file.
1そうだね
プレイ済み
返信[6]
親投稿
Oscar PwnageBlock
You technically can only save one string per TXT file this way, but you can store many strings within a single string by concatenating the strings while separating them with a special character. This explanation could take a while and gets a bit technical, so do say if you need it.
1そうだね
プレイ済み
返信[7]
親投稿
Clayton DarkClay88
I gotcha! Thanks guys!
0そうだね
プレイ済み
返信[8]
親投稿
Clayton DarkClay88
How would you load it? Like this? LOAD"TXTSTRING",FALSE
0そうだね
プレイ済み
返信[9]
親投稿
Oscar PwnageBlock
You have two ways of loading it... LOAD "TXT:<Filename>",FALSE OUT <String$> <String$> = LOAD("TXT:<Filename>",FALSE) As always, you should first check if the file exists with CHKFILE, like this... IF CHKFILE("TXT:<Filename>") THEN <String$>=LOAD("TXT:<Filename>",FALSE) ENDIF
1そうだね
プレイ済み
返信[10]
親投稿
Clayton DarkClay88
Okay I gotcha, thanks!
0そうだね
プレイ済み