For Programmers: Free Programming Magazines  


Home > Archive > Clarion > January 2007 > source progress not working









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author source progress not working
ikonjevic

2007-01-08, 7:55 am

hi, i need help, i make source for displaying progress bar

but doesnt't work, can anyone test my source and correct

possible errors


PROGRAM
MAP
END
INCLUDE('ERRORS.CLW')
Mjesta FILE,DRIVER('TOPSPEED'),NAME('Mjesta.tps'),PRE(Mje)
k_siframje KEY(+Mje:Siframje),PRIMARY
RECORD RECORD
Siframje LONG(6)
Nazivmje STRING(45)
Sifposte LONG(5)
END
END
Progress1 BYTE
PostotakObrade BYTE
ObradjenoSlogova SHORT
SlogovaZaObradu SHORT
Progress WINDOW('Napredak obrade !'),AT(,,395,224),FONT('MS Sans
Serif',8,,),TIMER(100),GRAY,DOUBLE
PROGRESS,USE(Progress1),AT(15,57,350,20)
,RANGE(0,100)
STRING(''),AT(15,115,350,20),USE(?ProgresText),CENTER
BUTTON('&Izlaz'),AT(335,199,55,20),USE(?Close)
END
CODE
Open(Progress)
Display()
Open(Mjesta)
SlogovaZaObradu=RECORDS(Mjesta)
Set(Mjesta)
Accept
Case Event()
Of Event:CloseWindow
Break
Of Event:Timer
?ProgresText{Prop:Text}='0% completed'
Display(?ProgresText)
Loop
Next(Mjesta)
If Errorcode() Then Break.
ObradjenoSlogova =ObradjenoSlogova + 1
If PostotakObrade < 100
PostotakObrade=(ObradjenoSlogova/SlogovaZaObradu)*100
If PostotakObrade > 100
PostotakObrade=100
End
If PostotakObrade<>Progress1 Then
Progress1=PostotakObrade

? ProgresText{Prop:Text}=Format(PostotakOb
rade,@N3]
)&'%
completed'
Display(?ProgresText)
End
End
Display(?Progress1)
End
End
End
Post(Event:CloseWindow)


thanks

ivica



Steffen

2007-01-08, 7:55 am

Ivica,

I had a quick look.

First of all at every timer event you reset your text with
?ProgresText{Prop:Text}='0% completed'. Instead you should initialize
the progrestext.

I can't see where PostotakObrade is incremented since this is the value
you are assigning to Progress1

Steffen


ikonjevic skrev:
> hi, i need help, i make source for displaying progress bar
>
> but doesnt't work, can anyone test my source and correct
>
> possible errors
>
>
> PROGRAM
> MAP
> END
> INCLUDE('ERRORS.CLW')
> Mjesta FILE,DRIVER('TOPSPEED'),NAME('Mjesta.tps'),PRE(Mje)
> k_siframje KEY(+Mje:Siframje),PRIMARY
> RECORD RECORD
> Siframje LONG(6)
> Nazivmje STRING(45)
> Sifposte LONG(5)
> END
> END
> Progress1 BYTE
> PostotakObrade BYTE
> ObradjenoSlogova SHORT
> SlogovaZaObradu SHORT
> Progress WINDOW('Napredak obrade !'),AT(,,395,224),FONT('MS Sans
> Serif',8,,),TIMER(100),GRAY,DOUBLE
> PROGRESS,USE(Progress1),AT(15,57,350,20)
,RANGE(0,100)
> STRING(''),AT(15,115,350,20),USE(?ProgresText),CENTER
> BUTTON('&Izlaz'),AT(335,199,55,20),USE(?Close)
> END
> CODE
> Open(Progress)
> Display()
> Open(Mjesta)
> SlogovaZaObradu=RECORDS(Mjesta)
> Set(Mjesta)
> Accept
> Case Event()
> Of Event:CloseWindow
> Break
> Of Event:Timer
> ?ProgresText{Prop:Text}='0% completed'
> Display(?ProgresText)
> Loop
> Next(Mjesta)
> If Errorcode() Then Break.
> ObradjenoSlogova =ObradjenoSlogova + 1
> If PostotakObrade < 100
> PostotakObrade=(ObradjenoSlogova/SlogovaZaObradu)*100
> If PostotakObrade > 100
> PostotakObrade=100
> End
> If PostotakObrade<>Progress1 Then
> Progress1=PostotakObrade
>
> ? ProgresText{Prop:Text}=Format(PostotakOb
rade,@N3]
> )&'%
> completed'
> Display(?ProgresText)
> End
> End
> Display(?Progress1)
> End
> End
> End
> Post(Event:CloseWindow)
>
>
> thanks
>
> ivica


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com