CLEO Help call_scm_func return string?

CLEO related
Status
Not open for further replies.

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Is it possible? If it is, could you tell me please what's wrong with the following code? The "Text" message doesn't appear on the screen.
Code:
{$CLEO .cs}
0000: NOP

:Label
wait 0
if
key_down 13
then
0AB1: call_scm_func @Function 0 24@v
0AD1: show_formatted_text_highpriority "%s" time 1000 24@v
end
jump [member=23507]Label[/member]

:Function
06D2: 3@v = "Text"
0AB2: ret 1 3@v
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
You do it like this:

Code:
0000: NOP

WHILE TRUE
WAIT 0
    if
    key_down 13
    then    
        0AC8: 0@ = allocate_memory_size 260
        0AB1: call_scm_func @GET_STRING 0 0@
        0AD1: show_formatted_text_highpriority "MY_TEXT: %s" time 1000 0@
        0AC9: free_allocated_memory 0@
    end
END


:GET_STRING
0AC8: 0@ = allocate_memory_size 260
0AD3: 0@ = "LOOOOOOOOOOOL THATS MY TEXT"
0AC9: free_allocated_memory 0@
0AB2: return 1 0@
 
Status
Not open for further replies.
Top