GESC(3NCARG)
π GESC π (aka the Escape function, from the NCAR Graphics manual, section 3NCARG)
okay bestie, sit down, we're doing Fortran GKS today and honestly? it's giving β¨extended capabilitiesβ¨.
πΈ NAME πΈ
GESC (short for Escape) β it's the standard way to implement nonstandard GKS features. Basically, the stuff the spec forgot to include.
And here's the tea: NCAR GKS only has two user-accessible escape functions defined. Just two. That's it. One is for changing the name of a metafile and the other is for pausing in an X window. Two icons, no more. π
π SYNOPSIS π
CALL GESC (FCTID, LIDR, IDR, MXODR, LODR, ODR)
π¦ C-BINDING SYNOPSIS π¦
#include <ncarg/gks.h>
void gescape(Gint func_id, const Gescape_in_data *in_data, Gstore
*store_data,Gescape_out_data **out_data);
β¨ DESCRIPTION β¨
okay so here's the whole cast, and every single one of them matters, no skipping:
FCTID(Integer, Input) β the function identifier, aka "which activity are we requesting bestie". The legal values forFCTIDare-1391for changing a metafile name, and-1396for effecting a pause in an X window. Those are the only two, don't try to freestyle.LIDR(Integer, Input) β the dimension of theIDRinput data record array (forIDR, scroll down a lil bit, it's right there π).IDR(Character * 80 Array, Input) β the input data record, the actual payload. For calls toGESCwithFCTIDequal to-1391, this record should contain the desired metafile name, left justified and blank filled. For calls toGESCwithFCTIDequal to-1396, it should contain the workstation identifier encoded as a five character number. Yes, five. Encode it right. πMXODR(Integer, Input) β the maximum length of theODRoutput data record array (forODR, see the next bullet, we got you).LODR(Integer, Output) β the dimension of theODRoutput data record array.ODR (MXODR)(Character * 80 Array, Output) β the output data record. That's the thing coming back at you.
π₯ USAGE π₯
Simple rule, no cap: LIDR, MXODR, and LODR must always be at least "1" in value.
That's the whole section. Short king. π
π EXAMPLES π
okay this is the part where it gets fun. GESC can be used to dynamically change the name of an output metafile, and to do that you should use the calls GOPKS and GOPWK instead of OPN GKS. If you are using OPN GKS, then go see the man page for SETUSV for changing the name of the metafile instead. Different route, same destination, iykyk.
To change the name of the output metafile from inside your program, you make a call similar to this:
CHARACTER*80 MFNAME
CALL GOPKS (6,IDUM)
MFNAME = 'new.cgm.name'
CALL GESC(-1391,1,MFNAME,1,1,CDUM)
π¨ IMPORTANT BESTIE π¨ the call toGESCto change the metafile name must always occur just before the call toGOPWKthat opens a CGM workstation. Timing is everything. Also: setting the environment variableNCARG_GKS_OUTPUToverrides any attempt to change the name of an output metafile via aGESCcall. So if your name change is doing nothing, check your env vars, that's the culprit fr fr.
See the "User's Guide for NCAR GKS-0A Graphics" for a more complete example of changing metafile names from within a code.
And now for the pause glow-up. Here's an example of a code that will create an X window, draw a line, and then pause waiting for a mouse click or a key click:
CHARACTER*80 IREC,ODUM
CALL GOPKS(6,0)
CALL GOPWK(3,0,8)
CALL GACWK(3)
CALL LINE(0.,0.,1.,1.)
CALL SFLUSH
IREC = ' 3'
CALL GESC(-1396,1,IREC,1,1,ODUM)
CALL GDAWK(3)
CALL GCLWK(3)
CALL GCLKS
STOP
END
But ngl? The functions FRAME and NGPICT are in general much easier to use and more flexible than the direct ESCAPE call for pausing in an X window. So it is suggested that you use those functions. Take the easy path, you deserve it. π«Ά
π ACCESS π
To use GKS routines, load the NCAR GKS-0A library ncarg_gks. Load it. Then you can slay.
π SEE ALSO π
- Online:
SETUSV,FRAME,NGPICT,gescape - Hardcopy: User's Guide for NCAR GKS-0A Graphics; NCAR Graphics Fundamentals, UNIX Version
π COPYRIGHT π
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, we ate and left no crumbs π β¨ this was the UNIX version, dated March 1993 β yeah she's vintage but she still serves, mwah ππ
π¦ where this page comes from
- epel 9: ncl-devel 6.6.2-59.el9 Β· LicenseRef-Callaway-BSD
- fedora 43: ncl-devel 6.6.2-58.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: ncl-devel 6.6.2-62.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms