home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / dialer.cmd < prev    next >
OS/2 REXX Batch file  |  1994-02-01  |  3KB  |  98 lines

  1. /* DIALER.CMD */
  2. /*  This is a fancy-schmancy phone dialer program.
  3.     You need VREXX installed for it to work however. which of course you will
  4.     because VRexx is just so darn nifty! :)
  5.     This uses only one other file than itself, any old text file you have
  6.     laying around in which to keep your names and phone numbers.
  7.     All entries in your PHONELST file are configured as follows:
  8.     # Firstname Lastname Phonenumber
  9.     (i.e.  # Ken Kavanagh 555-1234)
  10.     You can space the words out as far as you want, it doesnt matter. and
  11.     the program should pretty much ignore any thing else in your file that
  12.     doesnt have a # in front. (Don't quote me on that)
  13.  
  14. --Set the comport and the name of your phonelist file below and you're set.--
  15.  
  16. p.s. All code was joyously stolen from other REXX scripts to create this one
  17. so Enjoy it and change it and send me a finished/improved copy
  18.  
  19. Ken Kavanagh
  20. 1:153/7070
  21. */
  22. '@echo off'
  23. comport = "COM5"
  24. phonelst = "c:\desktop\stuff!1.ken"
  25.  
  26. call RxFuncAdd 'SysLoadFuncs' , 'RexxUtil' , 'SysLoadFuncs'
  27. call SysLoadFuncs
  28. call SysFileSearch '#',phonelst,'list'
  29. call stream sat_in,'c','close'
  30. call sysdropfuncs
  31.  
  32. call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
  33. initcode = VInit()
  34. if initcode = 'ERROR' then signal CLEANUP
  35.  
  36. signal on failure name CLEANUP
  37. signal on halt name CLEANUP
  38. signal on syntax name CLEANUP
  39.  
  40. /* OPENING SCREEN */
  41. msg.0 = 4
  42. msg.1 = 'Kens Phone Dialer'
  43. msg.2 = 'written January 1994'
  44. msg.3 = 'By Ken Kavanagh'
  45. msg.4 = '1:153/7070'
  46. call VDialogPos 50, 50
  47. rb = VMsgBox('DIALER.CMD', msg, 1)
  48. CrLf = X2C("0D0A")
  49. phone = 0
  50.  
  51. do while phone = 0
  52.    /* ListBox */
  53.    list.vstring = list.1          /* default selection */
  54.    call VDialogPos 50, 50
  55.    return_button = VListBox('Select a Person to Call and Press YES', list, 60, 10, 3)
  56.    if (return_button = "OK")
  57.    then do
  58.           selection = list.vstring
  59.           parse upper var selection nil fname lname number rest
  60.           CALL CALLNUMBER
  61.           msg.0 = 4
  62.           msg.1 = 'Currently Dialing...'
  63.           msg.2 =  Fname
  64.           msg.3 =  number
  65.           msg.4 = 'Press OK to Hang Up'
  66.           call VDialogPos 50, 50
  67.           call VMsgBox 'Kens Dialer', msg, 1
  68.           call hangup
  69.           msg.0 = 1
  70.           msg.1 = "Dial Another?"
  71.           call VDialogPos 50, 50
  72.           answer = VMsgBox('KENS DIALER', msg, 6)
  73.             if answer = "YES"
  74.                then phone = 0
  75.             if answer = "NO"
  76.                then phone = 1
  77.          end
  78.          else phone = 1
  79. end
  80. /* end of CMD file */
  81.  
  82. CLEANUP:
  83.    call VExit
  84.    exit
  85.  
  86. CALLNUMBER:
  87. State = STREAM(ComPort,"C","OPEN")
  88. "@MODE" ComPort":19200,N,8,1 > NUL"
  89. CALL LINEOUT ComPort, "ATDT"Number||CrLf    /* Dial In */
  90. return
  91.  
  92. HANGUP:
  93. State = STREAM(ComPort,"C","OPEN")
  94. "@MODE" ComPort":19200,N,8,1 > NUL"
  95. CALL LINEOUT ComPort, "ATh0"||CrLf    /* Dial In */
  96. State = STREAM(ComPort,"C","CLOSE")
  97. return
  98.