<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pickwiki.org/index.php?action=history&amp;feed=atom&amp;title=Getptr</id>
	<title>Getptr - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pickwiki.org/index.php?action=history&amp;feed=atom&amp;title=Getptr"/>
	<link rel="alternate" type="text/html" href="https://pickwiki.org/index.php?title=Getptr&amp;action=history"/>
	<updated>2026-04-28T22:11:46Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://pickwiki.org/index.php?title=Getptr&amp;diff=1833&amp;oldid=prev</id>
		<title>Conversion script: link fix</title>
		<link rel="alternate" type="text/html" href="https://pickwiki.org/index.php?title=Getptr&amp;diff=1833&amp;oldid=prev"/>
		<updated>2015-02-26T23:48:54Z</updated>

		<summary type="html">&lt;p&gt;link fix&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Back to [[BasicSource]]&lt;br /&gt;
&lt;br /&gt;
This is a subroutine to do the same job in Universe as the finction GETPTR does in Unidata.  It has two parameters, The first is the output and the second is the print channel you are interested in.  I tend to write subroutines this way so they can be used in dictionaries, although this is one you would never use in this way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     SUBROUTINE GETPTR(THAT,CHANNEL)&lt;br /&gt;
*&lt;br /&gt;
* This program gets the details for a SETPTR to be repeated in Universe&lt;br /&gt;
* so that you can restore a printer to a prior setting.&lt;br /&gt;
*&lt;br /&gt;
* Copyright Keith Johnson 2006 - released to the public domain&lt;br /&gt;
*&lt;br /&gt;
     EXECUTE &amp;#039;SETPTR &amp;#039;:CHANNEL CAPTURING THIS&lt;br /&gt;
     THAT = &amp;#039;&amp;#039;&lt;br /&gt;
     XXNO = DCOUNT(THIS,@AM)&lt;br /&gt;
     FOR XX = 1 TO XXNO&lt;br /&gt;
        LINE = THIS&amp;lt;XX&amp;gt;&lt;br /&gt;
        LHS = TRIM(FIELD(LINE,&amp;#039;:&amp;#039;,1))&lt;br /&gt;
        RHS = TRIM(FIELD(LINE,&amp;#039;:&amp;#039;,2,999))&lt;br /&gt;
        BEGIN CASE&lt;br /&gt;
           CASE LHS = &amp;#039;Unit Number&amp;#039;   ; THAT&amp;lt;-1&amp;gt; = RHS&lt;br /&gt;
           CASE LHS = &amp;#039;Page Width&amp;#039;    ; THAT&amp;lt;-1&amp;gt; = RHS&lt;br /&gt;
           CASE LHS = &amp;#039;Page Depth&amp;#039;    ; THAT&amp;lt;-1&amp;gt; = RHS&lt;br /&gt;
           CASE LHS = &amp;#039;Top Margin&amp;#039;    ; THAT&amp;lt;-1&amp;gt; = RHS&lt;br /&gt;
           CASE LHS = &amp;#039;Bottom Margin&amp;#039; ; THAT&amp;lt;-1&amp;gt; = RHS&lt;br /&gt;
           CASE LHS = &amp;#039;Print mode&amp;#039;    ; THAT&amp;lt;-1&amp;gt; = TRIM(FIELD(RHS,&amp;#039;-&amp;#039;,1))&lt;br /&gt;
           CASE LHS = &amp;#039;Number of copies&amp;#039; ; THAT&amp;lt;-1&amp;gt; = &amp;#039;COPIES &amp;#039;:RHS&lt;br /&gt;
           CASE LHS = &amp;#039;Default spool banner&amp;#039;&lt;br /&gt;
*             THAT&amp;lt;-1&amp;gt; = &amp;#039;AS &amp;#039;:FIELD(RHS,&amp;#039;&amp;quot;&amp;#039;,2)&lt;br /&gt;
           CASE LHS = &amp;#039;Print spool banner&amp;#039;&lt;br /&gt;
              THAT&amp;lt;-1&amp;gt; = &amp;#039;AS &amp;#039;:FIELD(RHS,&amp;#039;&amp;quot;&amp;#039;,2)&lt;br /&gt;
           CASE LHS = &amp;#039;Output to HOLD file&amp;#039;&lt;br /&gt;
              THAT&amp;lt;-1&amp;gt; = &amp;#039;AS &amp;#039;&lt;br /&gt;
              IF INDEX(RHS,&amp;#039;_&amp;#039;,1) THEN THAT := &amp;#039;UNIQUE &amp;#039;&lt;br /&gt;
              THAT := FIELD(RHS,&amp;#039;_&amp;#039;,1)&lt;br /&gt;
           CASE LHS = &amp;#039;Output NEXT hold file&amp;#039;&lt;br /&gt;
              THAT&amp;lt;-1&amp;gt; = &amp;#039;AS NEXT &amp;#039;:RHS&lt;br /&gt;
           CASE LHS = &amp;#039;Destination printer&amp;#039;&lt;br /&gt;
              THAT&amp;lt;-1&amp;gt; = &amp;#039;AT &amp;#039;:RHS&lt;br /&gt;
           CASE LHS = &amp;#039;Automatic page eject&amp;#039; AND RHS = &amp;#039;Off&amp;#039;&lt;br /&gt;
              THAT&amp;lt;-1&amp;gt; = &amp;#039;NOEJECT&amp;#039;&lt;br /&gt;
           CASE LHS = &amp;#039;Defer printing until&amp;#039;&lt;br /&gt;
              DAYT = FIELD(RHS,&amp;#039; &amp;#039;,3):FIELD(RHS,&amp;#039; &amp;#039;,2):FIELD(RHS,&amp;#039; &amp;#039;,5)&lt;br /&gt;
              DAYT = ICONV(DAYT,&amp;#039;D&amp;#039;)&lt;br /&gt;
              IF DAYT EQ DATE() THEN&lt;br /&gt;
                 NEW1 = &amp;#039;&amp;#039;&lt;br /&gt;
              END ELSE&lt;br /&gt;
* The next line fixes a weird bug in DEFER (Universe 10.0.8)&lt;br /&gt;
                 DAYT += 1&lt;br /&gt;
                 NEW1 = OCONV(DAYT,&amp;#039;DY2&amp;#039;)&lt;br /&gt;
                 NEW1 := &amp;#039;.&amp;#039;:OCONV(DAYT,&amp;#039;DM&amp;#039;)&lt;br /&gt;
                 NEW1 := &amp;#039;.&amp;#039;:OCONV(DAYT,&amp;#039;DD&amp;#039;):&amp;#039;.&amp;#039;&lt;br /&gt;
              END&lt;br /&gt;
              NEW1 := FIELD(RHS,&amp;#039; &amp;#039;,4)[1,5]&lt;br /&gt;
              THAT&amp;lt;-1&amp;gt; = &amp;#039;DEFER &amp;#039;:NEW1&lt;br /&gt;
           CASE LHS = &amp;#039;Page limit&amp;#039;&lt;br /&gt;
              START = OCONV(FIELD(RHS,&amp;#039;,&amp;#039;,1),&amp;#039;MCN&amp;#039;)&lt;br /&gt;
              IF START GT 1 THEN THAT&amp;lt;-1&amp;gt; = &amp;#039;STARTPAGE &amp;#039;:START&lt;br /&gt;
              CEASE = OCONV(FIELD(RHS,&amp;#039;,&amp;#039;,2),&amp;#039;MCN&amp;#039;)&lt;br /&gt;
              IF CEASE NE &amp;#039;&amp;#039; THEN THAT&amp;lt;-1&amp;gt; = &amp;#039;ENDPAGE &amp;#039;:CEASE&lt;br /&gt;
           CASE LHS = &amp;#039;Output formatting&amp;#039;&lt;br /&gt;
              IF RHS = &amp;#039;On&amp;#039;  THEN THAT&amp;lt;-1&amp;gt; = &amp;#039;FMT&amp;#039;&lt;br /&gt;
*             IF RHS = &amp;#039;Off&amp;#039; THEN THAT&amp;lt;-1&amp;gt; = &amp;#039;NOFMT&amp;#039;&lt;br /&gt;
           CASE LHS = &amp;#039;Output form name&amp;#039;&lt;br /&gt;
              THAT&amp;lt;-1&amp;gt; = &amp;#039;FORM &amp;#039;:RHS&lt;br /&gt;
           CASE LHS = &amp;#039;Format NLS map&amp;#039;&lt;br /&gt;
              THAT&amp;lt;-1&amp;gt; = &amp;#039;FORMAT.MAP &amp;#039;:RHS&lt;br /&gt;
           CASE LHS = &amp;#039;Fortran control codes&amp;#039;&lt;br /&gt;
              IF RHS = &amp;#039;On&amp;#039; THEN THAT&amp;lt;-1&amp;gt; = &amp;#039;FTN&amp;#039;&lt;br /&gt;
           CASE LHS = &amp;#039;Initial Job State&amp;#039; ; THAT&amp;lt;-1&amp;gt; = RHS&lt;br /&gt;
           CASE LHS = &amp;#039;Display job numbers&amp;#039;&lt;br /&gt;
              IF RHS = &amp;#039;On&amp;#039; THEN THAT&amp;lt;-1&amp;gt; = &amp;#039;INFORM&amp;#039;&lt;br /&gt;
           CASE LHS = &amp;#039;Keep output file open&amp;#039;&lt;br /&gt;
              IF RHS = &amp;#039;On&amp;#039; THEN THAT&amp;lt;-1&amp;gt; = &amp;#039;KEEP&amp;#039;&lt;br /&gt;
           CASE LHS = &amp;#039;Line numbering&amp;#039;&lt;br /&gt;
              IF RHS = &amp;#039;On&amp;#039; THEN THAT&amp;lt;-1&amp;gt; = &amp;#039;LNUM&amp;#039;&lt;br /&gt;
           CASE LHS = &amp;#039;Suppress spool banner&amp;#039;&lt;br /&gt;
              IF RHS = &amp;#039;On&amp;#039; THEN THAT&amp;lt;-1&amp;gt; = &amp;#039;NOHEAD&amp;#039;&lt;br /&gt;
           CASE LHS = &amp;#039;Retain in queue&amp;#039;&lt;br /&gt;
              IF RHS = &amp;#039;On&amp;#039; THEN THAT&amp;lt;-1&amp;gt; = &amp;#039;RETAIN&amp;#039;&lt;br /&gt;
           CASE LHS = &amp;#039;Spooler priority&amp;#039;&lt;br /&gt;
              THAT&amp;lt;-1&amp;gt; = &amp;#039;PRIORITY &amp;#039;:RHS&lt;br /&gt;
           CASE LINE[1,12] = &amp;#039;User Options&amp;#039;&lt;br /&gt;
              THAT&amp;lt;-1&amp;gt; = &amp;#039;USEROPTS &amp;#039;:LINE[25,999]&lt;br /&gt;
           CASE LHS = &amp;#039;&amp;#039;&lt;br /&gt;
           CASE 1&lt;br /&gt;
*             CRT &amp;#039;LHS = &amp;#039;:LHS&lt;br /&gt;
*             CRT &amp;#039;RHS = &amp;#039;:RHS&lt;br /&gt;
        END CASE&lt;br /&gt;
     NEXT XX&lt;br /&gt;
     CONVERT @AM TO &amp;#039;,&amp;#039; IN THAT&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;/div&gt;</summary>
		<author><name>Conversion script</name></author>
	</entry>
</feed>