Silverfrost Forums

Welcome to our forums

Behaviour of %il and corresponding real limit codes

7 Nov 2006 11:45 #1226

With an %il code, the upper limit has to be greater than the lower limit, otherwise a fatal error message is generated, and the program exits (crashes). Surely a better behaviour would be for the %rd format code to become simply not editable (i.e. as if it were %`rd)? If a %dd is specified, then the scroll arrows could be disabled, and any call-back could be simply ignored. Similar behaviour for the corresponding limit floating point numbers would be useful too. I am using %il in a context where it is not unreasonable for the situation to exist where the upper and lower limits are the same, i.e. where one has 'Hobson's Choice' about the variable's value (it is 1, not < 1, not > 1 !), although in the general case the variable must lie between 1 and MAX, and MAX=1 is a special case. Is that understandable - I found this a lot more difficult to write than I thought.

After 37 years of believing that errors of any sort ought to crash a Fortran program, I have been finally seduced by the idea that NOTHING crashes it!

Eddie

8 Nov 2006 12:06 #1233

Eddie

Thanks for the suggestion. If it can be implemented fairly easily without affecting existing users' code then I will make the change. However, even a small change like this can take hours of work because we have to be sure that we do not break anything on the way.

8 Nov 2006 2:03 #1234

Hi Eddie,

I'm having a little trouble understanding your difficulty. I was alarmed at first when you stated that a crash occurs if the upper and lower limits are the same, as I have made extensive use of %il . Upon checking my code, I found that where the limits used variables (rather than hard code limits) I had used a simple if statement to first check the values of the variables, as in the following extract:-

  ICASE=NCASE

    IF (NCASE.GT.1) THEN
      i=winio@('Load Case Number:   %`bg[white]%il%dd%rd&',
 *    1,NCASE,1,ICASE)
    ELSE
      i=winio@('Load Case Number:   1 &')
   END IF

Sorry if I've missed the point of your post !

cheers John

9 Nov 2006 1:44 #1240

Hi John,

I was asking for %il to do what your code does - by default. It isn't difficult to check the limits, but it has to be done every time, and I was being lazy.

For 'crash' you could substitute 'exits elegantly with an error message', but the effect is the same - unexpected (by me!) termination of the program.

It strikes me that needing to set MAXIMUM > MINIMUM in %il is a little illogical, as MAXIMUM = MINIMUM (in your case, only one load case present, so the user can only select that) is fair game for inclusion. I'll concede that MAXIMUM < MINIMUM is likely to show something is wrong!

Eddie

Please login to reply.