| |
|
|
 Web Scanner | 
Sí, el Überschrift sagt lo ya. Lo se folgendermaßen trabajo. Yo drücke einn Button "Start" el Uhrzeit fängt a a laufen ( en sec. Schritten) Dann el Button "Stop" drücken, el Uhr restos posición. Danach ggf. otra vez Start, el Tiempo se ejecuta más, oder kann con un otro Button "RESET" en 0 zurückgesetzt voluntad.
Sodele, de ahora Será mejor que te va kompliziert, en un Ventana debería drei verschiedene Veces parallel laufen, Also: drei Zeitanzeigen el völlig getrennt voneinander laufen debería jeweil con Start/Stop/Reset usw.
Sombrero alguien con permanenten Zeitanzeigen en X11 ya qué programmiert? Einen älteren Contribución de 2004 tener Yo gefunden, hilft me pero no wirklich más  El Ayuda bringt mich sólo en el Systemzeit des PCs. Oder tener Yo qué übersehen 
Viele Grüße
Web |
|
|
| |
|
|
|
 | Fix hingepinselt KompilierenMarcaSeparación {$cleq}
decimals 0
cls
longs timer,hDisp,hStart,hPause,hReset
whileLoop 20
timer[loop]=0
hDisp[loop]=createText(hWnd,"Timer:"+str$(loop),20,loop*20,400,18)
hStart[loop]=createButton(hWnd,"Start",450,loop*20,50,18)
hPause[loop]=createButton(hWnd,"Pause",500,loop*20,50,18)
hReset[loop]=createButton(hWnd,"Reset",550,loop*20,50,18)
wend
subClass hWnd,true
~setTimer(hWnd,222,100,0)
while 1
waitinput
whileLoop 20
case clicked(hStart[loop]) : timer[loop]=getTickCount
case clicked(hPause[loop]) : timer[loop]=-timer[loop]
if clicked(hReset[loop])
timer[loop]=0
setText hDisp[loop],"0"
endif
wend
wend
end
subClassProc
if sMessage==wm_timer
if sWParam==222
whileLoop 20
if timer[loop]>0
setText hDisp[loop],str$(getTickCount-timer[loop])+"ms"
endif
wend
endif
endif
./../funcion-referencias/XProfan/ENDPROC/'>ENDPROC
KompilierenMarcaSeparación $H windows.ph
DECIMALS 0
CLS
DECLARE TIMER&[]
DECLARE HDISP&[]
DECLARE HSTART&[]
DECLARE HPAUSE&[]
DECLARE HRESET&[]
WHILELOOP 20
TIMER&[&LOOP]=0
HDISP&[&LOOP]=(CONTROL("STATIC","Timer:"+STR$(&LOOP),$50000000,(20),(&LOOP*20),(400),(18),(%HWND),0,%HINSTANCE))
HSTART&[&LOOP]=(CREATE("BUTTON",(%HWND),"Start",(450),(&LOOP*20),(50),(18)))
HPAUSE&[&LOOP]=(CREATE("BUTTON",(%HWND),"Pause",(500),(&LOOP*20),(50),(18)))
HRESET&[&LOOP]=(CREATE("BUTTON",(%HWND),"Reset",(550),(&LOOP*20),(50),(18)))
ENDWHILE
SUBCLASS %HWND,1
~setTimer(%HWND,222,100,0)
WHILE 1
WAITINPUT
WHILELOOP 20
IF CLICKED(HSTART&[&LOOP])
TIMER&[&LOOP]=&GETTICKCOUNT
ENDIF
IF CLICKED(HPAUSE&[&LOOP])
TIMER&[&LOOP]=-TIMER&[&LOOP]
ENDIF
IF CLICKED(HRESET&[&LOOP])
TIMER&[&LOOP]=0
SETTEXT HDISP&[&LOOP],"0"
ENDIF
ENDWHILE
ENDWHILE
end
subclassproc
IF %SMESSAGE=$0113
IF &SWPARAM=222
WHILELOOP 20
IF TIMER&[&LOOP]>0
SETTEXT HDISP&[&LOOP],STR$(&GETTICKCOUNT-TIMER&[&LOOP])+"ms"
ENDIF
ENDWHILE
ENDIF
ENDIF
ENDPROC
sin Feinschliff. Auch lustig [...] de [...] . |
|
|
| |
|
|
|
 Web Scanner | Absolut fresco IF, Dankeschön - Variante 2 va en Anhieb.  Das werd Yo veces reinbasteln. Como hätt Yo Tagelang dran rumprobiert
Mit el oberen Programmstückchen komme Yo por desgracia, no klar 
Grüße
Web |
|
|
| |
|
|
|
 | Gern geschehen!
Oberes va con XPSE, tambor algo einfachere Syntax. |
|
|
| |
|
|
|
 Web Scanner | 
En Pause sólo todavía el Tiempo "anhalten", porque el se ejecuta intern más y si al zweite Tiempo Pause drückt, Es el Tiempo weitergelaufen y se ejecuta de el Zeitpunkz de más 
Aber me hilft el wirklich ya viel más.
Grüße
Web |
|
|
| |
|
|
|
 | Yo blanco, pero yo denke veces el es fix hinzubekommen - en Resume z.B. simplemente el a subtrahierenden Valor por GetText ermitteln. ^ ^ |
|
|
| |
|
|
|
 Web Scanner | Okay. Mach Yo entonces así  |
|
|
| |
|
|
|
 Web Scanner | ¡Hola,
anbei mi Solución con pocos geklauten Programmzeilen de IF.  Seguro no así schön programmiert, pero se ejecuta. Damit el Zähler para Testen más rápido se ejecuta, Yo Settimer en 100 gesetzt (1000 wäre correcto).
Grüße
Web KompilierenMarcaSeparación**** Programm zur parallelen Zeitanzeige in Profan ****
declare time1&, minute1%, zähler1%, Stunde1%
declare time2&, minute2%, zähler2%, Stunde2%
declare time3&, minute3%, zähler3%, Stunde3%, Loopzahl%
declare Starttimer1%, Starttimer2%, Starttimer3%, a%
DECLARE TIMER&[]
DECLARE HDISP&[]
DECLARE HSTART&[]
DECLARE HPAUSE&[]
DECLARE HRESET&[]
proc Timer1
inc time1&
Locate 2 , 14
print str$(time1&);" s "
zähler1% = zähler1%+1
If zähler1% = 60
Minute1% = minute1%+1
locate 2 , 7
print minute1%;" min "
zähler1% = 0
time1& = 0
endif
If Minute1% = 60
Stunde1% = Stunde1% + 1
Locate 2 , 2
Print Stunde1%;" h "
Minute1% = 0
Endif
endproc
proc Timer2
inc time2&
Locate 4 , 14
print str$(time2&);" s "
zähler2% = zähler2%+1
If zähler2% = 60
Minute2% = minute2%+1
locate 4 , 7
print minute2%;" min "
zähler2% = 0
time2& = 0
endif
If Minute2% = 60
Stunde2% = Stunde2% + 1
Locate 4 , 2
Print Stunde2%;" h "
Minute2% = 0
Endif
endproc
proc Timer3
inc time3&
Locate 6 , 14
print str$(time3&);" s "
zähler3% = zähler3%+1
If zähler3% = 60
Minute3% = minute3%+1
locate 6 , 7
print minute3%;" min "
zähler3% = 0
time3& = 0
endif
If Minute3% = 60
Stunde3% = Stunde3% + 1
Locate 6 , 2
Print Stunde3%;" h "
Minute3% = 0
Endif
endproc
WindowStyle 2+8+16+512
Window 0 , 0 - 640 , 480
time1& = 0
time2& = 0
SetTimer 100
minute1% = 0
zähler1% = 0
minute2% = 0
zähler2% = 0
Locate 2,2
print "0 h "
Locate 2,7
print "0 min "
Locate 2,14
print "00 s "
Locate 4,2
print "0 h "
Locate 4,7
print "0 min "
Locate 4,14
print "00 s "
Locate 6,2
print "0 h "
Locate 6,7
print "0 min "
Locate 6,14
print "00 s "
WHILELOOP 3
HSTART&[&LOOP]=(CREATE("BUTTON",(%HWND),"Start",(450),(&LOOP*20),(50),(18)))
HPAUSE&[&LOOP]=(CREATE("BUTTON",(%HWND),"Pause",(500),(&LOOP*20),(50),(18)))
HRESET&[&LOOP]=(CREATE("BUTTON",(%HWND),"Reset",(550),(&LOOP*20),(50),(18)))
ENDWHILE
--------------Sprungschleife für START ------------------
Loopzahl% = 0
Starttimer1% = 0
whilenot %Key = 2
WAITINPUT
Loopzahl% = 0
WHILELOOP 3
Loopzahl% = Loopzahl% +1
IF CLICKED(HSTART&[&LOOP])
IF Loopzahl% = 1
Starttimer1% = 1
ENDIF
ENDIF
IF CLICKED(HPAUSE&[&LOOP])
IF Loopzahl% = 1
Starttimer1% = 0
ENDIF
ENDIF
IF CLICKED(HSTART&[&LOOP])
IF Loopzahl% = 2
Starttimer2% = 1
ENDIF
ENDIF
IF CLICKED(HPAUSE&[&LOOP])
IF Loopzahl% = 2
Starttimer2% = 0
ENDIF
ENDIF
IF CLICKED(HSTART&[&LOOP])
IF Loopzahl% = 3
Starttimer3% = 1
ENDIF
ENDIF
IF CLICKED(HPAUSE&[&LOOP])
IF Loopzahl% = 3
Starttimer3% = 0
ENDIF
ENDIF
IF CLICKED(HRESET&[&LOOP])
IF Loopzahl% = 1
minute1% = 0
Stunde1% = 0
zähler1% = 0
time1& = 0
Locate 2,2
print "0 h "
Locate 2,7
print "0 min "
Locate 2,14
print "00 s "
Starttimer1% = 0
ENDIF
IF Loopzahl% = 2
minute2% = 0
Stunde2% = 0
zähler2% = 0
time2& = 0
Locate 4,2
print "0 h "
Locate 4,7
print "0 min "
Locate 4,14
print "00 s "
Starttimer2% = 0
ENDIF
IF Loopzahl% = 3
minute3% = 0
Stunde3% = 0
zähler3% = 0
time3& = 0
Locate 6,2
print "0 h "
Locate 6,7
print "0 min "
Locate 6,14
print "00 s "
Starttimer3% = 0
ENDIF
ENDIF
Endwhile
If starttimer1% = 1
A% = %wmTimer : Timer1
Endif
If starttimer2% = 1
A% = %wmTimer : Timer2
Endif
If starttimer3% = 1
A% = %wmTimer : Timer3
./../../funcion-referencias/XProfan/endif/'>Endif
Wend
KillTimer
end
|
|
|
| |
|
|
|
 | Ah, hast en %wmtimer umgestellt - ok, ha pero en pequeño Timerwerten el Nachteil, dass Waitinput entonces no mehr así zuverlässig es por qué Yo algo como siempre automáticamente en el subClassProc auslagere. Hauptsache va. ^ ^ |
|
|
| |
|
|
|
 Web Scanner | Sí, el es hier relativ unkritisch, lo va en el Veces no en Sekunden. Como reicht lo si la Minutenangeben einigermaßen hinkommen. Hoffe dafür reicht lo  |
|
|
| |
|
|