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

Is it possible to return a string from a function? I tried this:
Code:
dim result as STRING
result = test(50)
print result

function test(n as UBYTE) as STRING
    return str(n)
end function

But I get a compile error:
Code:
test.bas:2: Cannot convert value to string. Use STR() function
Am I doing something wrong? I'm suspecting the answer is 'yes'. :-)

Your code looks ok to me. Sad This seems a reintroduced bug. Let me check it...
Can you compile against v1.2.6?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)