|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Tue Nov 07, 2006 12:45 pm Post subject: Behaviour of %il and corresponding real limit codes |
|
|
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
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Wed Nov 08, 2006 1:06 am Post subject: Behaviour of %il and corresponding real limit codes |
|
|
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. |
|
Back to top |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Wed Nov 08, 2006 3:03 am Post subject: Behaviour of %il and corresponding real limit codes |
|
|
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 _________________ John Horspool
Roshaz Software Ltd.
Gloucestershire |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Thu Nov 09, 2006 2:44 am Post subject: Behaviour of %il and corresponding real limit codes |
|
|
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
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|