The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




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: 1 Guest(s)