home *** CD-ROM | disk | FTP | other *** search
- ;Script to use Bear Bone$ in Procomm for Windows
- ;Function of the script is to "fetch" the current port settings and
- ;then pass them to Bear Bone$, automatically using the /BDR= and
- ;/BTS= options. This options then sets Bear Bone$'s port settings
- ;used in the "DOS box" to correspond with the setting used by Procomm
- ;in Windows.
-
- proc main
- string boneparm ; store parameter input line
- string bonecommandline="bone$ " ; final commandline
- string setbts=" /BTS="
- string setbdr=" /BDR="
- string dabaud ; store baud rate
- string dabit ; store bit
- string dasbit ; store stop bits
- string daparity ; store parity
-
- long bb_baud ; port baud rate to be fetched
-
- integer bb_databit ; port bit to be fetched
- integer bb_parity ; port parity to be fetched
- integer bb_stopbit ; port stop bit to be fetched
-
-
- ; Fetch commands to get current port settings that will be
- ; passed to Bear Bone$
- fetch baudrate bb_baud ;fetches baud rate
- fetch port databits bb_databit ;fetches data bits
- fetch port stopbits bb_stopbit ;fetches stop bits
- fetch port parity bb_parity ;fetches parity
-
- ;usermsg "The bit stuff is [%i] [%i] [%i]" bb_databit bb_stopbit bb_parity
-
-
- ; Converts Fetch values to strings
- ltoa bb_baud dabaud
- itoa bb_databit dabit
- itoa bb_stopbit dasbit
-
- ;Gives the number returned by the "fetch port parity" command
- ;the corresponding alpha value
- switch bb_parity
- case 0
- daparity="N"
- endcase
- case 1
- daparity="O"
- endcase
- case 2
- daparity="E"
- endcase
- case 3
- daparity="M"
- endcase
- default
- daparity="S"
- endcase
- endswitch
-
- ;concatenate the strings to implement /BDR= and /BTS= options
- strcat setbdr dabaud
- strcat setbts dabit
- strcat setbts daparity
- strcat setbts dasbit
-
- ;User inputs the startup string with out having to enter
- ;/BDR and /BTS options. i.e.
-
- ;****************************************************************************
- ; here's what you need to type at the prompt:
- ;
- ; <parm-file> PUT|GET <pc-file> <mf-file> <mf-options>
- ;
- ;****************************************************************************
-
- sdlginput "Parameter Entry" "Enter Parameters" boneparm
-
- ;concatenate strings for final parameter line
- strcat bonecommandline boneparm
- strcat bonecommandline setbdr
- strcat bonecommandline setbts
- ;usermsg "the command line [%s]" bonecommandline
-
- dos bonecommandline ;dos call to bone$
-
- endproc ;end of script