home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / windows / multimed.zip / TBK-COMM.TBK (.txt) < prev    next >
Asymetrix ToolBook File  |  1990-02-23  |  65KB  |  1,189 lines

  1. closeComPort
  2. TBK-COMM.DLL
  3. TBK-COMM.DLL
  4. This DLL contains functions to control up to four separate serial ports (COM1 to COM4).  The file name of this DLL is TBK-COMM.DLL.
  5. closeComPort    Closes the port designated by <COM number>.  If the port was not opened, the function has no effect.
  6. flushComRxBuffer    Flushes out any characters in the receive buffer for a COM port.  The characters are lost.
  7. flushComTxBuffer    Flushes out any characters in the transmit buffer for a COM port.  The characters are lost.
  8. isComRxReady    Checks if there are characters in the receive buffer for a COM port.
  9. isComTxReady    Checks if there is room in the transmit buffer for a COM port.  You can use this function to avoid long waits because writeComPort will loop as long as necessary to avoid overrunning the output buffer.
  10. openComPort    Opens a serial port for communications.
  11. readComPort    Reads the characters in the receive buffer for a COM port.  Note:  The received string will be truncated if it contains a character with a null value (ANSI character zero).
  12. setComPort    Sets the parameters for a COM port.  The port must have been previously opened with openComPort.
  13. writeComPort    Writes <output> to the transmit buffer of a COM port.  Note:  There is currently no way to transmit nulls.  This capability will be added in a future version.
  14. Main List
  15. isComRxReady
  16. removeRecords    
  17. Main List
  18. displayAspectXY
  19. copyFile
  20. displayAspectY
  21. lastDBRecord
  22. isComRxReady
  23. exampleHilite
  24. isComRxReady    
  25. TBK-COMM.DLL
  26. isComRxReady(<COM number>)-
  27. Checks if there are characters in the receive buffer for a COM port.
  28. To declare this function, include the following statement in the linkDLL control structure:
  29. WORD isComRxReady(WORD)
  30. <COM number> is the number of the COM port you want to check, such as 1 for COM1, 2 for COM2, etc.  The maximum allowable value is 4.
  31. The number of bytes in the receive buffer.  If the receive buffer is empty, the number is 0.
  32. to handle idle
  33.     if isComRxReady(1) > 0 then
  34.         put readComPort(1) after text of field "Input"
  35. to handle idle
  36.     if isComRxReady(1) > 0 then
  37.         put readComPort(1) after text of field "Input"
  38. 0,480,
  39. isComTxReady
  40. isComTxReady
  41. isComTxReady    
  42. TBK-COMM.DLL
  43. isComTxReady(<COM number>)
  44. Checks if there is room in the transmit buffer for a COM port.  You can use this function to avoid long waits because writeComPort will loop as long as necessary to avoid overrunning the output buffer.
  45. To declare this function, include the following statement in the linkDLL control structure:
  46. WORD isComTxReady(WORD)
  47. <COM number> is the number of the COM port you want to check, such as 1 for COM1, 2 for COM2, etc.  The maximum allowable value is 4.
  48. The number of free bytes in the transmit buffer.  If the transmit buffer is empty, the number is the same as the size of the buffer.
  49. while isComTxReady(1) < 1
  50.     if sysTime - MarkTime > 1 then
  51.         request "Time out error on COM 1"
  52.         break to system
  53. end while
  54. get writeComPort(1, TheText)
  55. exampleHilite
  56. setComPort
  57. DLL descriptions
  58. openComPort
  59. exampleHilite
  60. openComPort    
  61. TBK-COMM.DLL
  62. openComPort(<COM number>,<Input Buffer Size>,<Output Buffer Size>)S
  63. Opens a serial port for communications.
  64. Caution:  You must call closeComPort before exiting your application, otherwise the port remains unavailable to other applications and will remain unavailable even after you exit Windows.
  65. To declare this function, include the following statement in the linkDLL control structure:
  66. INT openComPort(WORD,WORD,WORD)
  67. <COM number> is the number of the COM port you want to open, such as 1 for COM1, 2 for COM2, etc.  The maximum allowable value is 4.
  68. <Input Buffer Size> is the size of the input buffer the driver will reserve for this port.  If <Input Buffer Size> is 0, a default buffer size of 1024 bytes will be assumed.  Minimum buffer size is 32 characters; maximum i s 32767.
  69. <Output Buffer Size> is the size of the output buffer the driver will reserve for this port.  If <Output Buffer Size> is 0, a default buffer size of 128 bytes will be assumed.  Minimum buffer size is 32 characters; maximum i s 32767.9
  70. A Windows device handle it successful, or a negative number if it failed
  71. The Windows device handle is not used by the other functions in this DLL, but it is returned in case you need to reference the port in calls to other functions.9
  72. if openComPort(1,256,0) >= 0 then
  73.     request "COM1 opened successfully"
  74.     request "Could not open COM1"
  75. end if
  76.     INT openComPort(WORD,WORD,WORD)
  77. et fName t
  78. writeComPort
  79. readComPort
  80. readComPort    
  81. TBK-COMM.DLL
  82. readComPort(<COM number>)
  83. Reads the characters in the receive buffer for a COM port.  Note:  The received string will be truncated if it contains a character with a null value (ANSI character zero).
  84. To declare this function, include the following statement in the linkDLL control structure:
  85. STRING readComPort(WORD)
  86. <COM number> is the number of the COM port you want to check, such as 1 for COM1, 2 for COM2, etc.  The maximum allowable value is 4.
  87. A string of characters.  If the receive buffer was empty, a null string.
  88. set Echo to readComPort(1)
  89. exampleHilite
  90. setComPort
  91. setComPort    
  92. TBK-COMM.DLL
  93. setComPort(<COM number>,<baud>,<byte size>,<stop bits>,<parity>,<handshake>)
  94. Sets the parameters for a COM port.  The port must have been previously opened with openComPort.
  95. To declare this function, include the following statement in the linkDLL control structure:
  96. INT setComPort(WORD,WORD,WORD,WORD,WORD,WORD)
  97. <COM number> is the number of the COM port you want to check, such as 1 for COM1, 2 for COM2, etc.  The maximum allowable value is 4.
  98. <baud> is the baud rate; it can be any baud rate supported by Windows and the COM port hardware, typically 110, 300, 600, 1200, 2400, 4800, 9600 or 19200.
  99. <byte size> is the number of bits in each transmitted character, typically 7 or 8.
  100. <stop bits> is the number of stop bits that follow a transmitted character.
  101. <parity> is 0 for no parity, 1 for odd parity and 2 for even parity.
  102. <handshake> is 0 for no handshaking, 1 for hardware handshaking, or 2 for Xon/Xoff handshaking.
  103. A negative number if failed, 0 or a positive number if successful.
  104. get openComPort(1, 0, 0) -- Open COM1 with default buffer sizes
  105. if it >= 0 then
  106.     get setComPort(1, 9600, 8, 1, 0, 0) -- 9600 baud, no parity, no handshake
  107. if it < 0 then
  108.     request "Could not open COM1"
  109. exampleHilite
  110. writeComPort
  111. writeComPort    
  112. TBK-COMM.DLL
  113. writeComPort(<COM number>,<output>)
  114. Writes <output> to the transmit buffer of a COM port.  Note:  There is currently no way to transmit nulls.  This capability will be added in a future version.
  115. To declare this function, include the following statement in the linkDLL control structure:
  116. INT writeComPort(WORD, STRING)
  117. <COM number> is the number of the COM port you want to check, such as 1 for COM1, 2 for COM2, etc.  The maximum allowable value is 4.
  118. <output> is anything that evaluates to a string.  If it has a numeric value, the string representation of that value is sent.
  119. The number of characters sent.  If there was an error, the function returns a negative number.
  120. if writeComPort(1, "Hello there" & CR)  > 0 then
  121.     request "It worked!"
  122. end if
  123. exampleHilite
  124. closeComPort
  125. exampleHilite
  126. closeComPort    
  127. TBK-COMM.DLL
  128. closeComPort(<COM number>)
  129. Closes the port designated by <COM number>.  If the port was not opened, the function has no effect.
  130. To declare this function, include the following statement in the linkDLL control structure:
  131. INT closeComPort(WORD)
  132. <COM number> is the number of a COM port.
  133. If no error occurs, the function returns a positive number.  If there was an error, it returns 0.
  134. get closeComPort(1) -- Close COM1
  135. System
  136. s Rmn
  137. TBK-COMM.DLL Reference
  138. - beta
  139. L Help
  140. lockFields 
  141. default
  142. Qwhich, how
  143. -- locks 
  144. unlocks the fields 
  145. a list 
  146. -- recursive 
  147. encountering a 
  148. that may contain 
  149. eBook
  150. enterBook
  151. reader
  152. author
  153. leaveBook
  154. lockFields
  155. enterBook
  156. reader
  157. sizetopage
  158. leaveBook
  159. reader
  160. lockFields
  161. default
  162. author
  163. lockFields
  164. default
  165. lockFields
  166. field
  167. group
  168. lockFields
  169. which
  170. s Rmn
  171. -- 2/23/89 Claude O.
  172. c"&Edit" 
  173. c"&Clipboard" 
  174. "Copy LinkDLL statement" 
  175. %Example" 
  176. deActivate 
  177. "CopyLinkDLLstatement" 
  178. "&Author" 
  179. default
  180. lockFields 
  181. /"Function Pages", 
  182. Descriptions", 
  183. which, how
  184. -- locks 
  185. unlocks the fields 
  186. a list 
  187. -- recursive 
  188. encountering a 
  189. that may contain 
  190. ClearBook
  191. "This will 
  192. contents 
  193. f"OK" 
  194. "Cancel"
  195. "OK" 
  196. "Title"
  197. "Subtitle"
  198. "Syntax"
  199. "Returns"
  200. "Parameters"
  201. List"
  202. "Intro Text"
  203. "Main 
  204. trim s
  205. s <> 
  206. cs <> 
  207. < 32 
  208. s <> 
  209. cs <> 
  210. s) <= 32
  211. -- filter non-
  212. assorted funky 
  213. ", s)
  214. p > 0 
  215. cp > 0
  216. ", s)
  217. ", s) = 1
  218. Appending 
  219. "Are you sure 
  220. want 
  221. f"Yes" 
  222. "Help"
  223. showImportHelp
  224. ("Name 
  225. file (type 
  226. should appear 
  227. titles):"
  228. c"." 
  229. ~(".",
  230. ) - 1 
  231. & ".DLL"
  232. ("File 
  233. ffN & ".TXT"
  234. sendaux(
  235. pcount 
  236. isTitle 
  237. isSyntax 
  238. isDescr 
  239. isTReturns 
  240. isParameters 
  241. isExample 
  242. WaitingForIntro 
  243. IntroTag 
  244. (165) & "_"
  245. theLine 
  246. leading LF
  247. a)) > 1
  248. SetDLLIntroTxt dfN, 
  249. & CRLF & 
  250. <> "Examples" 
  251. update numbers 
  252. "ImportFListHelp"
  253. setDLLIntroTxt dllName, txt
  254. oldPg 
  255. /<> "
  256. "Do a complete 
  257. sysSuspendMessages 
  258. findExamples 
  259. -- Update 
  260. ront 
  261. "Sort 
  262. fList 
  263. "Done. 
  264. UpdateDLLPages 
  265. oldPage 
  266. dList 
  267. descriptions"
  268. -- We now have a 
  269. functions 
  270. their 
  271. dName 
  272. fName 
  273. "What can 
  274. " && 
  275. Lmax 
  276. cL = 0 
  277. j <= 
  278. L = 0 -- 
  279. "Adding" && 
  280. " && 
  281. 4s_searchString
  282. ("Search 
  283. selectedTextState 
  284. "Cannot 
  285. " && 
  286. & "."
  287. author
  288. first
  289. lockFields
  290. leaveBook
  291. ClearBook
  292. import
  293. previous
  294. showImportHelp
  295. setDLLIntroTxt
  296. enterBook
  297. UpdateDLLPages
  298. reader
  299. search
  300. enterBook
  301. reader
  302. sizetopage
  303. newPage
  304. import
  305. &Edit
  306. &Clipboard
  307. Copy LinkDLL statement
  308. Clipboard
  309. Copy Example
  310. Clipboard
  311. CopyLinkDLLstatement
  312. Copy Example
  313. &Author
  314. leaveBook
  315. default
  316. first
  317. default
  318. previous
  319. default
  320. default
  321. reader
  322. lockFields
  323. Function Pages
  324. lockFields
  325. DLL Descriptions
  326. default
  327. author
  328. lockFields
  329. Function Pages
  330. lockFields
  331. DLL Descriptions
  332. default
  333. lockFields
  334. field
  335. group
  336. lockFields
  337. which
  338. ClearBook
  339. This will clear the contents of all the pages in the book.
  340. Cancel
  341. Function Pages
  342. clear
  343. Title
  344. Subtitle
  345. Syntax
  346. Description
  347. Returns
  348. Example
  349. Parameters
  350. DLL Descriptions
  351. clear
  352. Function List
  353. Title
  354. Subtitle
  355. Intro Text
  356. Main List
  357. Main List
  358. default
  359. import
  360. Title
  361. Function Pages
  362. Are you sure you want to import?
  363. Cancel
  364. showImportHelp
  365. Name of DLL file (type name as it should appear in titles):
  366. File to import:
  367. Function Pages
  368. end of file
  369. end of file
  370. SetDLLIntroTxt
  371. y5newPage
  372. Title
  373. Subtitle
  374. Syntax
  375. Description
  376. Parameters
  377. Returns
  378. Example
  379. Function~
  380. title
  381. Syntax
  382. Description
  383. Parameters
  384. Returns
  385. Example
  386. Examples
  387. end of file
  388. y5newPage
  389. Title
  390. Subtitle
  391. Syntax
  392. Description
  393. Parameters
  394. Returns
  395. Example
  396. enterbackground
  397. theLine
  398. IntroTag
  399. WaitingForIntro
  400. Example
  401. Parameters
  402. TReturns
  403. Descr
  404. Syntax
  405. Title
  406. isExample
  407. isParameters
  408. isTReturns
  409. isDescr
  410. isSyntax
  411. isTitle
  412. pcount
  413. default
  414. count
  415. Appending
  416. showImportHelp
  417. ImportFListHelp
  418. setDLLIntroTxt
  419. DLL Descriptions
  420. Title
  421. y5newPage
  422. Title
  423. Title
  424. Intro text
  425. oldPg
  426. dllName
  427. Function Pages
  428. Title
  429. Do a complete sort and update of the book?
  430. Function Pages
  431. enterbackground
  432. findExamples
  433. Title
  434. Subtitle
  435. Sort complete. Update Main Function List?
  436. Title
  437. Subtitle
  438. Main List
  439. Main List
  440. Done. Update DLL Description Pages?
  441. kUpdateDLLPages
  442. default
  443. fList
  444. UpdateDLLPages
  445. DLL descriptions
  446. Title
  447. DLL descriptions
  448. DLL descriptions
  449. y5newPage
  450. Title
  451. Subtitle
  452. What can the functions in
  453. Function list
  454. Adding
  455. to page
  456. Description
  457. Function list
  458. fName
  459. dName
  460. dList
  461. oldPage
  462. fList
  463. search
  464. Search for:
  465. Cancel
  466. Cannot find
  467. s_searchString
  468. :,,,7,m
  469. Function Pages
  470. ofirstP 
  471. olastP 
  472. Activate 
  473. "CopyLinkDLLstatement" 
  474. deActivate 
  475. .nt" 
  476. "CopyExample" 
  477. CopyLinkDLLStatement
  478. "dummy" 
  479. " & \
  480. "Description" & CRLF
  481. B"Previous" 
  482. B"Next" 
  483. fixScroll 
  484. "Syntax"
  485. "Parameters"
  486. "Returns"
  487. resetFieldSizes
  488. "Help" 
  489. x > 0 
  490. expandSyntax
  491. 1425,870,8610,5490
  492. oexpSyntax 
  493. expandDescription
  494. 1425,870,8610,5490
  495. oexpDescription 
  496. expandParameters
  497. 1425,870,8610,5490
  498. oexpParameters 
  499. expandReturns
  500. 1425,870,8610,5490
  501. oexpReturns 
  502. 1425,870,8610,1525
  503. 1425,1550,8610,3060
  504. 1425,3090,8610,4335
  505. 1425,4385,8610,5510
  506. findExamples
  507. srch 
  508. trim(
  509. "Title" 
  510. Lmax 
  511. cL = 0 
  512. i <= LMax
  513. <> "-"
  514. L > 0 
  515. exampleHilite 
  516. xample
  517. enterPage
  518. leavePage
  519. leaveBackground
  520. fixScroll
  521. previous
  522. CopyLinkDLLStatement
  523. author
  524. expandSyntax
  525. expandDescription
  526. enterbackground
  527. expandParameters
  528. expandReturns
  529. resetFieldSizes
  530. CopyExample
  531. findExamples
  532. enterbackground
  533. firstP
  534. lastP
  535. CopyLinkDLLstatement
  536. leaveBackground
  537. CopyLinkDLLstatement
  538. CopyExample
  539. CopyLinkDLLStatement
  540. dummy
  541. Description
  542. dummy
  543. CopyExample
  544. dummy
  545. Example
  546. dummy
  547. enterPage
  548. Example
  549. Example
  550. Example
  551. CopyExample
  552. CopyExample
  553. Previous
  554. firstP
  555. lastP
  556. fixScroll
  557. Syntax
  558. fixScroll
  559. Description
  560. fixScroll
  561. Parameters
  562. fixScroll
  563. Returns
  564. leavePage
  565. resetFieldSizes
  566. Example
  567. fixScroll
  568. previous
  569. author
  570. Example
  571. expandSyntax
  572. Description
  573. Parameters
  574. Returns
  575. Syntax
  576. expSyntax
  577. expandDescription
  578. Syntax
  579. Parameters
  580. Returns
  581. Description
  582. expDescription
  583. expandParameters
  584. Syntax
  585. Description
  586. Returns
  587. Parameters
  588. expParameters
  589. expandReturns
  590. Syntax
  591. Description
  592. Parameters
  593. Returns
  594. expReturns
  595. resetFieldSizes
  596. expSyntax
  597. expDescription
  598. expParameters
  599. expReturns
  600. Syntax
  601. Description
  602. Parameters
  603. Returns
  604. Syntax
  605. Description
  606. Parameters
  607. Returns
  608. Syntax
  609. Description
  610. Parameters
  611. Returns
  612. expSyntax
  613. expDescription
  614. expParameters
  615. expReturns
  616. findExamples
  617. Example
  618. Title
  619. exampleHilite
  620. expReturns
  621. expParameters
  622. false
  623. expDescription
  624. false
  625. :,expSyntax
  626. false
  627. trim()
  628. ?    setDrive
  629. lastP
  630. firstP
  631. expDescription 
  632. resetFieldSizes
  633. expandDescription
  634. buttonUp
  635. buttonUp
  636. expDescription
  637. resetFieldSizes
  638. expandDescription
  639. Description
  640. Description
  641. expDescription 
  642. resetFieldSizes
  643. expandDescription
  644. default
  645. buttonUp
  646. buttonUp
  647. expDescription
  648. resetFieldSizes
  649. expandDescription
  650. default
  651. dummy
  652. Title
  653. Subtitle
  654. Syntax
  655. Description
  656. Parameters
  657. Returns
  658. Syntax
  659. Parameters
  660. Returns
  661. buttonUp
  662. buttonUp
  663. Go Back
  664. Example
  665. "Example" 
  666. exampleHilite 
  667. buttonUp
  668. buttonUp
  669. Example
  670. exampleHilite
  671. exampleHilite
  672. Example
  673. Example
  674. Example
  675. Example
  676. "subtitle")
  677. default
  678. buttonUp
  679. buttonUp
  680. subtitle
  681. default
  682. Function List For This DLL
  683. buttonUp
  684. buttonUp
  685. first
  686. Main List
  687. Previous
  688. buttonUp
  689. buttonUp
  690. previous
  691. buttonUp
  692. buttonUp
  693. Returns
  694. )('';
  695. expReturns 
  696. resetFieldSizes
  697. expandReturns
  698. default
  699. buttonUp
  700. buttonUp
  701. expReturns
  702. resetFieldSizes
  703. fexpandReturns
  704. default
  705. Parameters
  706. expParameters 
  707. resetFieldSizes
  708. expandParameters
  709. default
  710. buttonUp
  711. buttonUp
  712. expParameters
  713. resetFieldSizes
  714. expandParameters
  715. default
  716. "Help" 
  717. buttonUp
  718. buttonUp
  719. Example
  720. buttonUp
  721. buttonUp
  722. Example
  723. Example
  724. buttonUp
  725. buttonUp
  726. Example
  727. How to use the DLL Help function description pages:
  728.     Use the arrow buttons to navigate from function to function in alphabetical order.
  729.     Click Example to see one or more examples of usage of the function.  The Example button remains hidden if there is no example.
  730.     If there is more text in a field than you can read comfortably, click the name of the field to expand it.  When a field is expanded, its name is highlighted.  Click the field name again to return it to its normal size, or click another field name to expand that other field.  Field sizes are reset automatically when you go to another page.
  731.     Click Main List for the list of all functions, or Function List For This DLL for a list of all the functions that are available in the same DLL as the function described on this page. The function list for the DLL also contains a short description of the DLL organization and usage.
  732.   Use the command "Copy LinkDLL Statement" in the edit menu to copy the linkDLL statement for the function on this page onto the clipboard.  You will then be able to paste it into a ToolBook script and avoid retyping errors.
  733. Syntax
  734. expSyntax 
  735. resetFieldSizes
  736. expandSyntax
  737. default
  738. buttonUp
  739. buttonUp
  740. expSyntax
  741. resetFieldSizes
  742. 9expandSyntax
  743. default
  744. false
  745. TBK-COMM.DLL
  746. openComPort
  747. DLL descriptions
  748. rectory
  749. ofirstP 
  750. olastP 
  751. "Help" 
  752. 4s_interest
  753. "Function List"
  754. L > 0 
  755. znothing
  756. |Info" 
  757. default
  758. B"Previous" 
  759. B"Next" 
  760. Lmax 
  761. cL = 0 
  762. i <= LMax
  763. L > 0 
  764. "Intro 
  765. Pages"
  766. leavePage
  767. buttonDown
  768. enterbackground
  769. buttonDoubleClick
  770. enterpage
  771. import
  772. enterbackground
  773. firstP
  774. lastP
  775. leavePage
  776. buttonDown
  777. Function List
  778. textFromPoint
  779. button
  780. Function Info
  781. s_interest
  782. buttonDoubleClick
  783. buttonUp
  784. Function Info
  785. s_interest
  786. enterpage
  787. Function Info
  788. Previous
  789. firstP
  790. lastP
  791. Function List
  792. Function List
  793. Intro text
  794. default
  795. s_interest
  796. import
  797. Function Pages
  798. !import
  799. lastP
  800. firstP
  801. Function List
  802. Function:    Summary::
  803. Function Info
  804. -- assumes that 
  805. will only be able 
  806. -- the function list 
  807. Hclicking 
  808. 4s_interest
  809.      <> 
  810. default
  811. buttonUp
  812. buttonUp
  813. default
  814. s_interest
  815. Info on Selected Function
  816. "Help" 
  817. buttonUp
  818. buttonUp
  819. Intro Text
  820. Title
  821. Subtitle
  822. buttonUp
  823. buttonUp
  824. Go Back
  825. buttonUp
  826. buttonUp
  827. first
  828. Main List
  829. Previous
  830. buttonUp
  831. buttonUp
  832. previous
  833. buttonUp
  834. buttonUp
  835. Function info
  836. buttonUp
  837. buttonDown
  838. buttonUp
  839. enterpage
  840. buttonDown
  841. Example
  842. How to use the DLL Description pages
  843.     Use the arrow buttons to navigate from DLL to DLL in alphabetical order.
  844.     Click Main List for the list of all functions, or click a function name then Info on Selected Function to go to the details page for that function.  You can also double-click a function name for the same result.
  845. Using DLL functions
  846.    Before you can call the functions in a DLL from a script, you must first link the DLL to ToolBook and declare the functions you want to use with the linkDLL control structure. 
  847.    For details, see Appendix B, "Using DLLs with ToolBook," in the Using OpenScript manual.eset automatically when you go to another page.
  848. .  Field sizes are reset automatically when you go to another page.
  849. on described on this page. The function list for the DLL also contains a short description of the DLL organization and usage.
  850.      usage.
  851.      and usage.
  852. flushComRxBuffer
  853. Function Pages
  854. flushComRxBuffer
  855. exampleHilite
  856. flushComRxBuffer    
  857. TBK-COMM.DLL
  858. flushComRxBuffer(<COM number>)5
  859. Flushes out any characters in the receive buffer for a COM port.  The characters are lost.
  860. To declare this function, include the following statement in the linkDLL control structure:
  861. INT flushComRxBuffer(WORD)
  862. <COM number> is the number of the COM port you want to check, such as 1 for COM1, 2 for COM2, etc.  The maximum allowable value is 4.
  863. 0 if failed, a positive number if successful.
  864. get flushComRxBuffer(1) -- Flush receive queue of COM1K
  865.     INT flushComRxBuffer(WORD)
  866. Main List
  867. z) > 1
  868. 4s_interest
  869. "Main List"
  870. L > 0 
  871. -- ignore
  872. "DLL Info" 
  873. "Function 
  874. Lmax 
  875. cL = 0 
  876. i <= LMax
  877. L > 0 
  878. default
  879. Pages"
  880. kground
  881. buttonDown
  882. buttonDoubleClick
  883. enterbackground
  884. enterpage
  885. import
  886. enterbackground
  887. go back
  888. buttonDown
  889. Main List
  890. textFromPoint
  891. button
  892. DLL Info
  893. Function Info
  894. s_interest
  895. buttonDoubleClick
  896. buttonUp
  897. Function Info
  898. s_interest
  899. enterpage
  900. Main List
  901. Main List
  902. DLL Info
  903. Function Info
  904. default
  905. s_interest
  906. import
  907. Function Pages
  908. !import
  909. go back
  910. buttonUp
  911. buttonUp
  912. Go Back
  913. Main List
  914. Main List
  915. closeComPort    TBK-COMM.DLL
  916. flushComRxBuffer    TBK-COMM.DLL
  917. flushComTxBuffer    TBK-COMM.DLL
  918. isComRxReady    TBK-COMM.DLL
  919. isComTxReady    TBK-COMM.DLL
  920. openComPort    TBK-COMM.DLL
  921. readComPort    TBK-COMM.DLL
  922. setComPort    TBK-COMM.DLL
  923. writeComPort    TBK-COMM.DLL
  924. This book documents all the functions contained in the DLLs shipped with ToolBook, version 1.0.
  925. ToolBook DLL Function Reference
  926. 4s_interest
  927. buttonUp
  928. buttonUp
  929. s_interest
  930. Info on Selected DLL
  931. Function Info
  932. 4s_interest
  933. buttonUp
  934. buttonUp
  935. s_interest
  936. Info on Selected Function
  937. "help"
  938. buttonUp
  939. buttonUp
  940. Version
  941.  Copyright 
  942.  Asymetrix Corporation 1989 -- Version 1.0on 1.0
  943. /"function 
  944. buttonUp
  945. buttonUp
  946. function pages
  947. Browse All Functions
  948. DLL info
  949. Function info
  950. buttonUp
  951. buttonDown
  952. buttonUp
  953. enterpage
  954. buttonDown
  955. To use this book:
  956. Click on the name of a function to select it, then click one of the buttons on the right for details about the function or details about the DLL in which it is available.  You can also double-click a function name to go to that function directly.
  957. To use DLL functions:
  958. You must have "linked in" the function before you can call it in your script.  To link in a function, use a statement in the following form:
  959.     linkDLL <DLL file name>
  960.         <return type> <function name>(<parameter1>, <parameter 2>....)
  961.     end linkDLL
  962. Example:
  963.     linkDLL "DOSDLL.DLL"
  964.         INT fileExists(STRING)
  965.     end linkDLL
  966. If you make any mistake in the linkDLL statement, it may lead to a system crash when the function is called.  For more information, see the OpenScript documentation.
  967. )18\4
  968. /"DLL Descriptions"
  969. buttonUp
  970. buttonUp
  971. DLL Descriptions
  972. Browse DLL Descriptions
  973. flushComTxBuffer
  974.   Importing into the "Function by function" background
  975. Import is from an ASCII file, where records and fields are identified by a specific tag at the beginning of the line:
  976. "?" for function name
  977.  "!" for syntax
  978. "#" for description
  979. ";" for parameters
  980. ":" for what the function returns
  981. "$" for example
  982. Each of the above "fields" can contain empty lines and line breaks.
  983. The tag can be inserted as "invisible" style characters in a Microsoft word file.  The easiest way to do this is to make them glossary entries and insert it into the file.
  984. Sorting must be done manually after the import is complete.  Be sure to check the "Example" field of the last imported field for garbage before you sort.
  985. C.O. 12/14/89null then
  986.                 set Title to theLine
  987.             else
  988.                 set Title to Title & CRLF & theLine
  989.             end if
  990.         end if
  991.         if isSyntax and theLine <> "Syntax"
  992.             if Syntax is null then
  993.                 set Syntax to theLine
  994.             else
  995.                 set Syntax to Syntax & CRLF & theLine
  996.             end if
  997.         end if
  998.         if isDescr and theLine <> "Description"
  999.             if Descr is null then
  1000.                 set Descr to theLine
  1001.             else
  1002.                 set Descr to Descr & CRLF & theLine
  1003.             end if
  1004.         end if
  1005.         if isParameters and theLine <> "Parameters" then
  1006.             if Parameters is null then
  1007.                 set Parameters to theLine
  1008.             else
  1009.                 set Parameters to Parameters & CRLF & theLine
  1010.             end if
  1011.         end if
  1012.         if isTReturns and theLine <> "Returns" then
  1013.             if TReturns is null then
  1014.                 set TReturns to theLine
  1015.             else
  1016.                 set TReturns to TReturns & CRLF & theLine
  1017.             end if
  1018.         end if
  1019.         if isExample and theLine <> "Example" and \
  1020.             theLine <> "Examples" then
  1021.             if Example is null then
  1022.                 set Example to theLine
  1023.             else
  1024.                 set Example to Example & CRLF & theLine
  1025.             end if
  1026.         end if
  1027. Parameters is null then
  1028.                 set Parameters to theLine
  1029.             else
  1030.                 set Parameters to Parameters & CRLF & theLine
  1031.             end if
  1032.         end if
  1033.         if isTReturns and theLine <> "Returns" then
  1034.             if TReturns is null then
  1035.                 set TReturns to theLine
  1036.             else
  1037.                 set TReturns to TReturns & CRLF & theLine
  1038.             end if
  1039.         end if
  1040.         if isExample and theLine <> "Example" and \
  1041.             theLine <> "Examples" then
  1042.             if Example is null then
  1043.                 set Example to theLine
  1044.             else
  1045.                 set Example to Example & CRLF & theLine
  1046.             end if
  1047.         end if
  1048.      end if
  1049.         end if
  1050.         if isParameters and theLine <> "Parameters" then
  1051.             if Parameters is null then
  1052.                 set Parameters to theLine
  1053.             else
  1054.                 set Parameters to Parameters & CRLF & theLine
  1055.             end if
  1056.         end if
  1057.         if isTReturns and theLine <> "Returns" then
  1058.             if TReturns is null then
  1059.                 set TReturns to theLine
  1060.             else
  1061.                 set TReturns to TReturns & CRLF & theLine
  1062.             end if
  1063.         end if
  1064.         if isExample and theLine <> "Example" and \
  1065.             theLine <> "Examples" then
  1066.             if Example is null then
  1067.                 set Example to theLine
  1068.             else
  1069.                 set Example to Example & CRLF & theLine
  1070.             end if
  1071.         end if
  1072.                 set Syntax to Syntax & CRLF & theLine
  1073.             end if
  1074.         end if
  1075.         if isDescr and theLine <> "Description"
  1076.             if Descr is null then
  1077.                 set Descr to theLine
  1078.             else
  1079.                 set Descr to Descr & CRLF & theLine
  1080.             end if
  1081.         end if
  1082.         if isParameters and theLine <> "Parameters" then
  1083.             if Parameters is null then
  1084.                 set Parameters to theLine
  1085.             else
  1086.                 set Parameters to Parameters & CRLF & theLine
  1087.             end if
  1088.         end if
  1089.         if isTReturns and theLine <> "Returns" then
  1090.             if TReturns is null then
  1091.                 set TReturns to theLine
  1092.             else
  1093.                 set TReturns to TReturns & CRLF & theLine
  1094.             end if
  1095.         end if
  1096.         if isExample and theLine <> "Example" and \
  1097.             theLine <> "Examples" then
  1098.             if Example is null then
  1099.                 set Example to theLine
  1100.             else
  1101.                 set Example to Example & CRLF & theLine
  1102.             end if
  1103.         end if
  1104.         end if
  1105. buttonUp
  1106. buttonUp
  1107. Go Back
  1108. ImportFListHelp
  1109. flushComTxBuffer
  1110. flushComTxBuffer    
  1111. TBK-COMM.DLL
  1112. flushComTxBuffer(<COM number>)
  1113. Flushes out any characters in the transmit buffer for a COM port.  The characters are lost.
  1114. To declare this function, include the following statement in the linkDLL control structure:
  1115. INT flushComTxBuffer(WORD)
  1116. <COM number>is the number of the COM port you want to check, such as 1 for COM1, 2 for COM2, etc.  The maximum allowable value is 4.
  1117. 0 if failed, a positive number if successful.
  1118. get flushComTxBuffer(1) -- Flush transmit queue of COM1
  1119. exampleHilite
  1120. ImportFListHelp
  1121. readComPort
  1122. getDBFieldType
  1123. setCurrentDirectory
  1124. checkDBIndex
  1125. getDriveList
  1126. selectDBFile
  1127. setDBFieldTag
  1128. Main List
  1129. Main List
  1130. closeComPort    TBK-COMM.DLL
  1131. flushComRxBuffer    TBK-COMM.DLL
  1132. flushComTxBuffer    TBK-COMM.DLL
  1133. isComRxReady    TBK-COMM.DLL
  1134. isComTxReady    TBK-COMM.DLL
  1135. openComPort    TBK-COMM.DLL
  1136. readComPort    TBK-COMM.DLL
  1137. setComPort    TBK-COMM.DLL
  1138. writeComPort    TBK-COMM.DLL
  1139. This book documents all the functions contained in the TBK-COMM DLL.  
  1140. This library is not shipped with ToolBook 1.0 and is not supported as part of ToolBook.
  1141. ToolBook TBK-COMM.DLL Function Reference
  1142. 4s_interest
  1143. buttonUp
  1144. buttonUp
  1145. s_interest
  1146. Info on Selected DLL
  1147. Function Info
  1148. 4s_interest
  1149. buttonUp
  1150. buttonUp
  1151. s_interest
  1152. Info on Selected Function
  1153. "help"
  1154. buttonUp
  1155. buttonUp
  1156. Version
  1157.  Copyright 
  1158.  Asymetrix Corporation 1989 -- Version 1.0on 1.0
  1159. /"function 
  1160. buttonUp
  1161. buttonUp
  1162. function pages
  1163. Browse All Functions
  1164. DLL info
  1165. Function info
  1166. )18\4
  1167. /"DLL Descriptions"
  1168. buttonUp
  1169. buttonUp
  1170. DLL Descriptions
  1171. Browse DLL Descriptions
  1172. buttonUp
  1173. buttonDown
  1174. buttonUp
  1175. enterpage
  1176. buttonDown
  1177. To use this book:
  1178. Click on the name of a function to select it, then click one of the buttons on the right for details about the function or details about the DLL in which it is available.  You can also double-click a function name to go to that function directly.
  1179. To use DLL functions:
  1180. You must have "linked in" the function before you can call it in your script.  To link in a function, use a statement in the following form:
  1181.     linkDLL <DLL file name>
  1182.         <return type> <function name>(<parameter1>, <parameter 2>....)
  1183.     end linkDLL
  1184. Example:
  1185.     linkDLL "TBKFILE.DLL"
  1186.         INT fileExists(STRING)
  1187.     end linkDLL
  1188. If you make any mistake in the linkDLL statement, it may lead to a system crash when the function is called.  For more information, see the OpenScript documentation.  You can use the Copy LinkDLL Statement command in the Clipboard menu to put the statement onto the clipboard, from which you can paste it without errors into your script.
  1189.