do-loops

Clarifying a fortran implied loop

a 夏天 提交于 2019-12-10 15:13:55
问题 I used FORTRAN a little, many years ago, and have recently been tasked to maintain an old FORTRAN program (F77). The following code was unfamiliar: READ(FILE_LOG_UNIT, IOSTAT=FILE_STATUS) NUM_WORDS, . ( BUFFER(BIX), BIX=1, NUM_WORDS ) Reviewing some on-line forums revealed that the part that was confusing me, the continuation line, is an implied loop. Since my program is giving me trouble right here, I want to convert this to a conventional DO-loop. Converting it might also help the next poor

Using “do” in Scheme

雨燕双飞 提交于 2019-12-04 07:39:35
What is the difference between CODE SNIPPET 1 and CODE SNIPPET 2? ;CODE SNIPPET 1 (define i 0) (do () ((= i 5)) ; Two sets of parentheses (display i) (set! i (+ i 1))) ;CODE SNIPPET 2 (define i 0) (do () (= i 5) ; One set of parentheses (display i) (set! i (+ i 1))) The first code snippet produces 01234 and the second produces 5. What is going on? What does the extra set of parentheses do? Also, I have seen [(= i 50)] used instead of ((= i 5)) . Is there a distinction? Thanks! Jörn Horstmann The general structure of a do form is like this: (do ((<variable1> <init1> <step1>) ...) (<test>

reread content of webbrowser window/wait for user input

元气小坏坏 提交于 2019-11-26 22:27:26
问题 In my program I want to give 2 input-fields within a webbrowser-window a value and then wait for the user to click a login button. After this, I want the program to break out of the loop when the screen contents "Welcome!" (which it contains after logging in). But now the problem: When the values for username and password are set, the do-loop starts instantly. So even if I click the login-button, the loop still contains the content of the webpage before the button was clicked and it will loop