Timing is everything
Jan 20, 2014 3:54:32 GMT -5
Post by Mystic on Jan 20, 2014 3:54:32 GMT -5
Situation: I am trying to write a program that will read a file every minute and compare what is in the file with what was in the file at the last reading (Every 10 minutes another program is updating the file I am reading).
The problem I am having is when I write something like the following code as an experiment, it seems like it processes the entire code for the time it should run and then it displays the results all at once on the screen.
Why is it not printing to the screen for each second like it seems it should?
Guess I should add that I am programming RB on my Mac. :)
Wondering if it would be better just doing this as a cron job with a Ruby script instead of trying to use RB as a scripting language. *shrug*
Thanks in advance
The problem I am having is when I write something like the following code as an experiment, it seems like it processes the entire code for the time it should run and then it displays the results all at once on the screen.
Why is it not printing to the screen for each second like it seems it should?
startProcessing$ = time$()
WHILE LEFT$(time$(),5) = LEFT$(startProcessing,5ドル)
IF RIGHT$(time$(),2) <> RIGHT$(advance,2ドル) THEN
PRINT time$()
PRINT "While " + LEFT$(time$(),5) + " = " + LEFT$(startProcessing,5ドル)
advance$ = time$()
END IF
WEND
PRINT "Finished..."
ENDGuess I should add that I am programming RB on my Mac. :)
Wondering if it would be better just doing this as a cron job with a Ruby script instead of trying to use RB as a scripting language. *shrug*
Thanks in advance