function return $string ?
Blitz3D Forums/Blitz3D Beginners Area/function return $string ?
| ||
Small question, Is it posible to return a string ? This small code for example Graphics 320,240,32,2 SetBuffer BackBuffer() ClsColor 212,208,200 Cls While Not KeyHit(1) bla$ = Text(Input$("")) Print bla$ ; wil give a 0 Flip Wend End Function Text(la$) Return "this is a string" End Function |
| ||
Function Text$(la$) |
| ||
a Thanks DJwoodgate :) |
| ||
Your example code will not work even if you correct the spelling error. It is certainly possible to return a string from a function though: Print gettext$() Function gettext$() Return "this is returned text" End Function |
| ||
@Dazman This was a short example of the problem not a real script. I use something like this bla$ gettext$(Input$("")) text x,y,bla$ Function gettext$(bla$) ;some code... Return bla$ End Function |
| ||
How about this: bla$=Input$("") Print gettext$(bla$) WaitKey Function gettext$(bla$) bla$=bla$+" has been modified" Return bla$ End Function or this: result$=gettext$(Input$("")) Print result$ WaitKey Function gettext$(bla$) bla$=bla$+" modified" Return bla$ End Function P.S. so long since i posted here i've forgotten how to do codeboxes, sorry |
| ||
Dazman - {codebox} {/codebox} though of course, SQUARE brackets! |
| ||
:-) |
| ||
no problem ;-) |