Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Returning a String from a function
#3
Oops!

I just gave it a go with 1.2.6 r1812 (the final release of 1.2.6?) and it throws the same compilation error.

Here's the interesting thing - the call to the function only fails to compile if it's within the same file as the function declaration. So if I make two files, like this:

ReturnString.bas:
Code:
function test(n as UBYTE) as STRING
   return str(n)
end function

TestReturnString.bas:
Code:
#include "ReturnString.bas"

dim result as STRING
result = test(50)
print result

... and then compile TestReturnString.bas, then everything is fine. I guess this explains why some of the library files compile okay, they have String functions in them but never call themselves. :-)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)