home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: DFÜ und Kommunikation / SOS-DFUE.ISO / programm / dos / protokol / bonez / bone$.was < prev    next >
Encoding:
Text File  |  1993-10-05  |  2.4 KB  |  86 lines

  1. ;Script to use Bear Bone$ in Procomm for Windows       
  2. ;Function of the script is to "fetch" the current port settings and 
  3. ;then pass them to Bear Bone$, automatically using the /BDR= and
  4. ;/BTS= options.  This options then sets Bear Bone$'s port settings
  5. ;used in the "DOS box" to correspond with the setting used by Procomm
  6. ;in Windows.
  7.  
  8. proc main
  9. string boneparm             ; store parameter input line
  10. string bonecommandline="bone$ "  ; final commandline
  11. string setbts=" /BTS="
  12. string setbdr=" /BDR="
  13. string dabaud             ; store baud rate
  14. string dabit             ; store bit
  15. string dasbit             ; store stop bits
  16. string daparity             ; store parity
  17.  
  18. long bb_baud             ; port baud rate to be fetched
  19.  
  20. integer bb_databit         ; port bit to be fetched
  21. integer bb_parity         ; port parity to be fetched
  22. integer bb_stopbit         ; port stop bit to be fetched
  23.  
  24.  
  25. ; Fetch commands to get current port settings that will be 
  26. ; passed to Bear Bone$
  27. fetch baudrate bb_baud        ;fetches baud rate
  28. fetch port databits bb_databit    ;fetches data bits
  29. fetch port stopbits bb_stopbit    ;fetches stop bits
  30. fetch port parity bb_parity    ;fetches parity
  31.  
  32. ;usermsg "The bit stuff is [%i] [%i] [%i]" bb_databit bb_stopbit bb_parity
  33.  
  34.  
  35. ; Converts Fetch values to strings
  36. ltoa bb_baud dabaud            
  37. itoa bb_databit dabit
  38. itoa bb_stopbit dasbit
  39.  
  40. ;Gives the number returned by the "fetch port parity" command
  41. ;the corresponding alpha value
  42. switch bb_parity
  43.     case 0
  44.        daparity="N"
  45.     endcase
  46.     case 1
  47.        daparity="O"    
  48.     endcase
  49.     case 2
  50.        daparity="E"
  51.     endcase
  52.     case 3
  53.        daparity="M"
  54.     endcase
  55.     default
  56.        daparity="S"
  57.     endcase
  58. endswitch
  59.  
  60. ;concatenate the strings to implement /BDR= and /BTS= options
  61. strcat setbdr dabaud
  62. strcat setbts dabit
  63. strcat setbts daparity
  64. strcat setbts dasbit
  65.  
  66. ;User inputs the startup string with out having to enter 
  67. ;/BDR and /BTS options. i.e.
  68.  
  69. ;****************************************************************************
  70. ; here's what you need to type at the prompt:
  71. ;
  72. ;  <parm-file> PUT|GET <pc-file> <mf-file> <mf-options>
  73. ;
  74. ;****************************************************************************
  75.  
  76. sdlginput "Parameter Entry" "Enter Parameters" boneparm
  77.  
  78. ;concatenate strings for final parameter line
  79. strcat bonecommandline boneparm
  80. strcat bonecommandline setbdr
  81. strcat bonecommandline setbts
  82. ;usermsg "the command line [%s]" bonecommandline
  83.  
  84. dos bonecommandline            ;dos call to bone$
  85.  
  86. endproc    ;end of script