I does however work if you store the strings in int arrays.Squidge posted on Dec 23 2006 at 01:07 PM said:Maybe I should check the forum name before replying - I thought you were coding in C :wacko:
Damn "View New Posts" feature
In which case, I'd say the problem is created by whoever converted Fenix to the gp2x. A quick google suggests the PC version doesn't suffer the same problem.
WarmFluffyUK posted on Dec 23 2006 at 04:30 PM said:I had exactly this problem with Myriad crashing when loading strings in structs. If you need a hand at all let me know as you're quite welcome to use my scores load/save/reset routines. They allow 10 scores with names up to 10 characters.
Clare.
And that's exactly what I didQuiest posted on Dec 31 2006 at 01:50 PM said:Easiest way would be not to save the character but save the actual ascii code in an int struct along with the highscores.
WarmFluffyUK posted on Dec 31 2006 at 04:06 PM said:And that's exactly what I didQuiest posted on Dec 31 2006 at 01:50 PM said:Easiest way would be not to save the character but save the actual ascii code in an int struct along with the highscores.![]()
Why were you taking so long "writing routines" when I want to bung something in an int instead of a char, I pass an int variable instead of a char.....WarmFluffyUK posted on Dec 31 2006 at 04:06 PM said:And that's exactly what I didQuiest posted on Dec 31 2006 at 01:50 PM said:Easiest way would be not to save the character but save the actual ascii code in an int struct along with the highscores.![]()
Okay so you have a struct that has strings, things like "Fred", "Dave", "Harry" etc. And you can't just save that struct as it crashes, so you have to convert the strings to integers, i.e. convert each asci char in each name to ints in a new struct and save that. Or you could store them all as ints to begin with and convert them back to asci for displaying, either way, you will have to convert them at some point. And that's what my little functions do!Why were you taking so long "writing routines" when I want to bung something in an int instead of a char, I pass an int variable instead of a char.....WarmFluffyUK posted on Dec 31 2006 at 04:06 PM said:And that's exactly what I didQuiest posted on Dec 31 2006 at 01:50 PM said:Easiest way would be not to save the character but save the actual ascii code in an int struct along with the highscores.![]()
I have no idea how to use structs in fenix, but for gods sake just cast the variables you get the input into as ints. Surely you can just pass an integer array to be printed as asci in fenix? Char's are just 4byte ints, they can be 0 - 255 in value. an unsigned, or signed, int allows all those possible values to be stored in it, so why are you converting?Okay so you have a struct that has strings, things like "Fred", "Dave", "Harry" etc. And you can't just save that struct as it crashes, so you have to convert the strings to integers, i.e. convert each asci char in each name to ints in a new struct and save that. Or you could store them all as ints to begin with and convert them back to asci for displaying, either way, you will have to convert them at some point. And that's what my little functions do!Why were you taking so long "writing routines" when I want to bung something in an int instead of a char, I pass an int variable instead of a char.....WarmFluffyUK posted on Dec 31 2006 at 04:06 PM said:And that's exactly what I didQuiest posted on Dec 31 2006 at 01:50 PM said:Easiest way would be not to save the character but save the actual ascii code in an int struct along with the highscores.![]()
So how would you do it in fenix? And don't just say "Oh I pass it as an int instead of a char" as that means nothing, lets see your code to save the following:
A struct with the following:
HighScores[1].Name="Fred"
HighScores[2].Name="Harry"
HighScores[3].Name="Oswald"
HighScores[1].Score=100
HighScores[2].Score=6578
HighScores[3].Score=76895
Now save that, your code please!
Forget it, I have explained perfectly well, and you have no idea why we need to do it. You don't understand fenix so what is the point of me telling you. I get the feeling you're on your C trip again.I have no idea how to use structs in fenix, but for gods sake just cast the variables you get the input into as ints. Surely you can just pass an integer array to be printed as asci in fenix? Char's are just 4byte ints, they can be 0 - 255 in value. an unsigned, or signed, int allows all those possible values to be stored in it, so why are you converting?Okay so you have a struct that has strings, things like "Fred", "Dave", "Harry" etc. And you can't just save that struct as it crashes, so you have to convert the strings to integers, i.e. convert each asci char in each name to ints in a new struct and save that. Or you could store them all as ints to begin with and convert them back to asci for displaying, either way, you will have to convert them at some point. And that's what my little functions do!Why were you taking so long "writing routines" when I want to bung something in an int instead of a char, I pass an int variable instead of a char.....WarmFluffyUK posted on Dec 31 2006 at 04:06 PM said:And that's exactly what I didQuiest posted on Dec 31 2006 at 01:50 PM said:Easiest way would be not to save the character but save the actual ascii code in an int struct along with the highscores.![]()
So how would you do it in fenix? And don't just say "Oh I pass it as an int instead of a char" as that means nothing, lets see your code to save the following:
A struct with the following:
HighScores[1].Name="Fred"
HighScores[2].Name="Harry"
HighScores[3].Name="Oswald"
HighScores[1].Score=100
HighScores[2].Score=6578
HighScores[3].Score=76895
Now save that, your code please!