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 |
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.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
389.1 | I think it can be done | CADSYS::SLATER | Ken Slater | Fri Jan 23 1987 08:41 | 13 |
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.2 | Modest proposal | MDVAX3::COAR | A wretched hive of bugs and flamers. | Wed Dec 02 1987 12:57 | 14 |
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 :-)} |