<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.signature.net/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.signature.net/index.php?action=history&amp;feed=atom&amp;title=IB_Statements%2Fpstat</id>
		<title>IB Statements/pstat - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.signature.net/index.php?action=history&amp;feed=atom&amp;title=IB_Statements%2Fpstat"/>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=IB_Statements/pstat&amp;action=history"/>
		<updated>2026-04-20T09:07:49Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.0</generator>

	<entry>
		<id>http://wiki.signature.net/index.php?title=IB_Statements/pstat&amp;diff=4018&amp;oldid=prev</id>
		<title>Barb at 15:45, 25 June 2014</title>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=IB_Statements/pstat&amp;diff=4018&amp;oldid=prev"/>
				<updated>2014-06-25T15:45:51Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 15:45, 25 June 2014&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; 22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  Directory&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; 22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  Directory&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; 25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  Last system function (See QERCOMET)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; 25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  Last system function (See QERCOMET)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; 27&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  Last EXCP&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; 29&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  Controlling terminal (TERM$)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; 29&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  Controlling terminal (TERM$)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; 32&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  Initiating terminal (ITERM$)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp; 32&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  Initiating terminal (ITERM$)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:459:newid:4018 --&gt;
&lt;/table&gt;</summary>
		<author><name>Barb</name></author>	</entry>

	<entry>
		<id>http://wiki.signature.net/index.php?title=IB_Statements/pstat&amp;diff=459&amp;oldid=prev</id>
		<title>Badge: New page: '''PSTAT function'''   '''Syntax:'''  PSTAT(partition [,EXCP=statement-label])    '''Discussion:'''  The PSTAT function returns the current status of a specified partition. A 211-byte stri...</title>
		<link rel="alternate" type="text/html" href="http://wiki.signature.net/index.php?title=IB_Statements/pstat&amp;diff=459&amp;oldid=prev"/>
				<updated>2009-05-22T12:34:20Z</updated>
		
		<summary type="html">&lt;p&gt;New page: &amp;#39;&amp;#39;&amp;#39;PSTAT function&amp;#39;&amp;#39;&amp;#39;   &amp;#39;&amp;#39;&amp;#39;Syntax:&amp;#39;&amp;#39;&amp;#39;  PSTAT(partition [,EXCP=statement-label])    &amp;#39;&amp;#39;&amp;#39;Discussion:&amp;#39;&amp;#39;&amp;#39;  The PSTAT function returns the current status of a specified partition. A 211-byte stri...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''PSTAT function''' &lt;br /&gt;
&lt;br /&gt;
'''Syntax:'''  PSTAT(partition [,EXCP=statement-label])  &lt;br /&gt;
&lt;br /&gt;
'''Discussion:'''  The PSTAT function returns the current status of a specified partition. A 211-byte string is returned. See below for a list of the values returned by this function. &lt;br /&gt;
&lt;br /&gt;
The partition parameter is the name of the partition to check. It may be a string constant or a string variable. &lt;br /&gt;
 &lt;br /&gt;
 Return values:  Position     Length    Description&lt;br /&gt;
 ===========================================================&lt;br /&gt;
 1            8         Program name&lt;br /&gt;
 9            2         Logical unit number&lt;br /&gt;
 11           8         Current file name&lt;br /&gt;
 19           3         Current file name extension&lt;br /&gt;
 22           3         Directory&lt;br /&gt;
 25           2         Last system function (See QERCOMET)&lt;br /&gt;
 29           3         Controlling terminal (TERM$)&lt;br /&gt;
 32           3         Initiating terminal (ITERM$)&lt;br /&gt;
 35           2         RUNSTATE value&lt;br /&gt;
 37           4         Next user address&lt;br /&gt;
 41           3         Directory name of object program&lt;br /&gt;
                        currently running&lt;br /&gt;
 44 *         16        First 16 bytes of user's password&lt;br /&gt;
 60 **        2         Session number (Intel hex format)&lt;br /&gt;
 62           150       50 DABS&lt;br /&gt;
 212          4         The Partition's Task ID (zero based)&lt;br /&gt;
 216          2         The ENTERLEVEL (decimal)&lt;br /&gt;
 218          1         Comet32 flag: 1 if running Comet32, 0 otherwise&lt;br /&gt;
 219          1         Comet32 object flag: 1 if running Comet32 program, 0 otherwise&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''History:'''  * Starting with Comet version 504.208, the PSTAT function returns the first 16 bytes of the user's password as defined by the SECURE statement. This value is stored starting at position 44. &lt;br /&gt;
&lt;br /&gt;
'''Note:''' The SECURE statement transfers a user-defined 32-byte string to the partition's task header, and is a convenient way to store a unique value, such as the user's log-on password. The PASSWORD function returns the 32-byte string-argument. The PSTAT function returns the first 16 bytes of this string-argument. &lt;br /&gt;
&lt;br /&gt;
We suggest that you use the SECURE statement to store two values, a user ID and a password, as follows: &lt;br /&gt;
&lt;br /&gt;
Bytes 1-16 user name (available via PSTAT) &lt;br /&gt;
&lt;br /&gt;
Bytes 17-32 password (not available via PSTAT) &lt;br /&gt;
&lt;br /&gt;
To retrieve your own user ID, perform the following operation: &lt;br /&gt;
&lt;br /&gt;
USER$ = SUB(PSTAT(PARTITION$),44,16) &lt;br /&gt;
&lt;br /&gt;
where USER$ is a string variable with a length of 16. &lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
** The Comet session number is stored at positions 60 and 61 in Intel hex format (lowbyte/hibyte). On older systems, byte 61 can contain a blank space (&amp;quot;@20@&amp;quot; or decimal 32), so the following code will check it. &lt;br /&gt;
&lt;br /&gt;
Stat$ = PStat(Partition$)&lt;br /&gt;
&lt;br /&gt;
SessionNum = Asc(Sub(Stat$, 61, 1))&lt;br /&gt;
&lt;br /&gt;
If (SessionNum EQ 32 ) Then _  ! Old system or a very large (&amp;gt;= 8192 sessions!) Comet system&lt;br /&gt;
    SessionNum = 0&lt;br /&gt;
&lt;br /&gt;
SessionNum = Asc(Sub(Stat$, 60, 1)) + (SessionNum * 256)&lt;br /&gt;
&lt;br /&gt;
If (SessionNum EQ 0) Then _    ! Zero is always a background session&lt;br /&gt;
    Goto IsBackground&lt;br /&gt;
&lt;br /&gt;
SessionNum = SessionNum-1      ! Session numbers are based 0&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Starting with Build 292, PSTAT adds leading 0's to a partition name if you specify a &amp;quot;short&amp;quot; partition name. &lt;br /&gt;
&lt;br /&gt;
Example: You specify: PSTAT(&amp;quot;3&amp;quot;) &lt;br /&gt;
Comet performs: PSTAT(&amp;quot;003&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
Example2:&lt;br /&gt;
  LENGTH 211 &amp;amp; LOCAL VALUE$&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 VALUE$ = PSTAT(&amp;quot;P00&amp;quot;,EXCP=9999)&lt;br /&gt;
&lt;br /&gt;
This example shows how the PSTAT function can be used to obtain partition status information for partition &amp;quot;P00&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Badge</name></author>	</entry>

	</feed>