Logging global variables

10 views
Skip to first unread message

MSV

unread,
Jun 23, 2020, 2:39:38 PM6/23/20
to TopBraid Suite Users
hi,
as part of swp, we are logging some information when ever we process a file.
we use below code for logging

<ui:group let:t1="{= smf:trace ('loading file {?filename} ')}"/>

now i would like to use global variable and print the same in the above trace message.

want to use ui:globalVarValue but not able to use it correctly.
can some one post an example for this ?


Richard Cyganiak

unread,
Jun 23, 2020, 7:05:05 PM6/23/20
to topbraid-users list
You'd want something like:

    smf:trace('loading file {?1}', ui:globalVarValue('filename'))

Depending on which version you are using, might be more convenient than smf:trace:

    <ui:log ui:info="loading file {= ?filename }"/>
    <ui:log ui:error="Error evaluating {= ui:globalVarValue('arg1') }"/>

Richard





--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/871f97f2-6b0e-4588-b315-01bf9baf5b00o%40googlegroups.com.

Holger Knublauch

unread,
Jun 23, 2020, 7:05:19 PM6/23/20
to topbrai...@googlegroups.com

I assume you have read https://uispin.org/ui.html#setGlobalVar which does show a small example?

Keep in mind that global variables only keep values for the duration of an SWP script. They will be stored in a dedicated tempGraph.

Holger

Reply all
Reply to author
Forward
0 new messages