| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: Passing a field |
AM>> SUB pout (x%, x$, t as string * 15) TH> That does not work. TH> I also tried (t as xs) as 'xs' is a user defined type. AM> It works here. UPDATE: I'm not sure what I did last time. But using "SUB pout (x%, x$, t as string * 15)" Did work this time. I note that the '15' *must* be the same value used in the TYPE declaration. Perhaps that is why it didn't work last time. I'm not sure anymore. Anyway, I think I just about have the conversion details figured out. ___ Blue Wave/QWK v2.12 --- Maximus/2 3.01 --------------- ** A related thread FOLLOWS this message. FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: DAQA2333 Date: 06/21/96 From: KURT KUZBA Time: 06:38am \/To: TIM HUTZLER (Read 4 times) Subj: R: Re: Passing a field TH> saying that PowerBASIC has *no* provisions to accomodate TH> the passing of records for modification defined in a TH> TYPE??? What do I need do to to reference the element *and* TH> make modifications to it from within a SUB? QuickBASIC TH> doesn't have this problem, frankly I am suprised that TH> PowerBASIC can't deal with this. th>.............................................................. Try this once. Some optimizing compilers will not recognize a defined type until after it has been defined in preceding code. Also, in Power Basic, you do not automatically get your DECLARE statement added when you save data. The below code has been tested under PB31 and worked perfectly. ( following trial and error :) Please refrain from harsh judgements caused by frustration and impatience. All may be forgiven, but none are ever undone. '_|_|_| PASSTYPE.BAS '_|_|_| Code to illustrate passing of defined TYPE data. '_|_|_| No warrantees or guarantees are given or implied. '_|_|_| Released to PUBLIC DOMAIN by Kurt Kuzba. (6/21/96) type txtstruct length as integer t as string * 40 end type declare sub txtprint(t as txtstruct) dim text as txtstruct text.t = "hello": text.length = len(rtrim$(text.t)) txtprint text print text.length; text.t end sub txtprint(t as txtstruct) print t.length; t.t t.t = "goodbye": t.length = len(rtrim$(t.t)) end sub '_|_|_| end PASSTYPE.BAS --- > ]* Origin: Madman BBS * Chico, California * 916-893-8079 * (1:119/88) * Origin: Full Internet Access $15.00, (919) 779-6674 or MMS.NET (1:151/102) |
|
| 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™.