PRSTOK (JANUS DEFINE parameter): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
(Automatically generated page update)
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:PRSTOK}}
<span class="pageSubtitle">PRSTOK [AMBIG|]hexstr1|hexstr2|... | NONE &mdash; parse token for input strings</span>
<span class="pageSubtitle"><section begin="desc" />PRSTOK [AMBIG|]hexstr1|hexstr2|... | NONE -- parse token for input strings<section end="desc" /></span>


PRSTOK is a parameter on [[JANUS DEFINE]], which defines and sets characteristics of a Janus port. See the [[JANUS DEFINE#parmlist|List of JANUS DEFINE parameters]].
<var>PRSTOK</var> is a parameter on <var>[[JANUS DEFINE]]</var>, which defines and sets characteristics of a Janus port.  


This parameter specifies the hex values of strings that are used to separate input strings using the $Sock_RecvPrs function.  
This parameter specifies the hex values of strings that are used to separate input strings using the <var>[[$Sock_RecvPrs]]</var> function.  


The default is PRSTOK NONE, which means that a PRSTOK value must be set with $SOCK_SET before the $SOCK_RECVPRS function is called. See the description of $SOCK_RECVPRS for a description of its parsing algorithm.  
The default is <code>PRSTOK NONE</code>, which means that the value <code>PRSTOK</code> must be set with <var>[[$Sock_Set]]</var> before the <var>$Sock_RecvPrs</var> function is called. See the description of <var>$Sock_RecvPrs</var> for a description of its parsing algorithm.  


Note that the specified string is used untranslated, regardless of the CHAR or BINARY setting of the socket. For example, the following specifies that input strings are delimited by the byte pair which is ASCII carriage return and linefeed:
Note that the specified string is used untranslated, regardless of the <var>[[CHAR (JANUS DEFINE parameter)|CHAR]]</var> or <var>[[BINARY (JANUS DEFINE parameter)|BINARY]]</var> setting of the socket. For example, the following specifies that input strings are delimited by the byte pair which is ASCII carriage return and linefeed:


<p class="code"> PRSTOK 0D0A
<p class="code">PRSTOK 0D0A
</p>
</p>


Specify "AMBIG|" at the start of the PRSTOK string if you are using any separator string which is the prefix of another. If you specify "AMBIG|", at least one of your separator strings must be the prefix of another. For example, the following setting is '''rejected''' because the string "0D" (ASCII carriage return) is a prefix of "0D0A" (carriage return and linefeed):
Specify <code>AMBIG|</code> at the start of the <var>PRSTOK</var> string if you are using any separator string which is the prefix of another. If you specify <code>AMBIG|</code>, at least one of your separator strings must be the prefix of another. For example, the following setting is '''rejected''' because the string "0D" (ASCII carriage return) is a prefix of "0D0A" (carriage return and linefeed):


<p class="code"> PRSTOK 0D0A|0D|0A
<p class="code">PRSTOK 0D0A|0D|0A
</p>
</p>


Also, the following setting is '''rejected''' because neither of the strings "0D0A" (ASCII carriage return and linefeed) nor "0D09" (carriage return and horizontal tab) is a prefix of the other:
Also, the following setting is '''rejected''' because neither of the strings "0D0A" (ASCII carriage return and linefeed) nor "0D09" (carriage return and horizontal tab) is a prefix of the other:


<p class="code"> PRSTOK AMBIG|0D0A|0D09
<p class="code">PRSTOK AMBIG|0D0A|0D09
</p>
</p>


See the description of the $SOCK_RECVPRS function in the ''Janus Sockets Reference Manual'' for a discussion of using ambiguous PRSTOK separator strings. .el .do See :hdref refid=ambsep..  
See the description of the <var>$Sock_RecvPrs</var> function for a discussion of using ambiguous <var>PRSTOK</var> separator strings.  


The PRSTOK value for a socket can be changed using $SOCK_SET.  
The <var>PRSTOK</var> value for a socket can be changed using <var>$Sock_Set</var>.  


Valid only for CLSOCK and SRVSOCK ports.
Valid only for <var>[[JANUS DEFINE#type|CLSOCK]]</var> and <var>[[JANUS DEFINE#type|SRVSOCK]]</var> ports.


==References==
==See also==
 
<ul>
See: [[List of Janus commands]] | [[JANUS DEFINE#parmlist|List of JANUS DEFINE parameters]].
<li>[[List of Janus commands]]
<li>[[JANUS DEFINE#parmlist|List of JANUS DEFINE parameters]]
</ul>


[[Category:JANUS DEFINE parameters|PRSTOK]]
[[Category:JANUS DEFINE parameters|PRSTOK]]

Latest revision as of 22:22, 16 April 2013

PRSTOK [AMBIG|]hexstr1|hexstr2|... | NONE — parse token for input strings

PRSTOK is a parameter on JANUS DEFINE, which defines and sets characteristics of a Janus port.

This parameter specifies the hex values of strings that are used to separate input strings using the $Sock_RecvPrs function.

The default is PRSTOK NONE, which means that the value PRSTOK must be set with $Sock_Set before the $Sock_RecvPrs function is called. See the description of $Sock_RecvPrs for a description of its parsing algorithm.

Note that the specified string is used untranslated, regardless of the CHAR or BINARY setting of the socket. For example, the following specifies that input strings are delimited by the byte pair which is ASCII carriage return and linefeed:

PRSTOK 0D0A

Specify AMBIG| at the start of the PRSTOK string if you are using any separator string which is the prefix of another. If you specify AMBIG|, at least one of your separator strings must be the prefix of another. For example, the following setting is rejected because the string "0D" (ASCII carriage return) is a prefix of "0D0A" (carriage return and linefeed):

PRSTOK 0D0A|0D|0A

Also, the following setting is rejected because neither of the strings "0D0A" (ASCII carriage return and linefeed) nor "0D09" (carriage return and horizontal tab) is a prefix of the other:

PRSTOK AMBIG|0D0A|0D09

See the description of the $Sock_RecvPrs function for a discussion of using ambiguous PRSTOK separator strings.

The PRSTOK value for a socket can be changed using $Sock_Set.

Valid only for CLSOCK and SRVSOCK ports.

See also