TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: TOM PHILLIPS
from: JAMES GOLDBLOOM
date: 1996-05-16 18:19:00
subject: Re: L.O.R.D Program

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.