ICFELL(3NCARG)

πŸ’– ICFELL β€” hey bestie, let's check for errors πŸ’–

Okay so this is ICFELL(3NCARG), part of the NCAR GRAPHICS manual (yes, the uppercase screaming one, it's giving very 1994 but we love her). Sit down, grab a boba, and let's get into it. πŸ§‹βœ¨


✨ NAME ✨

ICFELL β€” she's the one you call to check whether an error condition already exists, and (perhaps) to update the current error message and the error flag. That's it, that's the job. 🫢


πŸŽ€ SYNOPSIS πŸŽ€

NERR = ICFELL(MESSG,NERRF)

πŸ¦‹ C-BINDING SYNOPSIS πŸ¦‹

#include <ncarg/ncargC.h>

int c_icfell(char *messg, int nerrf)

🌸 DESCRIPTION 🌸

Okay so ICFELL β€” and yes, the name literally stands for "I Check For Errors on Lower Level", she said the whole thing, no abbreviations, periodt β€” is what you use to check if a recoverable error happened down in some lower-level routine, and (perhaps) to update the current internal error message and error flag. πŸ’…

The old value of the error flag is what comes back as the return value of the function ICFELL. So:

  • If that value is zero, literally nothing else happened. Nothing. Zero. Nada. πŸƒ
  • If the value of ICFELL is non-zero, then bestie, a whole list of things went down:
    • If MESSG is blank, the current error message has not been changed.
    • If MESSG is non-blank and its length is 6 or less, it should be the name of the routine referencing ICFELL; the current error message has been altered by prepending first a slash and then MESSG. (And like, note this: if an error occurs several levels deep, the effect of using ICFELL this way at each level is effectively to generate traceback information in the error message. It's giving detective work, honestly. πŸ”)
    • If MESSG is non-blank and its length is 7 or greater, its value has become the new value of the current error message, and the previous error message has been printed. This one is meant to be used at the beginning of an NCAR Graphics routine to check for an outstanding error that the user hasn't recovered from, and to make sure the message for that outstanding error actually gets printed. She's the friend who makes sure nobody's unread texts get ignored. 😭
    • If the expression NERRF has the value zero, the current error flag has not been changed.
    • If the expression NERRF has a non-zero value, the value of the current error flag has been made equal to that value.

πŸ“ An example πŸ“

Assume that the routine "A" calls the routine "B" and that "B" detects an error and calls SETER with error number "32" and error message "B - ERROR HAS OCCURRED". If recovery mode is not in effect, SETER prints the error message and STOPs; if recovery mode is in effect, control returns from "SETER" to "B" and thence to "A". At that point, the statement

IF (ICFELL('A',13).NE.0) RETURN

detects the fact that an error has occurred in "B" and results in a return from "A" to whatever routine called it. It also changes the current error message to read 'A/B - ERROR HAS OCCURRED' and changes the error number from "32" to "13". Glow up, honestly. ✨

🌈 Another example 🌈

Assume that the NCAR Graphics routine "A" is called when recovery mode is set, and that it detects an error, calls SETER, and RETURNs to the user. If the user neglects to check the error state and calls the routine "B" next, the statement

IF (ICFELL('B - UNCLEARED PRIOR ERROR',1).NE.0) RETURN

ensures that the error message from routine "A" will be printed, that it will be replaced by an error message referring to the routine "B", and that "B" won't do anything else. She shut that down immediately, no cap. πŸ’€


πŸ‘‘ The arguments of ICFELL are as follows πŸ‘‘

  • MESSG β€” (an input variable or constant of type CHARACTER) A character string saying what is to be done to the current error message (when an error has occurred). If MESSG is blank, no change is to be made in the current error message. If the length of MESSG is six characters or fewer, a slash is prepended to the current error message and then MESSG is prepended to that. If the length of MESSG is seven characters or more, MESSG is a complete new error message to be substituted for the current one; it should be of the form "XXXXXX - TEXT DESCRIBING THE ERROR", where "XXXXXX" is the name of the routine in which the error occurred, and it should not be more than 113 characters long. Yes, 113. She counted. 🧚
  • NERRF β€” (an input expression of type INTEGER) A value in the range from -999 to +9999. If this value is zero, no change is made in the internal error flag; otherwise, it is the desired new value of that flag (when an error has occurred).

πŸ’œ C-BINDING DESCRIPTION πŸ’œ

The C-binding argument descriptions are the same as the FORTRAN argument descriptions. Same vibes, different syntax, we stan consistency. 🫢


⭐ EXAMPLES ⭐

Use the ncargex command to see the following relevant examples: tseter, arex02.


πŸ”₯ ACCESS πŸ”₯

To use ICFELL or c_icfell, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β€” preferably in that order. Order matters, bestie, don't fight the sequence. πŸ’…


🌈 SEE ALSO 🌈

Online: entsr, eprin, errof, error_handling, fdum, icloem, nerro, retsr, semess, seter, ncarg_cbind


Copyright (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.


and that's the whole page, bestie!! πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ˜­πŸ”₯πŸ‘‘πŸŒˆβ­πŸ’€πŸ™ˆπŸ“πŸ§šπŸ’œ

This was the UNIX version, dated March 1994, and it lives in the ICFELL(3NCARG) section of the manual β€” mwah, go forth and check those errors, ily 🫢