Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is going to sound insensitive, maybe even rude but ...</p> <p><em>Standard answer number 1 applies here - if you understood the problem you would not be asking for help. If you want any odds of getting decent help, you need to show the actual problem rather than your interpretation of something that you think the problem is. We can't debug code by looking at something that isn't the code to be debugged, or maybe even the source of the problem.</em></p> <p>So, show the code!<br> - declarations matter a lot<br> - how do you compile it, what options are turned on?<br> - stepping out of array bounds is something the compiler should catch at compile time<br> - is the write statement writing out to screen or to some other unit (file); is there a chance something is read later from it?<br> - could it be the problem with save and initialized values? (just guessing here) </p> <p>You said program "hangs". Have you tried determining into what part of code it hangs? (infinite loop), or has it just entered into a longish loop of some kind? </p> <p>I've seen the "commenting the print statement" error a few times (the last time quite recently in fact), and upon picking out the insignificant bits, it always turned out to be something that should've been obvious at start. So, just take it slow ... try for a start, kicking out the parts of the program that don't cause the error to go away, and work from there.</p> <p><em>There is really nothing more that could be said from the provided info, sorry.</em></p> <p><em><strong>Edit: @bambeck</em></strong> - I don't have g77 (nor a powerMac), so I cannot give you exact instructions (therefore the vagueness on my part), but for a start try turning on compiler diagnostic switches (g77 /? or g77 /help or something like that should give you a list of them). Enable it to show all warnings (it should be phrased something like that), array-bounds checking at compile time and so on... If that produces something <em>interesting</em>, post it.</p> <p>There is nothing <em>per se</em> wrong with the write statement you've shown, as far as that's concerned.</p> <p><em>Nor do I know if the loop is truly infinite, but it goes for over half an hour. The bit about save looks promising, though... Elaborate?</em></p> <p>Oh, just some thing that sprang to mind. I'm not sure what the Standard says aboit it, that's why I just mentioned it on the side. Sometimes when the array is not initialized properly (to some value) some compilers will set it to zero value while some will just pick something random from memory at the location where it's contents are stored. We had a problem with something similar once, and it gave us some weird results, that's why I remembered it. Not saying you have the same problem. SAVE statement in those cases could introduce some weird behaviour.</p> <p>Do your results (when the program "works") ever differ on different runs (with the same input data)?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload