I would like show to user the percentage of records read. I think to do this with a DIV, but I don’t know how to update the percentage while reading. I tried using NJX:TRIGGEREVENT component, but don’t work.
the NJX:TRIGGEREVENT is only for triggering events and exchanging data between Natural and the web application tier (for instance Tomcat). It does not allow to trigger events in the browser.
If you want to somehow “block” the screen you could use a little modal dialog with a timer control and a scheduleline control. The schedulline control implements the “progress bar”. The timer control triggers events in the Natural program every X milliseconds. The Natural program can then set the corresponding values in the scheduleline and stop the timer and close the pop-up when finished (see attached screenshot)
If you don’t want to block the screen, an option would be implement a small custom control which is showing the progress using Java Script.
I only saw today the file with the example.
The program stops working when you try to run CALL ‘CMROLL’
I imagine it is a routine written in ASSEMBLER or C that is not available.
I am using z/VSE. Does the routine exist for this environment?
For those users with “plain vanilla” Natural, here is some code which can be used with percentages. The technique would be the same except for the letter progress; which would involve code depending on how you wanted to determine a percentage “break”.
DEFINE DATA LOCAL
1 #BAR (A60)
1 #LOOP (N2)
1 #DELAY (I2) INIT <1>
1 #LETTER (A1)
1 MYVIEW VIEW OF EMPLOYEES
2 NAME
END-DEFINE
*
READ MYVIEW IN LOGICAL SEQUENCE BY NAME
AT BREAK OF NAME /1/
ADD 1 TO #LOOP
MOVE OLD (NAME) TO #LETTER
SET CONTROL ‘N’
CALL ‘CMROLL’ #DELAY
RESET #BAR
MOVE ‘&’ TO SUBSTRING (#BAR,#LOOP,1)
WRITE 3/5 #BAR (AD=V CD=PI DY=&N$) ‘UPTO LETTER’ #LETTER
NEWPAGE
END-BREAK
END-READ
END
CMROLL is just a routine that “slows down” the bar chart, by guaranteeing a one second delay between letters.
Thanks for your help, Steve.
My problem is to create a progressbar using the PROCESS PAGE command.
The SET CONTROL ‘N’ command does not work with a web page.