TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: TIM HUTZLER
date: 1997-01-28 22:06:00
subject: Passing an array.

How does one pass an array to a SUB as in the following?
I tried a couple of different things, and I get different errors,
but nothing that works... Maybe you have the answer. [grin]
===============
DEF FUNCTION DoAray(STRING) AS WORD
DIM Aray1(100) AS STRING 'different arrays, each passed to the same
DIM Aray2(50) AS STRING 'function.
[... code that works on the arays...]
PRINT DoAray (Aray1)
PRINT DoAray (Aray2)
STOP
FUNCTION DoAray (tAray() AS STRING) -{don't know what goes here
FOR x=1 TO UBOUNDS(tAray) 'depends on the aray passed
IF LEN(tAray(x)) THEN INCR SCnt
NEXT
FUNCTION = SCnt
END FUNCTION
--- Maximus/2 3.01
---------------
** A related thread FOLLOWS this message.

FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC   Ref: E21H1493 Date: 02/01/97
From: KURT KUZBA                                            Time: 01:24pm
\/To: TIM HUTZLER                                         (Read 3 times)
Subj: R: Passing an array.

TH>   How does one pass an array to a SUB as in the following?
th>......
   did you try it like this?
DECLARE FUNCTION DoAray(A() AS STRING) AS WORD
DIM Aray1(100) AS STRING
DIM Aray2(50) AS STRING
FOR T% = 0 to 80
   Aray1(T%) = "testing"
   Aray2(T% \ 2) = "testing"
NEXT
PRINT DoAray(Aray1())
PRINT DoAray(Aray2())
SYSTEM
FUNCTION DoAray(A() AS STRING) AS WORD
   FOR x%= LBOUND(A) TO UBOUND(A)
   IF LEN(A(x%)) THEN INCR SCnt%
   NEXT
   DoAray = SCnt%
END FUNCTION

---
> ] "Does that motor sound funny to you?"  :  Buddy Holly.......

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

FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC   Ref: E1Z00000 Date: 01/28/97
From: TIM HUTZLER                                           Time: 10:21pm
\/To: THOMAS GOHEL                                        (Read 3 times)
Subj: Re: TRH_PBEDIT

TG>In article "Re: TRH_PBEDIT" (on 24.01.97), Tim Hutzler@1:119/88 says:
TG>Hello Tim !!
LG>>I think you might have greater success hatching it into PDNBASIC.
??>Oh, I didn't know about that... That's an echo, right?
TG>Post it to me (via Internet or FidoNet Crashmail). I will upload the
TG>file in my "PowerBASIC: Demo" area of my BBS.
I may be getting an account soon.
___ Blue Wave/QWK v2.12
--- Maximus/2 3.01
---------------
* Origin: Madman BBS * Chico, California * 916-893-8079 * (1:119/88)
* Origin: Madman BBS * Chico, California * 916-893-8079 * (1:119/88)

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