[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

605.0. "DCL Lexicals from Language" by COOKIE::CHAVEZ (Dale C. - CXO3 Colo Spgs) Tue Nov 24 1987 13:18

Greetings,

Is there a way to use the DCL lexical functions from a high-level
language (BASIC, PASCAL, et al) ?  It would be nice to be able to use
all of them if it was F$POSSIBLE("ALL").

Dale
T.RTitleUserPersonal
Name
DateLines
605.1Use system servicesCSC32::HAGERTYVeni,Vedi,$cmkrnli,rebootiTue Nov 24 1987 13:338
    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()
605.2C version of f$trnlnm()FOO::BHAVNANIIt's not a bug - it's a feature!Wed Dec 02 1987 15:1064
	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);
}
605.3BOLIVR::PARKsilence means approvalSat Dec 05 1987 22:016
    
    Why do you do a toupper()?  Logical names can be of mixed case also.
    
    Just being a pest.
    
    -x