Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!bbn!uwmcsd1!ig!agate!ucbvax!DRYCAS.CLUB.CC.CMU.EDU!SYNFUL From: SYNFUL@DRYCAS.CLUB.CC.CMU.EDU (Marc Shannon) Newsgroups: comp.os.vms Subject: Pascal type recasting and Wanted: Snobol Message-ID: <8806201900.AA13936@ucbvax.Berkeley.EDU> Date: 13 Jun 88 07:41:34 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 51 I am working on a Pascal program which receives a block of data from a network connection. For simplicity, I'm storing this data into a packed array of characters. I need to convert two characters in the array to their 2-byte word length integer equivalent. The bytes are coming in in MSB-LSB form as shown: 1 0 0 0 5 8 7 0 ....+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.... | | | ....+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.... M L S S B B Since this would seem to be standard VAX form for a word, I tried to use recasting to get it into a word length integer like: Type Word = [WORD] 0..65535; Var WholePacket : Packed Array [1..128] of Char; TwoBytes : Packed Array [1..2] of Char; Number : [WORD] 0..65535; . . TwoBytes := WholePacket[4] + WholePacket[5]; Number := TwoBytes::Word; Unfortunately, "Number" gets the value of the word length integer with the bytes swapped (ie. bits 7-0 followed by 15-8). Am I getting confused in my youth or is Pascal doing something for me? --SECOND QUESTION-- We are trying to get Snobol (or Spitbol) up on our VAX. We've received references to a DECUS version, but we seem to have all the tapes since '83 with the exception of the '84A tape (which is where my listing says it exists). If you have (and are willing/able to share) a version of either of these languages, please let me know. Any help/pointers would be GREATLY appreciated! --Marc Shannon Carnegie-Mellon University SYNFUL@DRYCAS.CLUB.CC.CMU.EDU or DRYCAS.Bitnet