TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: JAMES GOLDBLOOM
from: MICHAEL JUNG
date: 1996-03-17 15:43:00
subject: Re: structures

Hello James!
> I'd like to discuss how to convert Turbo Pascal structures to PB format...
You can use the TYPE commando.
TYPE adresstype
  mname as string*20
  street as string*20
  city as string*10
  idnumber as integer
END TYPE
Now the using of this new type of variable:
DIM adress as adresstype
adress.mname="Michael"
adress.street="Bergstr."
adress.city="St. Julian"
adress.idnumber=5
If you want an array use this:
DIM adress(1 to 100) as adresstype
adress(index%).mname="Michael"
adress(index%).street="Bergstr."
adress(index%).city="St. Julian"
adress(index%).idnumber=5
You can use a type in an other type:
TYPE patientdatatype
  adress as adresstype
  daysinthebed as integer
END TYPE
DIM patientdata as patientdatatype
patientdata.adress.mname="Michael"
I do not know if it's possible to use an array in a type-structure. Test  
it out.
Bye,
   Michael
--- CrossPoint v3.1 R
---------------
* Origin: (2:245/6666.39)

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™.