Problem: the server seems to be able to PARSE a file and directly output several lines of text to the Terminal, but if we try to create several lines of text and 'put' it to stdout, we only get the LAST LINE.
My first test script was this:
Code: Select all
#! /applications/livecodeserver/livecode-server
put "Hello World!" & return & "Hello Galaxy!"
Note that it does not even output a 'clearing' newline, and the prompt gets outputted directly after the result.Hello Galaxy!Igors-iMac:~ igor$
Trying the following has the same effect:
Code: Select all
#! /applications/livecodeserver/livecode-server
put "Hello World!" & return & "Hello Galaxy!" into it
put it
Code: Select all
#! /applications/livecodeserver/livecode-server
put "Hello World!"
put return
put "Hello Galaxy!"
I was a bit puzzled, because the server is basically a parsing engine, and it should therefore be capable of parsing and outputting several lines of text, which we should be able to see in the terminal. So I did another test: I created a simple, raw text file, containing just:
Code: Select all
Hello World!
Hello Galaxy!
As you can see, if the server *parses a file*, it outputs the file's text correctly split into proper lines, as they were in the file, directly to the terminal. No problem there. If we try to build text programatically, however, and send it to the Terminal via 'put', it seems to die.Igors-iMac:~ igor$ /applications/livecodeserver/livecode-server ~/desktop/test2.lc
Hello World!
Hello Galaxy!
Igors-iMac:~ igor$
This happens even if the server is forced to execute code halfway through parsing:
Code: Select all
Hello World! <?lc put return ?>Hello Galaxy!
Can someone point out what I'm doing wrong, or confirm that this is unexpected behaviour?