Indicator Control On Forms

Hi, I’m experimenting with the indicator control on my form and have the following code : // Perform Search CustomerSearch.RESET; intNoOfRecords := CustomerSearch.COUNT; intRecordNo := 0; REPEAT intRecordNo := intRecordNo + 1; intProgress := (ROUND(intRecordNo / intNoOfRecords, 1) * 10000); IF (intRecordNo MOD 100 = 0) THEN CurrForm.prgSearchProgress.UPDATE; UNTIL CustomerSearch.NEXT = 0; The problem is that I never see the progress bar being updated - it just stays at 0% until the loop ends when it instantly shows 100%. How should I be refreshing the control? Have already tried CurrForm.UPDATE(FALSE); Any help appreciated, Jonathan

Hello Jonathan, is there any particular reason you are using a form? Usually you would use a “dialog” variable in Navision to show a progress to the user - in fact this would even save you an object. Search for “OPEN (Dialog)” in the online C/Side help, the example is straightforward. Saludos Nils

Hi, I have used progress bars in dialog windows before successfully, but just in this case it would be nicer to retain focus on the form the user is working on.

Jonathan, just had a better look at your code… The following line: intProgress := (ROUND(intRecordNo / intNoOfRecords, 1) * 10000); …should look like this: intProgress := ROUND(intRecordNo / intNoOfRecords * 10000,1); …and works [;)] Saludos Nils

Didn’t we all run into that one as well ?


J… …should look like this: intProgress := ROUND(intRecordNo / intNoOfRecords * 10000,1); … Saludos Nils
Originally posted by nilsm - 2006 Mar 06 : 23:50:15

OR since this is Navision, and we all like to do it the Navision way not the C++ way … Progress := ROUND(RecordNo / NoOfRecords * 10000,1); By the way, you really should do it the way Nils suggested, i.e. use a dialog box.