In this leasson we are going to create a progressbar.
We start with making a .per screenform for our window:
DATABASE FORMONLY SCREEN { Progress Bar —————————— [prog ][proz ] } ATTRIBUTES PROGRESSBAR prog = FORMONLY.progress, VALUEMIN=0, VALUEMAX=100; proz = FORMONLY.proz, NOENTRY;
Compile this example with “fcompile -xml progress.per”
And now we create our window:
MAIN CLOSE WINDOW screen OPEN WINDOW w_1 WITH FORM “progress” CALL ui.Interface.setText(”Progressbar”) MENU “Navigation” COMMAND “Start” CALL init_prog() COMMAND “Exit” EXIT MENU END MENU END MAIN FUNCTION init_prog() DEFINE cnt_progress INTEGER, i INTEGER , cnt_proz CHAR(50) FOR i=1 TO 10 LET cnt_prog = cnt_prog + 10 SLEEP 1 LET cnt_proz = cnt_prog USING “### %” DISPLAY cnt_prog TO progress DISPLAY cnt_proz TO proz END FOR END FUNCTION
With the “FOR” we animate our “Progressbar” and USING declares the format from the form field proz.
Compile this example with “4glpc m_progress.4gl -o progress.4ae”.
And now the finished result: