Can functions return strings?

BlitzMax Forums/BlitzMax Beginners Area/Can functions return strings?

Lordfire(Posted 2005) [#1]
Function test:String()
Return "test"
End Function

Print (test)

Doing a build and run and I get the following error
Compile Error: Unable to convert from 'String()' to 'String'


Suco-X(Posted 2005) [#2]
 Function test:String()
Return "test"
End Function

Print (test())

Mfg Suco


Qweeg(Posted 2005) [#3]
Isn't it just the syntax that is wrong in the call to print?

I think it should be -

print test()


edit:
Or how Suco has it above


Lordfire(Posted 2005) [#4]
Thanks for the quick reply. I've been looking at this for 2 days. I'm kicking myself now.


Red Ocktober(Posted 2005) [#5]
what about assigning the return value to a string... then printing the string... does that work?

--Mike