home *** CD-ROM | disk | FTP | other *** search
/ Carousel / CAROUSEL.cdr / mactosh / hc / hyperter.sit / HyperTerm / card_5208.txt < prev    next >
Text File  |  1988-10-30  |  3KB  |  105 lines

  1. -- card: 5208 from stack: in
  2. -- bmap block id: 5381
  3. -- flags: 0000
  4. -- background id: 2755
  5. -- name: XCMD help
  6. ----- HyperTalk script -----
  7. on openCard
  8.   hide message box
  9. end openCard
  10.  
  11.  
  12.  
  13. -- part 1 (field)
  14. -- low flags: 00
  15. -- high flags: 0000
  16. -- rect: left=10 top=51 right=329 bottom=501
  17. -- title width / last selected line: 0
  18. -- icon id / first selected line: 0 / 0
  19. -- text alignment: 0
  20. -- font id: 2
  21. -- text size: 10
  22. -- style flags: 0
  23. -- line height: 12
  24. -- part name: 
  25.  
  26.  
  27. -- part 2 (field)
  28. -- low flags: 00
  29. -- high flags: 0000
  30. -- rect: left=10 top=26 right=54 bottom=501
  31. -- title width / last selected line: 0
  32. -- icon id / first selected line: 0 / 0
  33. -- text alignment: 1
  34. -- font id: 2
  35. -- text size: 18
  36. -- style flags: 1024
  37. -- line height: 24
  38. -- part name: 
  39.  
  40.  
  41. -- part 3 (button)
  42. -- low flags: 00
  43. -- high flags: 0000
  44. -- rect: left=466 top=307 right=336 bottom=502
  45. -- title width / last selected line: 0
  46. -- icon id / first selected line: 2162 / 2162
  47. -- text alignment: 1
  48. -- font id: 0
  49. -- text size: 12
  50. -- style flags: 0
  51. -- line height: 16
  52. -- part name: Return
  53. ----- HyperTalk script -----
  54. on mouseUp
  55.   visual effect iris close
  56.   pop card
  57. end mouseUp
  58.  
  59.  
  60.  
  61. -- part 5 (button)
  62. -- low flags: 00
  63. -- high flags: 0000
  64. -- rect: left=430 top=307 right=336 bottom=466
  65. -- title width / last selected line: 0
  66. -- icon id / first selected line: 27009 / 27009
  67. -- text alignment: 1
  68. -- font id: 0
  69. -- text size: 12
  70. -- style flags: 0
  71. -- line height: 16
  72. -- part name: Next
  73. ----- HyperTalk script -----
  74. on mouseUp
  75.   visual effect wipe left
  76.   go to next card
  77. end mouseUp
  78.  
  79.  
  80. -- part contents for card part 2
  81. ----- text -----
  82. Serial Port XCMDs
  83.  
  84. -- part contents for card part 1
  85. ----- text -----
  86. The serial port XCMDs allow HyperTalk programs to read and write both of the serial ports. They closely follow the calls available in the Mac OS. All the commands and func-tions take a ┬½port┬╗ parameter, which is 1 for the modem port or 2 for the printer port.
  87.  
  88. openSPort ┬½port┬╗ ΓÇö This command opens the serial driver for the port.
  89.  
  90. resetSPort ┬½port┬╗,┬½configuration┬╗ ΓÇö This command resets the port and sets the baud rate,
  91.      parity, number of stop bits, and number of data bits according to ┬½configuration┬╗. See
  92.      pages II-250 and II-251 of Inside Macintosh for valid configuration values.
  93.  
  94. bufferSPort(┬½port┬╗,┬½oldBuffer┬╗,┬½newBuffSize┬╗) ΓÇö This function is used to change the
  95.      buffer used to store incoming serial port characters. It performs three functions: it
  96.      deallocates the old buffer, if any; it allocates a new buffer, if any; and it sets the
  97.      buffer to be used. The allocation is performed using NewPtr, so it is VERY important
  98.      that a matching DisposPtr be invoked before exiting HyperCard (otherwise, the
  99.      buffer will be automatically deallocated despite the fact that the serial port is still
  100.      using it. The normal way to use bufferSPort, therefore, is to call it twice: On
  101.      openStack, "put bufferSPort(┬½port┬╗,0,┬½newBufferSize┬╗) into theBuffer" allocates a
  102.      new buffer of ┬½newBufferSize┬╗ bytes and installs it; theBuffer is a global variable.
  103.      On closeStack, "bufferSPort(┬½port┬╗,theBuffer,0)" tells the port to use the deafult serial
  104.      port buffer, and deallocates the buffer we allocated in the first call.
  105.