RIP Kit 1.0 - Writing RIP Into TDBS Applications

Contact:   eSoft, Inc. (Makers of TBBS)
           15200 E. Girard Ave., Suite 3000
           Aurora, CO  80014
           (303) 699-6565      Voice
           (303) 699-6872      Fax
           (303) 699-8222      BBS
           support@esoft.com   E-Mail

WRITING RIP INTO TDBS APPLICATIONS
----------------------------------

If you want to program RIP applications in TDBS, keep in mind that a series of 
RIP codes ALWAYS must end with a carriage return.  If you use the ? or ?? 
output methods in TDBS, the carriage return comes BEFORE the string that's 
sent, not AFTER. Therefore, you must add a carriage return to the end of a 
sequence, either by adding: 

       +chr(13)

to the end of the string, or by using this at the end:

       ? ""

Here is an example of this concept in RIP:

       ? chr(1)+"|1M0J2I083M1400000001"
       ? chr(1)+"|1M0K5008641400000002"
       ? chr(1)+"|1M0L7I088M1400000003"
       ? chr(1)+"|1M0MA008B41400000004"
       ? ""

You should also note that we recommend beginning RIP codes in TDBS with a Ctrl-
A character, chr(1), instead of the standard bang symbol (!).  This is a RIP 
synonym that allows a RIP code to begin somewhere other than the beginning of 
a line, and has proven to be much more reliable that the bang symbol. 

Here is an example of RIP polling for use in TDBS applications, which allows 
the application to intelligently sense RIP support.  (NOTE: This is also 
included as a .PRG file with your RIP Kit.)




*
* This is a sample program startup that determines if a user has a RIPscrip 
* capable terminal program, and if so, sets RIPscrip = .T., otherwise it 
* makes RIPscrip = .F.
*
* This code fragment is released to the public domain for use in any TDBS
* applications as needed.
*

*
* Assume that we should keep it turned off to start
*
RIPscrip = .F.

*
* The following string sends a RIPscrip "query text variable" command.
* We do not actually query a variable, but instead ask for the program to
* return RIP^M.  If we receive that string, we know the terminal package is
* RIPscrip capable.
*
? '!|1'+CHR(27)+'0000RIP`M'+CHR(13)+CHR(12)

*
* There are two ways to accept the possible responses.  The first method is
* "safest", but requires a user to enter a keystroke.  Since most TDBS
* applications ask for a key to be pressed before starting, this will not
* look odd to the user.
*
?? "Press [Enter] to start program..."

*
* Now accept the user response.  In the case of a RIPscrip terminal program,
* The response will be RIP, while in other cases it will NOT be "RIP"
*
ACCEPT TO resp

*
* Instead of the above printout and ACCEPT statements, the program could
* go into a loop looking for characters.  If none were received within a
* fairly short period of time, then it could be assumed that the program
* is NOT RIPscrip capable.  This method is much more prone to error since
* line delays could cause the program to make the wrong decision.  Line
* delays are prevalent on X.25 links (like PC-Pursuit), as well as when
* high speed modems retrain because of bad line conditions.
*
* The last method is to use the "loop input" method described above, in
* conjunction with the RIPscrip ANSI code <esc>[! which will return 
* "RIPSCRIPxxxxxx" where the x's correspond to a RIPscrip version number.
* This method has the failing of causing some terminal programs to do odd
* things with the ANSI code which is non-standard, as well as the failing
* of needing the timing loop which can generate an incorrect answer.
*
* The method shown as best can only fail in the case where a user types in
* "RIP" instead of just pressing [Enter] (in which case the user was kind
* of silly to start with), or when line noise interrupts the "RIP" string.
* If line noise is interrupting the RIP string, then it is very likely that
* line noise would cause the RIP graphics to produce odd results and not
* using RIPscrip in that case is probably the best choice.
*

*
* Now clear the screen again in case the RIPscrip program sent data
*
?? CHR(12)

IF resp = "RIP"
  RIPscrip = .T.		&& He has RIPscrip capability
ENDIF

*
* At this point the program has determined RIPscrip capability and can use
* the RIPscrip memvar to do different things for a RIP user.
*

*
* Now, just to check (plug in real program code starting here)
*
IF RIPscrip
  ? "Program is RIPscrip capable"
ELSE
  ? "Program is NOT RIPscrip capable"
ENDIF

WAIT


- END -
TBBSRIP3
Rev. 10/93

Copyright (C) 1994 eSoft, Inc., All Rights Reserved.  Permission granted
to distribute this file in its entirety, without modification, to any
interested party.  Any other use requires the written permission of
eSoft, Inc.

IMPORTANT:  The information herein is subject to change without notice.
Please call or write to confirm factual information of importance to you
or your organization.

