why is the timer not working ?

Started by Mennohexo on 23-Jul-2017/11:33:24-7:00
R E B O L [] ;timer protect-system prin "Zeit eingeben:" time: input wait time print "" print "done" halt
Try to check the type of your time. It probably is of type string.
This will automatically convert to a time type, if an appropriate time value has been input by the user: time: do input You can also handle more potential user input errors if you want: do get-time: [ if not time? attempt [time: to-time do input] [ print "re-enter a proper time value:" do get-time ] ]
Better yet, give them a default value: do get-time: [ if not time? attempt [ time: to-time do request-text/title/default "Seconds:" copy "00:00:02" ] [ alert "re-enter a proper time value" do get-time ] ]
Best, a function with no side effects or global variables: get-time: func [/local time] [ either time? attempt [ time: to-time do request-text/title/default "Seconds:" copy "00:00:02" ][ return time ][ alert "re-enter a proper time value" get-time ] ] var: get-time time ; not set
Yeah , hello iArnold - dangerous programmer time do input works. i like easy programming. lazy style. ha ; timer is enough. why a complete header. make a object : bank-account: make object! [ first-name: last-name: account: balance: none ] READY ! object works. other languages make it complicated. Huuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuhhh a real object That is strange and heavy. Huuuuuuuhh drink: [whiskey cola whiskey cola water] while [most programmers are further hacking] [drink a bourbon whiskey on the rocks on the beach togehter with two bikini tanga girls drink: next drink] wait delay: 1000

Reply