The following subprogram DATASET, which I keep tacked onto the end of a modified version of an early Chau TERMinal, uses SPLEX/BASICLEX functions to simplify entering and selection of RS232 parameters for various commections. (It can be tried out without an RS232 interface online.) Bruce Hobson wrote a similiar routine, but didn't use SPLEX functions to permanently incorporate labelled setups into the TERMinal's BASIC program file. I sent an earlier version of this code to Bruce, but I don't know if he passed it on or not. Because it uses MODIFY, so requiring the file to be RAM based, and is currently restricted to HP-82164A type RS232 interfaces (HP-82168A type couplers weren't sold in Australia until recently), it won't be general of use but it may be of use to some in CHHU. Because it is CALLed from (an early) ChauTerm the passed variables should fit (later versions) OK, unless he has radically altered things. In my version the CALL goes just after the initial variable assignments, before the beginning of the main loop. It works OK in the LCD (a few squashed prompts aside), and as written it assumes any :DISPLAY is either a Mountain Computer or HP-82163 type video interface. The escape codes (line 60) may need alteration for other :DISPLAYs (e.g. "Pac Screens", etc). It should only be a matter of altering the input DATA and the REMOTE mode sequences to adapt it for an 82168A coupler (but I'm only guessing because I've never actually seen one). This subprogram works right up to its exit point without an RS232 online if anyone who might use it with a coupler wants to try it out before putting in the work of adaptation. IN: parameters for line 20 are as in line 10. (Line 10 is just a dummy call to document inputs &/or exercise the subprogram). R can have any value. OUT: R=0 if setup selected requires endlines sent as CR only, or R=1 if they should be CR&LF. (This facility is for one of my personal kludges onto ChauTerm). If variable I has been passed by reference it will have the same value as input if routine ran OK, or it will be set =0 if a fatal error occurred and the setup could not be effected. Lesser errors just cycle the user back to the main prompt for another try at it. When DATASET is called, the last setup specified (i.e. the current setup) will be displayed and (main prompt) the user is invited to change it: Y?N. Y to change (or review) setup; ? to see what named setups are currently in the subprogram (here only one - CHHU - which specifies parameters for this board); any other key including N to set the RS232 parameters as specified and return to the calling program (the exit message will require recustomization for other versions of ChauTerm). If just trying out the program, without an RS232 in the IL, pressing N will cause an error recycle to the main prompt: INIT 1 will stop things. When Y has been pressed, to change or review the RS232 parameters, the first prompt offers a choice of 'S' or baud rates: if the change is to a named Setup, type in the name (quotes optional). Alternatively, to select a specific baud rate, just type it in. Or hit [ENDLINE] only to accept the displayed baud rate (and if just reviewing settings). Following prompts are for flow control (no software handshake, receiver protocol, or one variant of transmitter protocol), number of data bits, parity (O,E,M,S,1,0, & N are all acceptable inputs), number of stop bits, echo (eennaabblleedd oorr disabled), and endline sequence. Only the first character or numeral of a reponse need be entered, and any input errors cause a recycle to the main prompt. If the setup has been changed the user is invited to name it. It is not necessary to name a setup (hit endline without input), but if a name is supplied then the setup will be added to the program and may be reselected using that name in future. Rules for names are as for BASIC program labels, except that single character names A thru E are reserved for DATASET use (an invalid input causes an error/recycle to the main prompt). Some code to delete named setups would be easy enough to add, but this version is manual: FETCH , delete line, and RENUMBER. RENUMBERing is OK provided the increment is 10. If the subprogram is in the same file as other (sub)program(s) it must be the last routine in the file. If more parameters are added as setting options then the constant 4.1 in line 260 will have to be specified to a greater number of decimal places. Surely the image in line 320 can be expressed more compactly (?) but I haven't happened on how yet. Annotations: what annotations? 0010 STD @ DELAY 0,0 @ CALL DATASET(DEVADDR("DISPLAY"),R,DEVADDR("RS232"),SGN(D+1),CHR$(27)) @ DISP R 0020 SUB DATASET(D,R,I,V,E$) ! (c) Nick Reid 1986 0030 ON ERROR GOTO 350 @ DIM A,C$[65],K,L,L$,M,M$[22],N$[9],Q,R$,T$[9],U$[97],X,Z 0040 IF MEM<256 THEN DIM Z$[512] ELSE GOTO 'D' @ 'B': L=ERRL+10 @ M=ERRL 0050 IF LEN(LIST$(M+10)) THEN M=M+10 @ GOTO 50 ELSE ON ERROR GOTO 340 0060 IF V THEN DISPLAY IS :D @ DISP E$&"="&E$&"]"&E$&"<" 0070 RESTORE @ READ L$,U$,C$ @ T$=L$[23] @ L$=L$[1,21] @ R=L$[20,20]="+" 0080 DISP "DCE <"; @ IF LEN(T$) THEN DISP "P"; 0090 DISP "RESET> RS232" @ DISP @ IF LEN(T$) THEN DISP T$;' : '; @ GOTO 170 0100 FOR Q=1 TO 7 @ READ Z,M$,M$ @ GOSUB 380 @ DISP M$;TAB(11);U$[X,X+3] 0110 IF NOT V THEN BEEP @ WAIT 1 0120 NEXT Q @ DISP 0130 INPUT "Setup name? ";R$ @ IF NOT LEN(R$) THEN DISP @ GOTO 170 0140 GOSUB 390 @ ON ERROR GOTO 150 @ RESTORE R$ @ GOTO 130 0150 ON ERROR GOTO 340 0160 M=M+10 @ MODIFY CAT$(0),STR$(M)&R$&": DATA "&L$ @ GOTO 220 0170 DISP "Change Y?N" @ R$=UPRC$(KEYWAIT$) @ IF R$#"?" THEN 200 ELSE ON ERROR GOTO 30 0180 DISP @ FOR Q=L TO M STEP 10 @ U$=LIST$(Q) @ DISP U$[1,POS(U$,":")-1] @ WAIT .5 0190 NEXT Q @ GOTO 30 0200 IF R$#"Y" THEN 310 ELSE ON ERROR GOTO 30 0210 DISP @ RESTORE 'A' @ Q=1 @ GOSUB 360 @ IF NUM(R$)>48 AND NUM(R$)<55 THEN 230 0220 GOSUB 390 @ RESTORE R$ @ READ L$ @ T$=R$ @ GOTO 280 0230 FOR Q=1 TO 7 @ A=Z @ IF Q-1 THEN GOSUB 360 ELSE A=0 0240 DISP @ IF R$=UPRC$(U$[X,X+LEN(R$)-1]) THEN 270 0250 K=POS(U$[A+1,Z],R$[1,1]) @ IF NOT MOD(K,2) THEN 30 0260 T$="" @ K=(4*(IP(K/4.1)+1)+A)/4 @ L$[3*Q-2,3*Q]=C$[3*K-2,3*K] 0270 NEXT Q 0280 GOTO 'C' @ 'E': ON ERROR GOTO 340 @ IF L$[9,9]="0" THEN L$[11,11]="4" 0290 U$=LIST$(ERRL) @ U$[POS(U$,"DATA")+5]=L$ @ IF LEN(T$) THEN U$=U$&" "&T$ 0300 MODIFY CAT$(0),STR$(ERRL)&" "&U$ @ GOTO 30 0310 REMOTE @ OUTPUT :I ;"AE0;B0;C0;DE0;EE0;LE0;NE0;R0;R1;SE0;SL7;" 0320 OUTPUT :I USING "3A';'3A';'3A';'3A';'3A';'";L$ @ LOCAL 0330 DISP E$&'['&'RS232 HP71B [I/R] help [OFF] quit' @ DISPLAY IS * @ END 0340 DISP ERRM$ @ BEEP 550,2 @ POP @ POP @ GOTO 30 0350 I=0 @ END 0360 READ Z,M$,N$ @ DISP M$;" ";N$; @ GOSUB 380 0370 INPUT " ",U$[X,X+3];R$ @ R$=UPRC$(R$) @ RETURN 0380 X=4*(POS(C$,L$[3*Q-2,3*Q])+2)/3-3 @ RETURN 0390 IF NOT LEN(R$)-1 AND POS("ABCDE",R$) THEN POP @ GOTO 30 ELSE RETURN 0400 'C': ON ERROR GOTO 'E' @ SFLAG 77 @ DATA SB6C1 SW0P4 SS1EE0C-L F 0410 DATA 300 600 1200Clr Tx Rx 8 7 6 5 EvenOdd Mk0 Sp1 None1 2 Dis En CRLFNoLF 0420 DATA SB6SB7SB8C0 C1 C2 SW0SW1SW2SW3P0 P1 P2 P3 P4 SS0SS1EE0EE1C+LC-L 0430 'A': DATA 12,"'S',3,6,1200",BAUD,24,Tx/Rx/Clr,FLOW,40,5/6/7/8,DATA 0440 DATA 60,EO/MS=01/N,PARITY,68,1/2,STOP,76,Dis/Enable,ECHO,84,CRLF/NoLF,ENDLINE 0450 'D': ON ERROR GOTO 'B' @ SFLAG 77 0460 'CHHU': DATA SB6C2 SW1P0 SS0EE0C+L I find it's a pain in the brain to have to remember &/or think what filename to give something when I want to capture some incoming modem data, and subsequent chaos if I haven't remembered &/or thought about it. The following routinelet provides an 8-character "date and time stamp" in B$ ("MMddhhmm"), for use as a filename or etc. Such a string might also be useful in data logging and other time-referencing file-based applications. 0010 R$=TIME$ @ B$=DATE$ @ R=VAL(B$[4,5])*2-1 0020 B$="JAFEMRAPMYJEJLAUSEOCNODE"[R,R+1]&B$[7]&R$[1,2]&R$[4,5]