LoginLogin

Please Help Me with saving!!!

Root / Programming Questions / [.]

Codezero13Created:
I have
@ save
DIM Variables[9]
variables[1]=item 
variables[2=item
variables[3]=item
variables[5 ]=item
variables[5]=item   so on..
save "dat:rpgsave",variables
goto @save

@load
load "dat:rpgsave",false out variables
got load
but it's saying I have a duplicate variable... and just.... please help.

i meant to put
item1 item2 item3 item4 item5

If anyone will help it would be greatly appreciated...

....

I give up.

This is not live real-time tech support you pay for, this is a forum of people who volunteer answers. Impatience is rude. And, it doesn't say you have a duplicate variable, if that's your code. It says syntax error.

N-now it's saying illegal function... will you please help?....

You're the only one who can make it possible for people to help you, by giving all the relevant information, and giving it accurately. You're also the only one who can make it so people want to help you - you don't need to overplay how c-close you are to c-crying.

Search your code for DIM VARIABLES[9] and see if it shows up more than once. Also, I've answered this question before, so here's a quoted part of it that I hope helps you:
Put this code near the beginning:
VAR SAVE[5]
It will make an array (essentially a bunch of variables put into one) that will store your save data. When you want to save, use this:
SAVE[0]=ATK
SAVE[1]=DEF
SAVE[2]=GOLD
SAVE[3]=HP
SAVE[4]=SP
SAVE "DAT:SAVEDATA",SAVEDATA
The first 5 lines put your variables into the array, and the final line saves the array as a DAT file.
Side NoteArrays start with 0 for some reason... If you have an array with 5 things in it, the array will go from 0-4. Odd.
When you want to load, use this:
LOAD "DAT:SAVEDATA",SAVEDATA,0
ATK=SAVE[0]
DEF=SAVE[1]
GOLD=SAVE[2]
HP=SAVE[3]
SP=SAVE[4]
If I remember correctly, this will only work with integers. You can't save real numbers as DAT files. (Integers are variables that can't have decimal points and real numbers are the ones that can)
I agree with SquareFingers' first statement, (but the rest, seriously?! also that statement about making people want to help you is ironic) you need to supply all the information so that we can help you better. One last thing: there's an edit button so you can fix the first post.

@TheV360 thank you! I will give it a try ^_^

Also i'm sorry if I came off rude. I just was working on it for a while and nothing was working. that's no excuse for being that impatient though.

and nothing was working
Yeah, that pretty much happens all the time >:D Also, if the saving/loading isn't working, try to add the integer suffix to the array, I think it might've had loading problems if it loads in the wrong format.

For the future, if you're searching for instant answers, then the site chat is your best bet. The best way to find answers is definitely the forums, however.

ok so now I have
var=10
save[0]=shovel
save[1]=item1
save[2]=item2
save[3]=item3
save[4]=item4
save[5]=money
save "dat:savedata",savedata
and it says type mismatch in 0:78(save:2)

ok so now I have
var=10
save[0]=shovel
save[1]=item1
save[2]=item2
save[3]=item3
save[4]=item4
save[5]=money
save ''dat:savedata'',savedata
and it says type mismatch in o:78(save:2)
Type Mismatch in 0:78 not o:78 It might be because you didn't use quotations around DAT:SAVEDATA, and DAT:SAVEDATA has to be in caps I am pretty sure. SmileBASIC doesn't like to won't save files with lowercase.

Thanks for helping me, but it's still giving me the type mismatch... is there any other way I could save all my data at once?

There are like three topics for this.

???

is it the part where you're using double parens instead of a "

Unfortunately no... I use the " " when i'm programming... I have heard of saving with str$ and txt could someone explain how to do that :)