View Single Post

   
  #5 (permalink)  
Old 02-23-2008, 08:00 AM
Tiago Rocha
 
Posts: n/a
Default Re: How to mention bar during the task on forms 6i

On 16 Feb 2004 21:55:50 -0800, david_nat2000@yahoo.com (DAVID) wrote:

>Hi,
>
>I am using forms 6i.
>How should I display the bar or dots ........... on forms
>screen,which represents that the task is in progress or it is going
>on.
>Could some one suggest what type of item/code, I use in order to
>accomplish that.


<out of lurker mode>

Hi David!

I wrote this little function to achieve the result you want

------------
FUNCTION Progresso( nAtual in Number, nTotal in Number ) RETURN VarChar2 IS

nQtNs Number := 0 ;
nQtPontos Constant Number := 20 ;

BEGIN

if nTotal <> 0 then
nQtNs := ( nAtual * nQtPontos ) / nTotal ;
end if ;

Return RPad( 'n', nQtNs, 'n' ) ;

END;

-------------

Variables are in portuguese (I'm in sunny Brasil):

nAtual is the qt of work done
nTotal is the expected total of work done - > you must have this!
it returns a certain of 'n' , related to the constant "nQtPontos".

You must create a display item and set it's font to "wingdings". "n" is a square block in wingdings
font. The length of display item must be enough to fit 20 'n's, or square blocks. If you want a
larger progress bar, increace the length of the display item and the "nQtPontos" constant.


To test the function, create a item named "test" under "test" block and put this code under a
"when-button-pressed" trigger.

Begin

for n in 1..100 loop

:test.test := progresso( n, 100 ) ;
-- you might want to throw a "synchronize" here, not sure. test it.

for 1 in 1..10000 loop --just wait a few instants to make the progress go slower
null ;
end loop ;

end loop ;

end ;

feel free to email me if you have any questions

<back to lurker mode>

>Thanks
>
>David


--
Tiago Rocha
Recife - Brasil
www.diariodastrilhas.cjb.net
Reply With Quote