Article View: net.lang.pasca
Article #1Re: Peek and poke using variant records - (nf)
From: utzoodecvaxharponpoivnpoishouxmi...
Date: Sun, 12 Dec 1982 15:27
Date: Sun, 12 Dec 1982 15:27
27 lines
1292 bytes
1292 bytes
#R:peri:-16000:uiucdcs:27900003:000:788 uiucdcs!essick Dec 12 14:21:00 1982 Under PASCAL-6000 and NOS-1.4 you can read the command line and print it out with the following program segment. You have to disable runtime checks for this portion of your program or you will get invalid pointer errors (PASCAL-6000 keeps some info laying around which it checks to see if the object pointed to is the right type) type string = packed array [ 0.. 100] of char; var cc : record case boolean of true : ( x : integer); false: ( strptr : ^ string); end; begin cc.x := 67b; (* point it at the record *) for i := 0 to whatever do write (output, strptr^[i]); writeln (output); end; I may have baubled the actual number for the command line. I am not sure if the Berkeley Pascal behaves in the same way. -- Ray Essick, University of Illinois at Urbana-Champaign
Technical Details
Message-ID:
<bnews.uiucdcs.1219>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
From: utzoo!decvax!harpo!npoiv!npois!houxm!ihnp4!ixn5c!inuxc!pur-ee!uiucdcs!essick Newsgroups: net.lang.pasca Title: Re: Peek and poke using variant records - (nf) Article-I.D.: uiucdcs.1219 Posted: Sun Dec 12 15:27:08 1982 Received: Mon Dec 13 05:54:42 1982 Subject: Re: Peek and poke using variant records - (nf) Date: Sun, 12 Dec 1982 15:27:08 +0000 Message-ID: <bnews.uiucdcs.1219>