Adding more Logical Operators
#3
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

[Image: Sleep-Beispiel2022-06-03.jpg]
Reply


Messages In This Thread
Adding more Logical Operators - by Dimster - 05-21-2022, 08:05 PM
RE: Adding more Logical Operators - by Dimster - 06-02-2022, 12:47 PM
RE: Adding more Logical Operators - by Kernelpanic - 06-03-2022, 09:38 PM
RE: Adding more Logical Operators - by Dimster - 06-05-2022, 01:03 AM
RE: Adding more Logical Operators - by vince - 06-06-2022, 11:14 PM
RE: Adding more Logical Operators - by Dimster - 06-07-2022, 09:58 PM
RE: Adding more Logical Operators - by madscijr - 06-13-2022, 07:19 PM
RE: Adding more Logical Operators - by madscijr - 06-13-2022, 07:01 PM
RE: Adding more Logical Operators - by madscijr - 06-14-2022, 03:52 AM
RE: Adding more Logical Operators - by madscijr - 06-14-2022, 06:59 PM
RE: Adding more Logical Operators - by madscijr - 06-14-2022, 07:58 PM



Users browsing this thread: 4 Guest(s)