by "Michael Mattias" <michael.mattias@[EMAIL PROTECTED]
>
May 4, 2006 at 06:15 PM
"Alen Hopek" <alen.hopek@[EMAIL PROTECTED]
> wrote in message
news:pan.2006.05.04.16.52.56.683201@[EMAIL PROTECTED]
> Hello,
>
> sorry for such newbie question.
>
> I need to return a array as return value out of a function in PowerBasic
> v8.01
You cannot return an array as the return value of a function using any
flavor of PowerBASIC (as clearly stated in all help files).
You can, however, pass an array as a parameter and operate on it, eg...
FUNCTION Foo ( Z() AS STRING) AS LONG
REDIM Z(new UBOUND)
FILL Z() with data
SORT Z() if desired
Whisper-sweet-nothings-into-z()'s-ear
whatever
FUNCTION = some return value, maybe Zero for success, one for error
END FUNCTION
USAGE:
REDIM Z(anynumber)
iRet = Foo (Z(0))
IF Ret = 0 THEN
' function foo succeeded
ELSE
it didn't
END IF
MCM