[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

389.0. "Hacking lexical functions." by UTRTSC::ROBERTS (Nigel Roberts, G4IJF et al) Fri Jan 23 1987 09:11

    I just had a support call from a customer who is hacking DCL lexical
    functions. (I don't know why he isn't using a programming language,
    but ... ).
    
    I've given his question some thought, but I don't really see a way to do
    it. Maybe somebody could throw some light on it for me.
        
    He wants to convert 32-bit quantity consisting of 3 bytes plus an
    ascii character into an integer plus the character.
    
    He says that the function he wants is "f$cvui applied to an integer
    instead of a string".
    
    Can DCL be tricked into regarding the integer as a string somehow?
    (Then he can just use f$cvui).
    
    Ideas?
    
    
    
T.RTitleUserPersonal
Name
DateLines
389.1I think it can be doneCADSYS::SLATERKen SlaterFri Jan 23 1987 11:4113
    If I understand the question properly, you have an integer in a DCL
    symbol which is in reallity 3 bytes of an integer and a character.
    The customer wants to seperate them.
    
    I suggest reading the VMS V4.4 DCL Concepts manual, especially sections
    5.9 and 5.10, for ideas on how to solve this problem.
    
    Assuming the character is the last byte:
	$ integer_part = composite_longword/256
        $ character[0,8] := f$cvui(composite_longword,0,8)
        
    This is just off the top of my head and untested, but it may give you
    the ideas you are looking for...Ken
389.2Modest proposalMDVAX3::COARA wretched hive of bugs and flamers.Wed Dec 02 1987 15:5714
    Actually, it sounds more as though he's got 32 bits that look something
    like
    
    	$ A = %X00002341	! binary 35 plus letter A
    
    If this is the case, he can separate the parts by using
    
    	$ BIN = (A .AND. %XFFFFFF00) / 256
    	$ CHR = ""
    	$ CHR[0,8]= A - (BIN * 256)
    
    How's that?
    
    #ken	:-)}