Console container for put function?

Mike Bonner bonnmike at gmail.com
Fri Apr 24 02:59:41 EDT 2015


Ah k.  Honestly, I suspect checking the environment to decide where to
output is the best way. Don't think I see an easy way around the way things
work.  If it wasn't possible to put things into fields in the server
environment, I'd say it would be nice if any puts whatsoever defaulted to
stdout, but that isn't the case.

On Fri, Apr 24, 2015 at 12:09 AM, Peter W A Wood <peterwawood at gmail.com>
wrote:

> Hi Mike
>
> Thanks for your response. I should have explained why I was asking such a
> question.
>
> I’m planning on writing some library functions for testing that can be
> called from either a GUI stack or a server script. When called from a GUI
> script it will display its results in a Field, when called from a server
> script it will displays its result in the console.
>
> I’m trying to find a better way than:
>
>         if the environment is “server” then
>                 put tResult
>         else
>                 put tResult after Field tReport
>         end
>
> Peter
>
>
> > On 24 Apr 2015, at 11:54, Mike Bonner <bonnmike at gmail.com> wrote:
> >
> > Just a straight put is the way to go. Don't think you can "put before"
> > because it doesn't have direct control of the console terminal scroll and
> > cursor position.
> > SO to achieve the same thing you could..
> > put "Hello "
> > put "World"
> > put return
> >
> > On Thu, Apr 23, 2015 at 9:52 PM, Peter W A Wood <peterwawood at gmail.com>
> > wrote:
> >
> >> By experimenting, it seems that “putting” text into or after the message
> >> box container results in the test being output to the console (perhaps
> >> stdout, perhaps stderr).
> >>
> >> Running this script under LiveCodeServer:
> >>        put "Hello" into message box
> >>        put " World" after message box
> >>        put return
> >>
> >> Displays this on the terminal:
> >>        $ ./test.lc
> >>        Hello World
> >>
> >> Is there a more correct “container” than message box to use in with the
> >> put function to send text to the terminal in LiveCodeServer?
> >>
> >> Regards
> >>
> >> Peter
> >> _______________________________________________
> >> use-livecode mailing list
> >> use-livecode at lists.runrev.com
> >> Please visit this url to subscribe, unsubscribe and manage your
> >> subscription preferences:
> >> http://lists.runrev.com/mailman/listinfo/use-livecode
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list