-- card: 5208 from stack: in -- bmap block id: 5381 -- flags: 0000 -- background id: 2755 -- name: XCMD help ----- HyperTalk script ----- on openCard hide message box end openCard -- part 1 (field) -- low flags: 00 -- high flags: 0000 -- rect: left=10 top=51 right=329 bottom=501 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 12 -- part name: -- part 2 (field) -- low flags: 00 -- high flags: 0000 -- rect: left=10 top=26 right=54 bottom=501 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 2 -- text size: 18 -- style flags: 1024 -- line height: 24 -- part name: -- part 3 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=466 top=307 right=336 bottom=502 -- title width / last selected line: 0 -- icon id / first selected line: 2162 / 2162 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Return ----- HyperTalk script ----- on mouseUp visual effect iris close pop card end mouseUp -- part 5 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=430 top=307 right=336 bottom=466 -- title width / last selected line: 0 -- icon id / first selected line: 27009 / 27009 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Next ----- HyperTalk script ----- on mouseUp visual effect wipe left go to next card end mouseUp -- part contents for card part 2 ----- text ----- Serial Port XCMDs -- part contents for card part 1 ----- text ----- 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. openSPort «port» — This command opens the serial driver for the port. resetSPort «port»,«configuration» — This command resets the port and sets the baud rate, parity, number of stop bits, and number of data bits according to «configuration». See pages II-250 and II-251 of Inside Macintosh for valid configuration values. bufferSPort(«port»,«oldBuffer»,«newBuffSize») — This function is used to change the buffer used to store incoming serial port characters. It performs three functions: it deallocates the old buffer, if any; it allocates a new buffer, if any; and it sets the buffer to be used. The allocation is performed using NewPtr, so it is VERY important that a matching DisposPtr be invoked before exiting HyperCard (otherwise, the buffer will be automatically deallocated despite the fact that the serial port is still using it. The normal way to use bufferSPort, therefore, is to call it twice: On openStack, "put bufferSPort(«port»,0,«newBufferSize») into theBuffer" allocates a new buffer of «newBufferSize» bytes and installs it; theBuffer is a global variable. On closeStack, "bufferSPort(«port»,theBuffer,0)" tells the port to use the deafult serial port buffer, and deallocates the buffer we allocated in the first call.