28/01/97 22:06, Tim Hutzler escrib¡a a All:
Hola Tim!
TH> How does one pass an array to a SUB as in the following?
TH> I tried a couple of different things, and I get different errors,
TH> but nothing that works... Maybe you have the answer. [grin]
This corrections make it works:
TH> ===============
TH> DEF FUNCTION DoAray(STRING) AS WORD
Declare Function DoAray(TAray() as STRING) as WORD
DEF is for the functions in old fashion, like DEF FN ...bla...bla...
TH> DIM Aray1(100) AS STRING 'different arrays, each passed to the same
TH> DIM Aray2(50) AS STRING 'function.
TH> [... code that works on the arays...]
TH> PRINT DoAray (Aray1)
Print DoAray (Aray())
TH> PRINT DoAray (Aray2)
Print DoAray (Aray2())
TH> STOP
TH> FUNCTION DoAray (tAray() AS STRING) -{don't know what goes here
Function DoAray (TAray() as SRING) as WORD
TH> FOR x=1 TO UBOUNDS(tAray) 'depends on the aray passed
For X=1 To Ubound(TAray)
TH> IF LEN(tAray(x)) THEN INCR SCnt
TH> NEXT
TH> FUNCTION = SCnt
TH> END FUNCTION
Good Luck!
Saludotes,
,,, JOS (2:348/102)
`0-0' jmejuto@pobox.com
/-(_)-\ SysOp de ÄÍEDIÍBBSÍÄ
http://www.pobox.com/~jmejuto
---
---------------
* Origin: When I Need Data Output Without Speed 3.1 (2:348/102.99)
|