Here's a guess, Tom:
TP> DIM MonRec AS MonsterRec
Change that to: DIM MonsterRec as MonsterRec
In essence, just use MonsterRec as your buffer, as you defined within
the TYPE structure. All member names will be appended to THAT associated
name, Tom. Above, you dimensions "Monrec" with the correcr size, but
below you accessed allocated memory which is fine, but not where your
data is stored! In other words, MonRec points to nothing holding data!
TP> A$ = MonRec.MName
TP> strng = MonRec.Strength
TP> gld = MonRec.Gold
TP> B$ = MonRec.Weapon
TP> expe = MonRec.ExPoints
TP> hitp = MonRec.HitPoints
Bearing in mind the principle you define a TYPE, give it a name,
them DIM the name as itself, you use each member name appended to the
TYPE (BUFFER) name, as your variables - without the need to copy over
nything
as THEY (BUFFER.MEMBERNAME) are valid.
All this is unnecessary, delete it, and use the BUFFER.MEMBERNAME variables
in the following code below, so as not to be redundant and slow down
your program and waste memory:
TP> LOCATE 7, 1: COLOR 14, 0: PRINT "MonsterName: " + A$
Change a$ in the above line to MonsterRec.Mname
(do the rest of the variables also with their respective replacements)
I did not test this, so hope it works.
-James (SysOp/AD Message System)
--- QuickBBS 2.80 (Zeta-1.9A)
---------------
* Origin: [Team QuickBBS] [Team OmegaSoft] [PB Fanatic!] (1:109/611@FIDONET)
|