TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: LAWRENCE GORDON
date: 1996-06-25 19:04:00
subject: Reading Pascal files

Anyone know how to read a Pascal data file and convert the file structure to 
PB?  The first data byte of a string is usually the length of the string, and 
I'm supposing that numeric variables don't contain a string length.
An example would be appreciated.
Thanks.
 * WCE 2.1G1/2081 * 
--- InterEcho 1.18
---------------
** A related thread FOLLOWS this message.

FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC   Ref: DAYI0488 Date: 06/29/96
From: KURT KUZBA                                            Time: 02:08pm
\/To: LAWRENCE GORDON                                     (Read 6 times)
Subj: R: Reading Pascal files

LG>   Anyone know how to read a Pascal data file and convert the
LG>   file structure to PB?  The first data byte of a string is
LG>   usually the length of the string, and I'm supposing that
LG>   numeric variables don't contain a string length.
LG>   An example would be appreciated.
lg>...........................................................
   You just have to read it into an appropriately sized string.
The conversion must be performed before using the string data
and before writing it back to the file.
To convert the string to PB format from Pascal:
   string$ = mid$(string$, 2, asc(string$))
To convert the string to Pascal format from PB:
   string$ = chr$(len(rtrim$(string$))) + string$
Some people favor using a separate data field for the length.
type PascalUserStruct
   UNamLen as string * 1
   UNam as string * 16
end type
Since you still need to trim the string using the UNamLen variable
and set UNamLen varaible before writing the data to the file,
however, I favor the standard string method, with the explicit
conversion routine shown above.

---
> ] Cold pizza is Nature's most perfect food....................

---------------
>>>>>>>>>>>>>>>>>>>>>> LAST Message In Thread <<<<<<<<<<<<<<<<<<<<<<

FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC   Ref: DAW00003 Date: 06/26/96
From: JAMES GOLDBLOOM                                       Time: 04:58pm
\/To: ARNIE SOSSNER                                       (Read 5 times)
Subj: Re: arrays in TYPE statements

 AS> To order the issue, send $3, your address, and the issue desired to:
This is not the answer I was looking for, and also, before I spend my
money and have to wait for a reply, issue, etc., just be 100% honest
and blunt with me:  Can it be done (dynamic STRING arrays) ?  Yes, or no.
I am not asking you to give out copyrighted information, just a simple
*informative* response as to if it's a waste of my time or not.  I
appreciate your effort at writing.  I am dismayed I have to pay money
for something which may not help me based on your extremely uninformative
and very "greedy" appearing message.
-James (SysOp/AD Message System)
--- QuickBBS 2.80 GoldBase (Zeta-2.0a)
---------------
* Origin: Toast House * (314) 994-0312 * (1:100/560)
* Origin: [Team QuickBBS] [Team OmegaSoft] [PB Fanatic!] (FIDONET 1:109/611)

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