| With very few exceptions, the lexicals are dcl implementations of
system services that are callable from the language of your choice.
For example f$getjpi is a lexical implementation of the $getjpi
system service. About the only stuff you can't do is things like
f$environment("prompt"), of f$environment (most_all_of_the_items).
I've probably missed a few.
Dave()
|
| Here is a C version of a simple f$trnlnm(). I use it to setup
default filespecs, directory names and parameters for my
application. It's called trnlog() and is used thusly:
strcpy (logical, "SYS$NODE");
if (trnlog(logical,xlation)==SS$_NORMAL)
printf ("You are logged into node %s\n", xlation);
else
printf ("Cannot translate SYS$NODE\n");
/ravi
/*
* Routine: TRNLOG.C
* Function: A less hostile interface to $TRNLOG.
* Author: Ravi Bhavnani
*
* Synopsis: int trnlog (logical, translation)
* char *logical, *translation;
*
* Description: Returns the translation of the logical name
* in "logical", in "translation". If no translation
* is found, returns a null string in "translation".
* Status of the internal LIB$SYS_TRNLOG call is
* returned thru trnlog().
*
* Limitations: String parms must be < MAXLEN bytes long.
*/
#define MAXLEN 255
#include descrip
#include ssdef
#include ctype
trnlog (logical, translation)
char *logical, *translation;
{
static $DESCRIPTOR (source, "");
static $DESCRIPTOR (dest, " ");
int length,
status;
for (length=0; (length<strlen(logical)); length++)
logical[length] = toupper(logical[length]);
for (length=0; (length<MAXLEN); length++)
translation[length] = ' ';
translation[length] = '\0';
source.dsc$a_pointer = logical;
source.dsc$w_length = strlen(logical);
dest.dsc$a_pointer = translation;
dest.dsc$w_length = MAXLEN;
status = lib$sys_trnlog (&source, &length, &dest);
if (status == SS$_NOTRAN)
length = 0;
else
if (length > MAXLEN)
length = MAXLEN;
translation [length] = '\0';
return (status);
}
|