Server 6.6.1 and Multi-Line "put"

Igor de Oliveira Couto igor at semperuna.com
Tue Apr 29 01:27:17 EDT 2014


Thank you for the tip, Peter:

On 29 Apr 2014, at 2:42 pm, Peter W A Wood <peterwawood at gmail.com> wrote:

> This might be a good way for cross-platform scripting:
> 
> <?lc
>  if the outputLineEndings = "cr" then
>    set the outputLineEndings to "lf"
>  end if
>  put "Hello World!" && the date && the time & return & "Goodbye" & return
> ?>

If we want to make the script also work appropriately on Windows, however, should we leave the outputLineEndings set to “crlf”?:

> The default outputLineEndings on Windows will be CRLF (correct for Windows).


If this is the case, should I do a platform check first, like this?:

<?lc
-- ensure that we use the correct ‘return' character for this platform:
if the platform is "Win32" then set the outputLineEndings to "crlf"
else set the outputLineEndings to "lf"

put "Hello World!" & return
?>

Would that work on all 3 platforms? - sorry, I don’t have a Windows machine, so can’t test it!

Many thanks for the ongoing assistance!

Kind regards,


--
Igor Couto
Sydney, Australia




More information about the Use-livecode mailing list