After reading the previous post, (and from what numerous other people have told me), I decided to use a get/put statement and a random-access file thingy (a very technical term) to store my data and then load it (btw, its an rpg program. I am trying to store character information so that it can be recalled later). Here in lies my problem. I defined the type just fine.
TYPE character
charname AS STRING * 15
gender AS INTEGER
...
...
armor AS STRING *15
ac AS INTEGER
END TYPE
I also dim'd the new record.
Dim player AS character
In my createchar sub, I get the information from the user for the new character:
INPUT "Character name:", name$
INPUT "Male or Female:", gender$
(Actually I printed that, and then used an inkey do/loop to check for "m" or "f", and saved it as gender% as 1 or 2, but either way, it assigned gender as a variable)
And then for the finale:
OPEN "savedata.dat" FOR RANDOM AS #1 LEN = LEN(player)
player.charname = name$
player.gender = gender%
...
...
player.armor = "None"
player.ac = 10
PUT 1,1, player
CLOSE #1
After all this coding, I pretty much feel like a genius (b/c i'm a relatively beginner programmer with low expectations i guess). And you know what error Microsoft decides to give me when I run the program? "Identifier cannot include period." And it highlights the .charname part. Why is this happening and how can i fix it? (and any suggestions to improve my code wouldn't be minded either, though that is really not neccesary.) Thanks
-Mike
TYPE character
charname AS STRING * 15
gender AS INTEGER
...
...
armor AS STRING *15
ac AS INTEGER
END TYPE
I also dim'd the new record.
Dim player AS character
In my createchar sub, I get the information from the user for the new character:
INPUT "Character name:", name$
INPUT "Male or Female:", gender$
(Actually I printed that, and then used an inkey do/loop to check for "m" or "f", and saved it as gender% as 1 or 2, but either way, it assigned gender as a variable)
And then for the finale:
OPEN "savedata.dat" FOR RANDOM AS #1 LEN = LEN(player)
player.charname = name$
player.gender = gender%
...
...
player.armor = "None"
player.ac = 10
PUT 1,1, player
CLOSE #1
After all this coding, I pretty much feel like a genius (b/c i'm a relatively beginner programmer with low expectations i guess). And you know what error Microsoft decides to give me when I run the program? "Identifier cannot include period." And it highlights the .charname part. Why is this happening and how can i fix it? (and any suggestions to improve my code wouldn't be minded either, though that is really not neccesary.) Thanks
-Mike