Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Basic Powerbasic > Re: Return Valu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 174 of 276
Post > Topic >>

Re: Return Value of Function ?!?!

by "Greg Neill" <gneillREM@[EMAIL PROTECTED] > Jan 18, 2006 at 01:26 PM

"Alen Hopek" <alen.hopek@[EMAIL PROTECTED]
> wrote in message
news:MPG.1e389d813158113f989680@[EMAIL PROTECTED]
> Hello,
>
> I have a problem with my function here.
> The Function read out a Description from a Norton Ghost Image File.
>
> This works mostly with this Function. The Problem is when i try
> to return the value "Chars" out of my function at the end of the
> Function like:
> ...
>     FUNCTION = Chars
> END FUNCTION
>
> then i get an Error:
> Relational operator expected
> Line 230:     FUNCTION = Chars
>
> when i try it like this:
> FUNCTION = LEN(Char)
> the function returns a numeric value.
>
> The Return Value of this function should be the Variable "Chars".
>
> Any Idea what went wrong ?

Did you define your function type as STRING when you
tried to return a string?

For example:

FUNCTION MYFUN() as STRING
  DIM Z as ASCIIZ*10
  Z = "12345"
  MYFUN = "AAA" & Z & "BBB"
END FUNCTION

CLS
PRINT ":";MYFUN();":"
END

Will produce:

:AAA12345BBB:
 




 3 Posts in Topic:
Return Value of Function ?!?!
Alen Hopek <alen.hopek  2006-01-18 18:46:58 
Re: Return Value of Function ?!?!
buck huffman <no@[EMAI  2006-01-18 13:27:26 
Re: Return Value of Function ?!?!
"Greg Neill" &l  2006-01-18 13:26:40 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 1:22:16 CDT 2008.