Livecode Builder -how t write to a file?

zryip theSlug zryip.theslug at gmail.com
Sun Aug 21 18:38:17 EDT 2022


Dear Matthias,

I do not have the answer but a possible workaround.

For debugging purposes I'm using the post message.

In LCB add this handler:
private handler throwWidgetError(in pError as String) returns nothing
   post "catchWidgetError" with [pError]
end handler

Call it by using:
throwWidgetError("Something to log")

And catch it by adding this handler into the card script where you test
your widget:

*command* catchWidgetError pTheError
*   put* pTheError & cr after msg
*end* catchWidgetError

This might be verbose as the message box will take the focus, and the
widget will refresh, so logging in a file instead of the message box would
be a possibility.

*command* catchWidgetError pTheError
*   write *pTheError to file "xxx"
*end* catchWidgetError

On Sun, 21 Aug 2022 at 20:59, matthias rebbe via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Hi.
>
> From time to time and when time allows i am trying to get used to with
> Livecode Builder.
> For debugging i would like my lcb script to write some debug code to a
> file, but i really do not see how this can be done.
> I found the experimental com.livecode.file module and the operator 'the
> filecontents of file...', but unfortunately no script example.
>
> Does anyone know, if and how i can write some data to an external file on
> hard disk in LCB?
>
>
> Regards,
> Matthias
>
>
> _______________________________________________
> 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
>


-- 
Zryip TheSlug
http://www.aslugontheroad.com


More information about the use-livecode mailing list