max_turrell
6th April 2023, 17:08
Hi,

I'm having some issues with displaying the contents of an external variable in a new 'TX' Session I have created in LN Studio.

The premise of the new Session is that it is an 'update' process which could potentially takes minutes to complete each time it is executed. To reassure the user that it is actually doing something and not looping while the 'loading' message is on screen, I have added an external variable to the Form design. This variable will be given the key data (e.g. Order No, Line No) of each record it processes and display this on screen. This way the user can see the update process moving through the data.

The update process is working fine - but the values of the records are not being shown on screen in the external variable. I have tried the display("fieldhere") and display.fld(actual.occ, "fieldhere") commands, but neither of these have worked.

The variable is defined as 'extern' in the script source and the domain definition matches the one I have given the Form Definition.

Is there something different that needs to be done in Studio for this to work? For example: different command, definition, etc.

Thanks,

Mark

JaapJD
6th April 2023, 17:32
You need to use the progress indicator functions to report progress with the LN UI user interface.

OmeLuuk
11th April 2023, 16:22
function do.tell.this( domain tcpath2 i.message,
domain tcmcs.long i.percent,
boolean is.done)
{ static domain tcpath2 s.message
| Message system. Messages are:
| 1) annoying interactive (be_verbose > 1, i.percent < 0)
| 2) slightly informative (i.percent = 0, be_verbose = 0)
| 3) informative (i.percent inrange 1-99) with progress bar
| 4) final (i.percent = 100, is.done = true) and cleaned.
if isspace(i.message) and not isspace(s.message) then
i.message = s.message
else
if i.message = s.message then
return
else
s.message = i.message
endif
endif
if i.percent < 1 then
mess("tcgenstring", ((be_verbose > 1) or (i.percent < 0)) ? 1 : 0,
i.message)
else
if not progress.indicator.exists() then
ret = create.progress.indicator("Current Action", PROGRESS.BAR +
PROGRESS.NOAUTODESTROY)
endif
if is.done then
ret = change.progress.indicator(i.percent, i.message &" - Done")
else
ret = change.progress.indicator(i.percent, i.message)
endif
endif
if is.done then
suspend(3000)
clean.mess()
destroy.progress.indicator()
endif
}