06-03-2022, 09:38 PM
Quote:So SLEEP will take a value in terms of Time but what if SLEEP AT could expand to include either a Line Number or a Loop Control, . . .
There we go with "sleep". - The little program: You enter the kilowatts of an engine and the program shows how much PS (horsepower) it has.
Whenever "i MOD 3 = 0" it pauses for 5 seconds.
Code: (Select All)
'Beispiel fuer sleep - 3. Juni 2022
OPTION _EXPLICIT
DIM kw_eingabe AS DOUBLE, ps AS DOUBLE
DIM i AS INTEGER
CLS
PRINT
PRINT "Rechnet Kilowatt(KW) in PS um": PRINT
INPUT "Geben Sie die Motorleistung ein (KW): ", kw_eingabe
FOR i = 1 TO 10
ps = kw_eingabe * 1.36
PRINT USING "###.## KW sind ###.## PS"; kw_eingabe, ps
IF i MOD 3 = 0 THEN
SLEEP 5 '5 Sekunden warten
END IF
PRINT
kw_eingabe = kw_eingabe + 5.0
NEXT
END