home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / share / os2 / varios / hyperacc / haos2d.z / API_REF.TXT next >
Encoding:
Text File  |  1996-06-24  |  275.7 KB  |  6,232 lines

  1. HyperACCESS Application Programming Interface (HAPI) Manual (disk
  2. version) Copyright 1995, Hilgraeve, Inc.
  3. _________________________________________________________________
  4. (The best way to view API_REF.TXT in OS/2 Enhanced Editor, Windows 
  5. Notepad, or Windows WordPad is to turn on Word Wrap. The best way 
  6. to print API_REF.TXT is to open this a word processor, select the 
  7. entire file, and format the text in 10 point Courier before printing.)
  8.  
  9. __________________________________________________________________
  10.  
  11. Introduction
  12.  
  13. This disk copy of the HyperACCESS Application Programming
  14. Interface (HAPI) Manual provides information for programmers who
  15. want to take advantage of powerful customization and programming
  16. features available with HyperACCESS.  The HyperACCESS User's
  17. Manual contains information required by everyday users of
  18. HyperACCESS.  The printed copy of this manual contains additional
  19. information for both novice and advanced programmers.  It is
  20. available from Hilgraeve for $20 U.S.  Call 1-800-826-2760 to
  21. order your copy.
  22.  
  23.  
  24. About This Manual
  25.  
  26. This manual provides a common source of application programming 
  27. information for HyperACCESS for OS/2 (HA/OS2),  HyperACCESS for 
  28. Windows 95 (HA/Win95), and HyperACCESS for Windows 3.1 (HA/Win). 
  29. HAPI maintains cross-platform compatiblity among these systems so that 
  30. you can create one application program that will run in any of these 
  31. environments. When a function isn't applicable to a particular environment, 
  32. it is either a no-op (no operation), or has a reasonable default behavior. 
  33. Differences between environments are noted where appropriate.
  34.  
  35. In this manual you will see how to use HyperACCESS's automation tools. 
  36. You'll find:
  37.  
  38.     - Benefits of an external API and automatic program generation 
  39.              using a standard programming language.
  40.     - Program requirements.
  41.     - Programming examples using C, REXX, and other languages.
  42.     - Complete reference for HAPI.
  43.     - A brief tutorial on the C language.
  44.  
  45.  
  46. This introduction continues with overview information about
  47. programming in HyperACCESS.  The printed version of this manual
  48. includes the following chapters and appendices:
  49.  
  50. Chapter 1, Creating and Editing Programs, provides a brief
  51.             overview of tools available within HyperACCESS, and
  52.             HyperACCESS's program requirements.
  53. Chapter 2, Using External Languages, includes a description of
  54.             external programming requirements for HyperACCESS, and how to
  55.             use HAPI.
  56. Chapter 3, Examples, includes simple procedural operations
  57.             using internal or external C language programs, REXX, and
  58.             Visual Basic.
  59. Chapter 4, API Reference, provides a complete reference to
  60.             HAPI.
  61. Appendix A, C Language Tutorial, provides a simple tutorial
  62.             for users interested in learning C language programming as
  63.             it's used in HyperACCESS.
  64. Appendix B, Built-in C Language Interpreter, lists exclusions
  65.             from standard C for programs that will use the built-in C
  66.             language interpreter found in HyperACCESS for Windows. It also
  67.             includes a complete operator precedence table.
  68.  
  69.  
  70. Manual Conventions
  71.  
  72.             This manual uses a mix of terminology from HAOS2 and HAWin. In
  73.             particular, we use the terms panels and phonebook entries from
  74.             HAOS2 instead of windows and sessions from HAWin. There are
  75.             technical differences between the multiple document interface
  76.             (MDI) windows used in HAWin and panels use in HAOS2. The most
  77.             important distinction is that HAWin permits access to multiple
  78.             remote systems (sessions) from within one executing instance
  79.             of the program, while HAOS2 can connect to only one remote
  80.             system per executing instance of the program.
  81.  
  82.             To maintain backward compatibility with HAWin, the term
  83.             session continues to appear in the context of connections to
  84.             remote systems. In HAOS2, there is only one "session" per
  85.             executing instance of the program, while an HAWin program
  86.             instance could have multiple concurrent session windows
  87.             communicating at one time. Whenever a function refers to a
  88.             session window, the HAOS2 analog is the Terminal panel.
  89.  
  90.  
  91. Text Conventions
  92.  
  93.             This manual uses a few special symbols and conventions. Words
  94.             and characters shown as ALL CAPITALS in courier font are
  95.             directory or file names. For example, \HAOS2 is a directory
  96.             name; MYPROG.C is a filename. Specific programming language
  97.             statements and examples also appear in courier font in mixed
  98.             case.
  99.  
  100.             This manual uses the C language mixed case conventions, and
  101.             most examples appear in C. Even though reserved words and
  102.             functions in REXX programs generally appear in upper case, you
  103.             can type HAPI functions in mixed case or all upper case if you
  104.             use the definition files included with HyperACCESS.
  105.  
  106.             Words and characters in bold in a san-serif font indicate
  107.             anything you must type exactly as it appears. For example,
  108.             COM1 specifies that you should type the bold characters
  109.             exactly as shown. Bold is also used to identify command
  110.             buttons or key words and phrases found in dialog boxes. For
  111.             example, "click the Settings... button." names of HAPI
  112.             functions or variables also appear in bold in a san-serif
  113.             font. For example, haInitialize is the name of a function used
  114.             extensively. In some cases, words and characters in bold also
  115.             indicate emphasis.
  116.  
  117.             Words and characters in italics indicate a new term. An
  118.             explanation generally follows the italicized term. Italics
  119.             also indicate references to specific chapter or section
  120.             titles.
  121.  
  122.             In a few places, you'll see mnemonic command letters used in
  123.             menus and dialog boxes (e.g., F for File menu). These appear
  124.             in bold with an underline to be consistent with the screen
  125.             displays.
  126.  
  127.  
  128. Hilgraeve Customer Support
  129.  
  130.             If you have a question about HyperACCESS and can't find the
  131.             answer in this manual, the User's Manual, or in the
  132.             HyperACCESS Help system, you can reach us by:
  133.             
  134.             
  135.             Hilgraeve BBS
  136.             
  137.             Call the Hilgraeve BBS at (313) 243-5915 and send a message to
  138.             our Customer Support staff. For your convenience, the
  139.             HyperACCESS Phonebook already contains the Hilgraeve BBS
  140.             telephone number and correct settings, and Chapter 2 of the
  141.             User's Manual explains what you can expect to see in Placing
  142.             Your First Call on page 2-13. We will try to respond to you on
  143.             the BBS within one business day, so you can call back at your
  144.             convenience to get the answer. Asking questions on our BBS is
  145.             easy and confidential - messages exchanged with our Customer
  146.             Support staff are private and never seen by other callers.
  147.             
  148.             
  149.             CompuServe
  150.             
  151.             If you prefer, you can reach Hilgraeve Customer Support
  152.             through CompuServe. Use the GO HILGRAEVE command. You'll be
  153.             sent to the PC Vendor F forum. Then look for the Hilgraeve
  154.             section. Send us a message in the category of your choice.
  155.             
  156.             
  157.             Internet
  158.             
  159.             To send mail to Hilgraeve Customer Support via the Internet,
  160.             use the address:
  161.             custsupt@hilgraeve.com
  162.  
  163.             or for access via the World Wide Web use:
  164.             //http://www.hilgraeve.com
  165.             
  166.             
  167.             Telephone Support
  168.             
  169.             If you need answers quickly, or simply prefer talking to
  170.             humans, call (313) 243-0576, between 9:00 am and 6:00 pm
  171.             Eastern Time. Our Customer Support staff will give you the
  172.             advice you need to get the most from HyperACCESS. Before you
  173.             call, please register your copy of HyperACCESS by returning
  174.             the Registration Card or by calling the Hilgraeve BBS.
  175.  
  176.             We suggest that you try to duplicate the problem, and as you
  177.             do so, write down each step as well as any error messages you
  178.             see. So that we can provide you with the best possible
  179.             customer support, we recommend that you be at your computer
  180.             when you call, and try to have the following available:
  181.               - HyperACCESS Application Programming Interface Manual (this
  182.                 manual).
  183.               - The version and serial number on your HyperACCESS disk
  184.                 label.
  185.               - The operating system version number.
  186.               - Computer information - including type and model of
  187.                 computer, monitor, and video card. Amount and type of
  188.                 installed memory are also important.
  189.  
  190.             Hilgraeve Inc.
  191.             Genesis Centre
  192.             111 Conant Avenue, Suite A
  193.             Monroe, MI 48161
  194.             (313) 243-0576
  195.             FAX (313) 243-0645
  196.             BBS (313) 243-5915 (8N1 ANSI)
  197.             Internet: custsupt@hilgraeve.com
  198.             WWW: //http://www.hilgraeve.com
  199.             
  200.  
  201.  
  202. API Programming Requirements
  203.  
  204.             This section describes those rules and conventions that you
  205.             must follow regardless of programming language. Although the
  206.             examples use C language constructs, you must execute similar
  207.             statements in whatever language you're using. You'll find
  208.             language-dependent requirements in Chapter 2, Using External
  209.             Languages.
  210.  
  211.             HAPI functions are available through a Dynamic Link Library
  212.             (DLL). You can call functions in this DLL from any programming
  213.             environment that can call standard DLLs. HAPI functions use
  214.             standard calling conventions, and you can link them with an
  215.             import library or load them dynamically.
  216.  
  217.  
  218. Script Handles
  219.  
  220.             Every external program that accesses HyperACCESS must call the
  221.             function haInitialize. This function returns a script handle.
  222.             Script handles maintain the connection between HyperACCESS and
  223.             the program communicating with it.
  224.  
  225.             The script handle is a numeric value that's meaningful to HAPI
  226.             functions, and your program must keep it available for use by
  227.             HAPI functions. All other HAPI function calls you make must
  228.             pass a script handle as an argument. A script handle is like a
  229.             confirmation number for a hotel. The sequence of numbers you
  230.             receive has no meaning in and of itself. However, that number
  231.             lets the hotel quickly and easily access your reservation.
  232.  
  233.             Script handles provide a similar service for your program and
  234.             its connections to HyperACCESS. Since a program can have more
  235.             than one connection, the script handle lets HyperACCESS know
  236.             which connection you're referring to.
  237.  
  238.             Most programs have a single connection, or script handle,
  239.             associated with a single open session. More advanced
  240.             applications may require multiple connections to a session
  241.             and/or connection to multiple sessions. The discussions that
  242.             follow assume the simple, single script handle case.
  243.  
  244.             To coordinate operation between sessions and external
  245.             programs, haInitialize blocks sessions from receiving
  246.             characters from the communications driver until one of the
  247.             HAPI functions processes incoming data. This is required
  248.             because it's impossible to write a reliable script unless it
  249.             has access to all data received.
  250.  
  251.             By blocking incoming data, haInitialize ensures that your
  252.             program has access to every received character. You accomplish
  253.             this by calling one of the HAPI functions that looks at
  254.             received data. Only a few HAPI functions actually process
  255.             incoming characters. For example, haGetInput, haWaitForPrompt,
  256.             and haWaitForString all process incoming data, while
  257.             characters remain blocked if you call haBlockRemoteInput,
  258.             haGetConnectTime, haMenuString, and most other HAPI functions.
  259.             When HyperACCESS blocks a session, the driver continues to
  260.             accumulate characters in the communications buffer until
  261.             they're processed by the program, or the buffer fills. When
  262.             the buffer is full, normal flow control suspends character
  263.             transmission from the remote system.
  264.  
  265.             In programs generated by HyperACCESS, the statement:
  266.                     ScriptHandle = haInitialize(0,0,0,0);
  267.             uses the variable ScriptHandle to store the connection between
  268.             the external program and the session. It also blocks the
  269.             communications driver from releasing characters to the session
  270.             until they're released by other function calls. All subsequent
  271.             calls in the generated program use this variable as an
  272.             argument. For example, the following statement would send a
  273.             carriage return character to the session's remote system:
  274.                     haTypeText(ScriptHandle, 0, "\r");
  275.  
  276.           Note: \r represents the carriage return character in C.
  277.             
  278.             The following function would search for the character string
  279.             "ssword:", and release all characters to the Terminal panel
  280.             until that string is found:
  281.                     haWaitForPrompt(ScriptHandle, 1, "ssword:", 300L,
  282.                             100000L);
  283.  
  284.             In addition, it sets two timeout values: 300 msec. is the
  285.             pause that must be seen after the string is identified, and
  286.             100,000 msec (100 seconds) is the timeout value used to
  287.             indicate that the operation has failed if the string still
  288.             hasn't been seen.
  289.  
  290.            Note: The L in 300L and 100000L indicates a long integer in C.
  291.             
  292.  
  293.  
  294. Disconnecting an External Program from a Session
  295.  
  296.             You must always call the HAPI function haTerminate when your
  297.             external program has completed its operations. haTerminate
  298.             lets HAPI free any resources it may have allocated. It also
  299.             releases characters that your program didn't process from the
  300.             communications buffer. The function call looks like:
  301.                     haTerminate(ScriptHandle, 0);
  302.  
  303.            Caution: If you forget to call this function at the end of
  304.             your program, the session remains blocked and characters from
  305.             the remote system aren't processed.
  306.             
  307.  
  308.  
  309. REXX Programming Requirements in OS/2
  310.  
  311.             The REXX interpreter requires registration of external
  312.             functions before you call them. HAPI provides a simplified
  313.             technique for registering its functions. You register one
  314.             function, haLoadFuncs. Calling it registers all other HAPI
  315.             functions.
  316.  
  317.             In addition, you need to explicitly parse the command line for
  318.             any arguments. To accomplish these two functions, all OS/2
  319.             REXX programs should include the following statements:
  320.  
  321.             /* Parse the command line for arguments passed to this program */
  322.                          PARSE ARG pipename
  323.           
  324.                       /* Register external functions with REXX */
  325.                       CALL RxFuncAdd `haLoadFuncs', `HA_AUTO',`RxhaLoadFuncs'
  326.                       CALL haLoadFuncs
  327.  
  328.                       /* Establish a link between this script program and
  329.           HyperACCESS */
  330.                       scripthandle = haInitialize(1, pipename)
  331.                       DROP pipename
  332.  
  333.             At the end of the program, you should include the following
  334.             statements:
  335.                       /* Terminate link between HyperACCESS and script
  336.           program */
  337.                       CALL haTerminate scripthandle
  338.  
  339.                       DROP scripthandle
  340.  
  341.                       /* Remove HAPI functions from REXX registration */
  342.                       CALL haDropFuncs
  343.                       exit
  344.  
  345.  
  346. Standard Values and Return Codes
  347.  
  348.             All HAPI examples, supplied programs, and documentation use
  349.             names for parameter values and return codes. 
  350.  
  351.             HyperACCESS provides the file ha_auto.h for use with
  352.             external C language development systems. This file includes
  353.             prototypes of all HAPI functions with declarations for all
  354.             parameters. 
  355.  
  356.             Using ha_auto.h, you can use names instead of numbers as 
  357.             parameters to HAPI function calls. For example, if
  358.             you want to set the send transfer protocol to HyperProtocol
  359.             from your program, you could write:
  360.                     ReturnCode = haSetXferProtocol(ScriptHandle,
  361.                             HA_XFER_SEND, HA_HYPERP);
  362.  
  363.             Alternatively, since the value of both HA_XFER_SEND and
  364.             HA_HYPERP is 11, you could type:
  365.                     ReturnCode = haSetXferProtocol(ScriptHandle, 1, 1);
  366.  
  367.             The reason these two examples are the same is because of the
  368.             following two lines in ha_auto.h:
  369.                     #define HA_FER_SEND  1
  370.                      #define HA_HYPERP    1
  371.  
  372.             Programmers use this technique to make their programs more
  373.             readable.
  374.             
  375.             
  376.             C Programming in OS/2
  377.             
  378.             In OS/2, you must write your C programs from scratch. You can
  379.             easily convert learned REXX programs to C, but you need to
  380.             include the following statements for your program to compile
  381.             correctly:
  382.                  #include <os2.h>
  383.                   #include <ha_auto.h>
  384.             For more information about using compiling C language
  385.             programs, see Chapter 2, Using External Languages.
  386.             
  387.             
  388.             Error Code Values
  389.             
  390.             Most HAPI functions return an integer value and are declared
  391.             int or long. Functions that return a session or window handle
  392.             (i.e., they are declared HSESS, HWND, or SCRIPTHANDLE) return
  393.             a value of zero when they fail. Integer functions return a
  394.             value greater than or equal to zero if they're successful, and
  395.             a value less than zero (HA_ERR_OK) and greater than or equal
  396.             to HA_ERR_MAX_ERR if an error has occurred.
  397.  
  398.             Most integer functions return some standard error codes.
  399.             HA_ERR_BUSY, for example, indicates that you attempted to call
  400.             a function while another function call was active. Other error
  401.             codes provide information that's appropriate to only a few
  402.             functions. For example, functions that have a timeout value as
  403.             one of their arguments may return HA_ERR_TIMED_OUT.
  404.  
  405.             Whenever you call a HAPI function, you should check the return
  406.             code and perform appropriate error correction procedures. In
  407.             many cases, you'll simply report the error via haMessageBox
  408.             (or some similar API call available through your development
  409.             environment), call haTerminate, and then exit.
  410.  
  411.             For example, if your program calls haWaitForPrompt, you should
  412.             check for the possibility that a timeout occurred before the
  413.             string was detected. Your program code could look like:
  414.                     ReturnCode = haWaitForPrompt(ScriptHandle, 1,
  415.                             "r name: ", 300L, 100000L);
  416.                     if (ReturnCode == HA_ERR_TIMEOUT)
  417.                         {
  418.                         haTerminate(ScriptHandle, 0)
  419.                         exit();
  420.                         }
  421.                     . . .
  422.  
  423.             In this example, haWaitForPrompt will wait until it finds the
  424.             string "r name: " followed by a 300 millisecond pause. If it
  425.             doesn't find that string with the following pause within
  426.             100000 milliseconds (100 seconds), it returns the error code
  427.             HA_ERR_TIMEOUT. This error code is defined to be the value -6
  428.             in defines.h and ha_auto.h. Therefore the program segement
  429.             shown above could have been written as:
  430.                     ReturnCode = haWaitForPrompt(ScriptHandle, 1,
  431.                  "r name: ", 300L, 10000L);
  432.                     if (ReturnCode == -6)
  433.                         {
  434.                         haTerminate(ScriptHandle, 0)
  435.                         exit();
  436.                         }
  437.  
  438.             The following is a list of errors that HAPI may return.
  439.  
  440.                       Return   
  441. Return Code Name      Value    Description
  442. HA_ERR_BAD_CMD          -1       An API message was
  443.                              received with a
  444.                              command that could
  445.                              not be recognized.
  446. HA_ERR_BAD_PARAM        -2       A parameter was out
  447.                              of range or an
  448.                              unrecognized value.
  449. HA_ERR_BAD_HANDLE       -3       The script, session,
  450.                              or window handle was
  451.                              invalid.
  452. HA_ERR_BUFFER_TOO_SMALL -9       A function was passed
  453.                              a pointer to a buffer
  454.                              with a buffer size
  455.                              parameter that was
  456.                              too small to hold the
  457.                              data to be returned.
  458. HA_ERR_BUSY             -7       An attempt was made
  459.                              to call a function
  460.                              while another
  461.                              function call was
  462.                              active.
  463. HA_ERR_COMMAND_FAILED  -12       The function failed
  464.                              because it is
  465.                              unsupported in this
  466.                              version or for some
  467.                              other reason not
  468.                              enumerated in another
  469.                              error code.
  470. HA_ERR_CONNECTION_LOST  -8       A function waiting
  471.                              for some on-line
  472.                              event to occur (like
  473.                              haWaitForPrompt)
  474.                              failed because the
  475.                              connection was lost
  476.                              while waiting.
  477. HA_ERR_DDE_TIMED_OUT   -10       An internal timeout
  478.                              occurred in the code
  479.                              that communicates
  480.                              between the external
  481.                              process and HAWin.
  482. HA_ERR_MAX_ERR         -13       The most negative
  483.                              number used for an
  484.                              error code.
  485. HA_ERR_NOMORE          -13       FindNext function
  486.                              could match no
  487.                              further entries.
  488. HA_ERR_NO_MEMORY        -4       A function could not
  489.                              allocate memory to
  490.                              use to perform the
  491.                              specified task.
  492. HA_ERR_NO_SESSION       -5       A function could not
  493.                              complete the
  494.                              requested task
  495.                              because there was no
  496.                              session handle
  497.                              currently associated
  498.                              with the script
  499.                              handle.
  500. HA_ERR_NOT_SUPPORTED   -11       This function call or
  501.                              option requested
  502.                              isn't supported in
  503.                              this version of
  504.                              HyperACCESS. This
  505.                              return code may also
  506.                              indicate that the
  507.                              currently loaded COM
  508.                              or connection driver
  509.                              doesn't support the
  510.                              requested function or
  511.                              option.
  512. HA_ERR_OK                0       The function executed
  513.                              without error.
  514. HA_ERR_TIMED_OUT        -6       A function waiting
  515.                              for some set of
  516.                              conditions to be met
  517.                              exceeded its timeout
  518.                              duration.
  519.             
  520.             
  521. _______________________________
  522.   1.   You can find these values in ha_auto.h (OS/2) or defines.h.
  523.  
  524.  
  525.  
  526.  
  527. API Reference
  528.  
  529.  
  530.  
  531. Function Reference
  532.  
  533.  
  534.  
  535. Functions by group
  536.  
  537.             The following is a list of HyperACCESS Application Programming
  538.             Interface functions organized by category. These divisions are
  539.             somewhat arbitrary.
  540.             
  541.             
  542.             Connection Functions
  543.             
  544.             These functions let programs connect to and disconnect from
  545.             remote systems.
  546.               - haConnectAndDial
  547.               - haConnectSession
  548.               - haDisconnectSession
  549.               - haGetConnectionStatus
  550.               - haGetConnectTime
  551.               - haSkipConnection
  552.               - haWaitForConnection
  553.             
  554.             
  555.             Control Functions
  556.             
  557.             These functions provide critical HAPI operations, start
  558.             another external task, and let programs voluntarily give up
  559.             processor time.
  560.               - haInitialize
  561.               - haSleep
  562.               - haSpawn
  563.               - haTerminate
  564.               - haWait
  565.             
  566.             
  567.             Device-Specific Functions
  568.             
  569.             These functions deal mostly with external devices used for
  570.             communications.
  571.               - haComDriverSpecial
  572.               - haCreateConnection
  573.               - haDeleteConnection
  574.               - haFindComTypes
  575.               - haFindComTypeDevices
  576.               - haFindConnection
  577.               - haFindConnectionTypeDevices
  578.               - haFindConnectionTypes
  579.               - haGetBaudRate
  580.               - haGetConnectionDetails
  581.               - haGetCurrentConnection
  582.               - haGetDefaultConnection
  583.               - haGetDialingPrefix
  584.               - haGetPortMode
  585.               - haGetPortName
  586.               - haGetPortPrefs
  587.               - haGetPortType
  588.               - haGetRingsForAnswer
  589.               - haSelectDialingPrefix
  590.               - haSetBaudRate
  591.               - haSetConnectionDetails
  592.               - haSetCurrentConnection
  593.               - haSetDialingPrefix
  594.               - haSetPortMode
  595.               - haSetPortName
  596.               - haSetPortPrefs
  597.               - haSetPortType
  598.               - haSetPulseTone
  599.               - haSetRingsForAnswer
  600.             
  601.             
  602.             Drag and Drop Functions
  603.             
  604.             These functions are only valid in HyperACCESS for Windows.
  605.             They let an external API task respond to Drag and Drop
  606.             operations on the HyperACCESS session window. HyperACCESS
  607.             calls an external API task when a file or group of files is
  608.             dropped on an open session.
  609.               - haClearXferDropList
  610.               - haGetXferDropList
  611.               - haXferDropSend
  612.             
  613.             
  614.             External File Functions
  615.             
  616.             These functions record data in files. This does not include
  617.             data received during a file transfer.
  618.               - haCaptureBegin
  619.               - haCaptureControl
  620.               - haCaptureToPrinterBegin
  621.               - haCaptureToPrinterControl
  622.               - haGetCaptureFileName
  623.               - haGetLogFileName
  624.               - haGetPrinterStatus
  625.               - haSetCaptureFileName
  626.               - haSetLogFileName
  627.               - haSetLogonTask
  628.               - haWriteLogEntry
  629.             
  630.             
  631.             General Functions
  632.             
  633.             These functions perform general housekeeping tasks for an
  634.             external API task. They have very little to do with actual
  635.             communications.
  636.               - haGetNameString
  637.               - haGetSerNumString
  638.               - haGetVersion
  639.               - haSetNameString
  640.             
  641.             
  642.             GUI API-Related Functions
  643.             
  644.             These functions let you write an external API task that takes
  645.             advantage of some of the features of the operating system
  646.             graphical user interface without writing this code yourself.
  647.             The external API task can remain procedural in nature and
  648.             still be perceived as a non-procedural GUI program.
  649.               - haGetHWND
  650.               - haGetWindowStateBits
  651.               - haMenuString
  652.               - haMessageBox
  653.               - haNotifyOnTerminate
  654.               - haRestrictMenus
  655.               - haSetMessageTimer
  656.               - haSizeHyperACCESS
  657.               - haSizePhonebook
  658.               - haSizeSession
  659.             
  660.             
  661.             Learning Functions
  662.             
  663.             These functions let programs control recording of new keyboard
  664.             sequences.
  665.               - haGetLearnFileName
  666.               - haLearnControl
  667.               - haSetLearnFileName
  668.             
  669.             
  670.             Phonebook Functions
  671.             
  672.             These functions control which phonebook entry is in use.
  673.               - haGetDisplay
  674.               - haGetPhonebookEntry
  675.               - haReloadPhonebook
  676.               - haSavePhonebook
  677.               - haSetDisplay
  678.             
  679.             
  680.             REXX-Specific Functions
  681.             
  682.             These functions are valid for REXX OS/2 only. They provide
  683.             REXX-specific tools to facilitate programming with HAPI.
  684.               - haDropFuncs
  685.               - haGetConstantString
  686.               - haGetConstantValue
  687.               - haGetErrorString
  688.               - haLoadFuncs
  689.             
  690.             
  691.             Runtime Values Functions
  692.             
  693.             These functions let programs access and set
  694.               - haGetRuntimeValue
  695.               - haGetSessionDataString
  696.               - haSetRuntimeValue
  697.               - haSetSessionDataString
  698.             
  699.             
  700.             Session Manipulation Functions
  701.             
  702.             The term session is used for backward compatibility with
  703.             HyperACCESS for Windows (HAWin). In HAWin a session is the
  704.             main focus for communications, and one instance of HAWin can
  705.             have multiple sessions. These functions manipulate a session
  706.             handle, and let an external API identify a HyperACCESS
  707.             session. In HyperACCESS for OS/2 (HAOS2), there is only one
  708.             sesson per instance of HyperACCESS.
  709.               - haCloseSession
  710.               - haCreateNewSession
  711.               - haGetOpenSession
  712.               - haGetSession
  713.               - haGetSessionName
  714.               - haOpenSession
  715.               - haSetSession
  716.             
  717.             
  718.             Terminal-Specific Functions
  719.             
  720.             These functions control the local terminal display.
  721.               - haGetAsciiSettings
  722.               - haGetCursorPosition
  723.               - haGetEmulator
  724.               - haGetSelectedText
  725.               - haGetTextFromScreen
  726.               - haSetAsciiSettings
  727.               - haSetCursorPosition
  728.               - haSetEcho
  729.               - haSetEmulator
  730.               - haSetLocalDisplay
  731.               - haSetLocalEcho
  732.               - haSetStripTo7Bits
  733.             
  734.             
  735.             Text I/O Functions
  736.             
  737.             These functions let an external API task communicate with the
  738.             local user or remote system.
  739.               - haBlockRemoteInput
  740.               - haClearOutputBuffer
  741.               - haGetInput
  742.               - haReleaseRemoteInput
  743.               - haTypeLocalText
  744.               - haTypeText
  745.               - haWaitForActivity
  746.               - haWaitForLines
  747.               - haWaitForLull
  748.               - haWaitForOutputDone
  749.               - haWaitForPrompt
  750.               - haWaitForString
  751.             
  752.             
  753.             Transfer Functions
  754.             
  755.             These external API functions relate to transferring files.
  756.               - haClearXferSendList
  757.               - haGetXferDirectory
  758.               - haGetXferFinalStatus
  759.               - haGetXferParameters
  760.               - haGetXferProtocol
  761.               - haGetXferSendList
  762.               - haGetXferStatus
  763.               - haSetAdlOverride
  764.               - haSetXferDirectory
  765.               - haSetXferParameters
  766.               - haSetXferProtocol
  767.               - haTextSend
  768.               - haWaitForXfer
  769.               - haXferAddToSendList
  770.               - haXferReceive
  771.               - haXferSend
  772.               - haXferSendBatch
  773.               - haXferSendFromList
  774.               - haXferSendList
  775.  
  776.  
  777. Function Reference Format
  778.  
  779.             The following pages list the HyperACCESS Application
  780.             Programming Interface functions in alphabetical order. The
  781.             discussion of each function is divided into the following
  782.             sections:
  783.               - Description. A summary of the routine's effect immediately
  784.                 following the function name. (There is no sub-head for the
  785.                 description.)
  786.               - Syntax. Illustrates the syntax with definition of the
  787.                 function type and arguments. A summary list of arguments
  788.                 with their type immediately follows the syntax prototype.
  789.               - Arguments. A more complete description of the arguments
  790.                 and valid values.
  791.               - Remarks. A more detailed description of the routine and
  792.                 how it is used.
  793.               - Return Value. Describes values returned by the routine.
  794.               - See Also. Names related routines.
  795.               - Example. A short example in C that illustrates function
  796.                 use in context.
  797.  
  798.  
  799. Examples
  800.  
  801.             The examples that appear with function references are in C.
  802.             Modifying these examples for REXX or other programming
  803.             languages is straightforward. The examples assume following C
  804.             language variable definitions:
  805.                         long SESS;
  806.                         long bRate;
  807.                         long ScriptHandle = 0;
  808.                         long haTime;
  809.                         int ReturnCode;
  810.                         int SubReturnCode;
  811.                         char LogName[128];
  812.                         char Emulator[128];
  813.                         char RuntimeValue[128];
  814.                         char PNumber[128];
  815.                         char PType[128];
  816.                         char DName[128];
  817.                         char PortName[128];
  818.                         char DataBits[1];
  819.                         char StopBits[1];
  820.                         char Buffer[128];
  821.                         char Parity[128];
  822.                         char BPS[128];
  823.                         char FName[128];
  824.                         char Vers[128];
  825.                         char UName[128];
  826.                         char UID[128];
  827.                         char PWord[128];
  828.  
  829.  
  830. haBlockRemoteInput
  831.  
  832.             Increments the counter used to determine how and when a
  833.             session processes characters received from the remote system.
  834.             Syntax:
  835.                INT haBlockRemoteInput(ScriptHandle)
  836.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  837.             Arguments:
  838.                ScriptHandle
  839.                  The script handle returned from haInitialize.
  840.             Remarks:
  841.                When the counter is greater than zero, a session does not
  842.                process received characters. When the counter is zero, a
  843.                session processes characters. When a session is opened, the
  844.                counter is set to zero. If a program is run from within a
  845.                session, the counter is incremented automatically when the
  846.                program calls haInitialize. If the program exits from within
  847.                a session, the counter is decremented automatically when the
  848.                program calls haTerminate. This function would normally be
  849.                called only if you switch control to a new session using
  850.                haOpenSession or haSetSession, or when more than one program
  851.                is running in a session.
  852.             Return Value:
  853.                Returns 0 if successful. Otherwise, a standard API error
  854.                code.
  855.             See Also:
  856.                haReleaseRemoteInput
  857.  
  858.  
  859. haCaptureBegin
  860.  
  861.             Turns the Capture to File function on for the currently active
  862.             session.
  863.             Syntax:
  864.                INT haCaptureBegin(ScriptHandle, nMode, nAppend)
  865.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  866.                  INT nMode           Determines how data is captured
  867.                  INT nAppend         Determines what happens if capture
  868.                                       file already exists
  869.             Arguments:
  870.                ScriptHandle
  871.                  The script handle returned from haInitialize.
  872.                nMode
  873.                  This is a constant value that determines when capturing
  874.                  takes place and which data is captured.
  875.                  Value       Meaning
  876.                  HA_C_LINES  Capture each line from the terminal display
  877.                               as the cursor moves off the line.
  878.                  HA_C_CHAR   Capture each displayable character as it is
  879.                               displayed.
  880.                  HA_C_RAW    Capture all characters (printable and control
  881.                               codes) as they are received.
  882.                  HA_C_SCREEN Capture lines as they scroll off the screen
  883.                               and all lines on a screen when the screen is
  884.                               cleared. Captures exactly the same data as
  885.                               appears in the backscroll buffer.
  886.                nAppend
  887.                  This argument determines what happens if the file used
  888.                  for capturing already exists. (See Remarks for valid
  889.                  values for HAWin.)
  890.                  Value       Meaning
  891.                  HA_C_OVERWRITE   Overwrites the existing file.
  892.                  HA_C_APPEND Appends new captured data to end of file.
  893.                  HA_C_REN_SEQCreates a new file by adding a sequential
  894.                               number to the filename. If the name is
  895.                               already at its maximum length, the sequence
  896.                               number replaces characters at the end of the
  897.                               name.
  898.                  HA_C_REN_DATHyperACCESS creates filenames by appending
  899.                               the date/sequence to the original name. If
  900.                               appending the date/sequence creates a
  901.                               filename that is too long, HyperACCESS
  902.                               deletes the required number of characters
  903.                               from the end of the original name to fit the
  904.                               date/sequence.
  905.             Remarks:
  906.                This function behaves as if the user selected File/Capture
  907.                to File and completed the dialog.
  908.                In HyperACESS for Windows, nAppend is either TRUE (non-zero,
  909.                usually 1) or FALSE (zero). If TRUE any new captured data is
  910.                appended to the existing file. Otherwise, the previous file
  911.                is overwritten.
  912.             Return Value:
  913.                Returns 0 if successful. Otherwise, a standard API error
  914.                code.
  915.             See Also:
  916.                haCaptureControl, haGetCaptureFileName, haSetCaptureFileName
  917.             Example:
  918.             /* -----------------------------------------------------------
  919.   --------- */
  920.             /* Capture data to disk.
  921.               This program segment:
  922.                - Waits for prompt string ("Press Enter to begin...").
  923.                - Begins capturing all incoming data -- one line at a time
  924.   as the
  925.                  carriage return character is received.
  926.                - Appends incoming data to the end of the default capture
  927.   file
  928.                  if the file already exists.
  929.                - Stops capturing data when an end string appears ("End of
  930.   Data"). */
  931.             
  932.               ReturnCode = haWaitForPrompt(ScriptHandle, 1, "Press Enter
  933.   to begin...",
  934.                            300L, 60000L);
  935.               ReturnCode = haCaptureBegin(ScriptHandle, HA_C_LINES, TRUE);
  936.               ReturnCode = haWaitForString(ScriptHandle, 1, "End of Data",
  937.   100000L);
  938.               ReturnCode = haCaptureControl(ScriptHandle, HA_C_END);
  939.             
  940.             /* -----------------------------------------------------------
  941.   --------- */
  942.  
  943.  
  944. haCaptureControl
  945.  
  946.             Changes the way capturing operates after it has been started
  947.             by haCaptureBegin.
  948.             Syntax:
  949.                INT haCaptureControl(ScriptHandle, nFunction)
  950.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  951.                  INT nFunction       The function code
  952.             Arguments:
  953.                ScriptHandle
  954.                  The script handle returned from haInitialize.
  955.                nFunction
  956.                  The function code determines what change is to be made
  957.                  Value       Meaning
  958.                  HA_C_END    Terminate capturing and close the capture
  959.                               file.
  960.                  HA_C_PAUSE  Stop capturing temporarily.
  961.                  HA_C_RESUME Start capturing after a pause.
  962.             Remarks:
  963.                This function provides the same options available to the
  964.                user from the File/Capture to File cascade menu after
  965.                capture has been started.
  966.             Return Value:
  967.                Returns 0 if successful. Otherwise, a standard API error
  968.                code.
  969.             See Also:
  970.                haCaptureBegin
  971.  
  972.  
  973. haCaptureToPrinterBegin
  974.  
  975.             Turns the Capture to Printer function on for the currently
  976.             active session.
  977.             Syntax:
  978.                INT haCaptureToPrinterBegin(ScriptHandle, nMode, nMethod)
  979.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  980.                  INT nMode           Determines how data is captured
  981.                  INT nMethod         Determines when to release printed
  982.                                       information from the print spooler
  983.             Arguments:
  984.                ScriptHandle
  985.                  The script handle returned from haInitialize.
  986.                nMode
  987.                  This is a constant value that determines when printing
  988.                  takes place and which data is printed.
  989.                  Value       Meaning
  990.                  HA_CP_LINES Print each line from the terminal display as
  991.                               the cursor moves off the line.
  992.                  HA_CP_CHAR  Print each displayable character as it is
  993.                               displayed.
  994.                  HA_CP_SCREENPrint lines as they scroll off the screen and
  995.                               all lines on a screen when the screen is
  996.                               cleared. Prints exactly the same data as
  997.                               appears in the backscroll buffer.
  998.                nMethod
  999.                  This is a constant value that determines when data will
  1000.                  be released from the spooler to the printer.
  1001.                  Value       Meaning
  1002.                  HA_CP_PAGE  As each page is filled, it is released to the
  1003.                               printer.
  1004.                  HA_CP_SESSION    Printed data is accumulated in the
  1005.                               spooler until the session is closed or
  1006.                               Capture to Printer is turned off.
  1007.             Remarks:
  1008.                This function behaves as if the user selected File/Capture
  1009.                to Printer and completed the dialog.
  1010.             Return Value:
  1011.                Returns 0 if successful. Otherwise, a standard API error
  1012.                code.
  1013.             See Also:
  1014.                haCaptureToPrinterControl, haGetPrinterStatus
  1015.             Example:
  1016.             /* -----------------------------------------------------------
  1017.   --------- */
  1018.             
  1019.             /* Capturing data to printer
  1020.               This program segment:
  1021.                - Waits for prompt string ("Turn printer on and press Enter
  1022.   to
  1023.                  begin...") from the remote system.
  1024.                - Begins capturing all incoming data -- one line at a time
  1025.   as the
  1026.                  cursor moves off the line.
  1027.                - Releases each page to the printer as it fills.
  1028.                - Stops capturing data when an end string appears ("End of
  1029.   Data"). */
  1030.             
  1031.               ReturnCode = haWaitForPrompt(ScriptHandle, 1, "Turn printer
  1032.   on and press
  1033.                            Enter to begin...", 300L, 60000L);
  1034.               ReturnCode = haCaptureToPrinterBegin(ScriptHandle,
  1035.   HA_CP_LINES,
  1036.                            HA_CP_PAGE);
  1037.               ReturnCode = haWaitForString(ScriptHandle, 1, "End of Data",
  1038.   100000L);
  1039.               ReturnCode = haCaptureToPrinterControl(ScriptHandle,
  1040.   HA_CP_END);
  1041.             /* -----------------------------------------------------------
  1042.   --------- */
  1043.  
  1044.  
  1045. haCaptureToPrinterControl
  1046.  
  1047.             Changes the way capturing to printer operates after it has
  1048.             been started by the haCaptureToPrinterBegin.
  1049.             Syntax:
  1050.                INT haCaptureToPrinterControl(ScriptHandle, nFunction)
  1051.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1052.                  INT nFunction       The function code
  1053.             Arguments:
  1054.                ScriptHandle
  1055.                  The script handle returned from haInitialize.
  1056.                nFunction
  1057.                  The function code determines what change is to be made
  1058.                  Value       Meaning
  1059.                  HA_CP_END   Terminate printing and release data from the
  1060.                               spooler.
  1061.                  HA_CP_PAUSE Stop printing temporarily.
  1062.                  HA_CP_RESUMEStart printing after a pause.
  1063.             Remarks:
  1064.                This function provides the same options available to the
  1065.                user from the File/Capture to Printer cascade menu after
  1066.                printing has been started.
  1067.             Return Value:
  1068.                Returns 0 if successful. Otherwise, a standard API error
  1069.                code.
  1070.             See Also:
  1071.                haCaptureToPrinterBegin, haGetPrinterStatus
  1072.  
  1073.  
  1074. haClearOutputBuffer
  1075.  
  1076.             Clears the HyperACCESS output buffer of characters waiting to
  1077.             be sent.
  1078.             Syntax:
  1079.                INT haClearOutputBuffer(ScriptHandle)
  1080.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1081.             Arguments:
  1082.                ScriptHandle
  1083.                  The script handle returned from haInitialize.
  1084.             Remarks:
  1085.                You call this function when your program has already sent
  1086.                text data out the connected communications device and you
  1087.                want to cancel whatever portion of the data remains in the
  1088.                internal buffers. Depending on the type of communications
  1089.                device being used, there may be situations when HyperACCESS
  1090.                is unable to clear portions of the buffer.
  1091.             Return Value:
  1092.                Returns 0 if successful. Otherwise, a standard API error
  1093.                code.
  1094.             See Also:
  1095.                haTypeText, haWaitForOutputDone
  1096.  
  1097.  
  1098. haClearXferDropList
  1099.  
  1100.             Clears the internal list that keeps track of files that have
  1101.             been dropped on an open session.
  1102.             Syntax:
  1103.                INT haClearXferDropList(ScriptHandle)
  1104.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1105.             Arguments:
  1106.                ScriptHandle
  1107.                  The script handle returned from haInitialize.
  1108.             Remarks:
  1109.                This function lets you remove all files from the drop list.
  1110.                It may be desirable to do this when an error occurs during
  1111.                transfer of a dropped file, and you want the user to take
  1112.                corrective action.
  1113.             Return Value:
  1114.                Returns 0 if successful. Otherwise, a standard API error
  1115.                code.
  1116.             See Also:
  1117.                haGetXferDropList, haXferDropSend
  1118.  
  1119.  
  1120. haClearXferSendList
  1121.  
  1122.             Clears the internal list that keeps track of files that have
  1123.             been queued up to be sent to the remote system.
  1124.             Syntax:
  1125.                INT haClearXferSendList(ScriptHandle)
  1126.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1127.             Arguments:
  1128.                ScriptHandle
  1129.                  The script handle returned from haInitialize.
  1130.             Remarks:
  1131.                This function lets you remove all files from the send list.
  1132.                Under normal circumstances, the list clears automatically
  1133.                after files are sent by haXferSendFromList. You may find it
  1134.                desirable to call this function when an error occurs during
  1135.                transfer, and you want the user to take corrective action.
  1136.             Return Value:
  1137.                Returns 0 if successful. Otherwise, a standard API error
  1138.                code.
  1139.             See Also:
  1140.                haGetXferSendList, haXferAddToSendList, haXferSendFromList
  1141.  
  1142.  
  1143. haCloseSession
  1144.  
  1145.             In HAWin, closes the current session.
  1146.             Syntax:
  1147.                INT haCloseSession(ScriptHandle)
  1148.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1149.             Arguments:
  1150.                ScriptHandle
  1151.                  The script handle returned from haInitialize.
  1152.             Remarks:
  1153.                This function closes the session associated with the script
  1154.                handle. If the session is connected, it is disconnected
  1155.                before the session is closed. If there is no session
  1156.                associated with the script handle, an error is returned.
  1157.                In HAOS2, this function disconnects, if connected, and saves
  1158.                any changes made to the phonebook entry settings.
  1159.             Return Value:
  1160.                Returns 0 if successful. Otherwise, a standard API error
  1161.                code.
  1162.             See Also:
  1163.                haOpenSession
  1164.             Example:
  1165.             /* -----------------------------------------------------------
  1166.   --------- */
  1167.             
  1168.             /* Close an open session. */
  1169.             
  1170.               ReturnCode = haCloseSession(ScriptHandle);
  1171.             
  1172.             /* -----------------------------------------------------------
  1173.   --------- */
  1174.  
  1175.  
  1176. haComDriverSpecial
  1177.  
  1178.             Passes a device specific command string to the currently
  1179.             loaded communications driver.
  1180.             Syntax:
  1181.                INT haComDriverSpecial (ScriptHandle, pszCmd, nSize,
  1182.                pszResponse)
  1183.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1184.                  LPSTR pszCmd        The command string
  1185.                  INT nSize           The size of the following buffer.
  1186.                  LPSTR pszResponse   A buffer that receives the response
  1187.                                       from the communications driver.
  1188.             Arguments:
  1189.                ScriptHandle
  1190.                  The script handle returned from haInitialize.
  1191.                pszCmd
  1192.                  The command string that you want to pass to comm driver.
  1193.                  Depends on device.
  1194.                nSize
  1195.                  The size of the following buffer.
  1196.                pszResponse
  1197.                  A response string that may contain information in
  1198.                  response to the command.
  1199.             Remarks:
  1200.             This function is for advanced communications programming and
  1201.             is beyond the scope of this manual.
  1202.             Return Value:
  1203.                Returns 0 if successful. Otherwise, a standard API error
  1204.                code.
  1205.  
  1206.  
  1207. haConnectAndDial
  1208.  
  1209.             Starts the connection process and dials the supplied phone
  1210.             number rather than the phone number that is stored in the
  1211.             session settings file.
  1212.             Syntax:
  1213.                INT haConnectAndDial(ScriptHandle, nMode, pszNumber)
  1214.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1215.                  INT nMode           Determines how the session is to be
  1216.                                       connected
  1217.                  LPSTR pszNumber     The number to dial
  1218.             Arguments:
  1219.                ScriptHandle
  1220.                  The script handle returned from haInitialize.
  1221.                nMode
  1222.                  Determines what type of connection is to be initiated.
  1223.                  Value             Meaning
  1224.                  HA_CNCT_STANDARD   Do a normal connection sequence.
  1225.                  HA_CNCT_LEARN_LOGINStart learning a new login script
  1226.                                     after connection.
  1227.                  HA_CNCT_DO_NOT_LOGIN    Make the connection but do not
  1228.                                     run any login script or task
  1229.                                     associated with this session.
  1230.                pszNumber
  1231.                  A pointer to a null terminated string containing the
  1232.                  telephone number to be dialed.
  1233.             Remarks:
  1234.                This function is similar to the haConnectSession function
  1235.                except that it takes an additional parameter for an
  1236.                alternate phone number to be used in dialing. This phone
  1237.                number is dialed instead of the number stored in the session
  1238.                Communications dialog box.
  1239.             Return Value:
  1240.                Returns 0 if successful. Otherwise, a standard API error
  1241.                code.
  1242.             See Also:
  1243.                haDisconnectSession, haGetConnectionStatus, haOpenSession,
  1244.                haSetSession, haWaitForConnection
  1245.             Example:
  1246.             /* -----------------------------------------------------------
  1247.   --------- */
  1248.             
  1249.             /* Dial a remote system from within a script.
  1250.             This program segment:
  1251.                - Displays a message box to ask if user wants to change the
  1252.   phone number.
  1253.                - If yes, it displays another message box to get the new
  1254.   phone number.
  1255.                - Connects and dials using the new phone number or uses a
  1256.   standard
  1257.                  session connect if the user doesn't want to change the
  1258.   number.*/
  1259.             
  1260.             
  1261.             
  1262.               ReturnCode = haMessageBox(ScriptHandle, "HyperACCESS",
  1263.                            "Change Phone Number?", 0, 0, HA_MB_YN);
  1264.               if (ReturnCode == 1)
  1265.                {
  1266.                SubReturnCode = haMessageBox(ScriptHandle, "HAOS2 Query:",
  1267.                     "Enter Phone Number:", sizeof(PNumber), PNumber,
  1268.   HA_MB_OK);
  1269.                SubReturnCode = haConnectAndDial(ScriptHandle,
  1270.   HA_CNCT_STANDARD,
  1271.                            PNumber);
  1272.                }
  1273.               else if (ReturnCode == 0)
  1274.                SubReturnCode = haConnectSession(ScriptHandle,
  1275.   HA_CNCT_STANDARD);
  1276.             
  1277.             /* -----------------------------------------------------------
  1278.   --------- */
  1279.  
  1280.  
  1281. haConnectSession
  1282.  
  1283.             Starts the connection process within the current session.
  1284.             Syntax:
  1285.                INT haConnectSession(ScriptHandle, nMode)
  1286.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1287.                  INT nMode           Determines how the session is to be
  1288.                                       connected
  1289.             Arguments:
  1290.                ScriptHandle
  1291.                  The script handle returned from haInitialize.
  1292.                nMode
  1293.                  Determines what type of connection is to be initiated.
  1294.                  Value             Meaning
  1295.                  HA_CNCT_STANDARD   Do a normal connection sequence.
  1296.                  HA_CNCT_LEARN_LOGINStart learning a new login script
  1297.                                     after connection.
  1298.                  HA_CNCT_DO_NOT_DIALOpen the device but do not dial the
  1299.                                     associated phone number.
  1300.                  HA_CNCT_DO_NOT_LOGIN    Make the connection but do not
  1301.                                     run any login script or task
  1302.                                     associated with this session.
  1303.                  HA_CNCT_ANSWER_MODEConnect the session in standard answer
  1304.                                     mode. In this mode, the port will be
  1305.                                     surrended if another session attempts
  1306.                                     to connect using the same port.
  1307.                  HA_CNCT_ANSWER_HOLDConnect the session in answer and hold
  1308.                                     mode. In this mode, the port will not
  1309.                                     be surrendered if another session
  1310.                                     attempts to connect using the same
  1311.                                     port.
  1312.             Remarks:
  1313.                This function only starts the connection process. A
  1314.                connection process may have a number of steps and can take
  1315.                an extended period of time, depending on the process the
  1316.                device requires. You must use haWaitForConnection or
  1317.                haGetConnectionStatus to determine when it is OK to
  1318.                continue. A session cannot perform communications related
  1319.                functions unless it is connected.
  1320.             Return Value:
  1321.                Returns 0 if successful. Otherwise, a standard API error
  1322.                code.
  1323.             See Also:
  1324.                haDisconnectSession, haGetConnectionStatus, haOpenSession,
  1325.                haSetSession, haWaitForConnection
  1326.             Example:
  1327.             /* -----------------------------------------------------------
  1328.   --------- */
  1329.             
  1330.             /* Connect without dialing and transfer all typed characters
  1331.   to the modem. */
  1332.             
  1333.             /* This is often referred to as "Terminal Mode". */
  1334.             
  1335.             /*   This program segment:
  1336.                - Tells HyperACCESS not to call the remote system on
  1337.   connection.
  1338.                  The function haSkipConnection is required in case the
  1339.   program
  1340.                  is run as a preconnection program. Otherwise it is
  1341.   ignored.
  1342.                - Checks the current connection status, and if already
  1343.   connected
  1344.                  releases resources and returns control to HyperACCESS.
  1345.                - If not connected, request HyperACCESS to connect the
  1346.   session
  1347.                  (without dialing).
  1348.                - Don't wait for connection because there won't be one
  1349.   until the
  1350.                  user types commands at keyboard.
  1351.                - Release resources and return control to HyperACCESS. */
  1352.             
  1353.               ReturnCode = haSkipConnection(ScriptHandle);
  1354.               if (HA_CONNECTED == haGetConnectionStatus(ScriptHandle))
  1355.                ReturnCode = haTerminate(ScriptHandle, 0);
  1356.             
  1357.               ReturnCode = haConnectSession(ScriptHandle,
  1358.   HA_CNCT_DO_NOT_DIAL);
  1359.               ReturnCode = haTerminate(ScriptHandle, 0);
  1360.             
  1361.             /* -----------------------------------------------------------
  1362.   --------- */
  1363.  
  1364.  
  1365. haCreateConnection
  1366.  
  1367.             Creates a new connection combination.
  1368.             Syntax:
  1369.                HKCNCT haCreateConnection(ScriptHandle, pszDetails)
  1370.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1371.                  LPSTR pszDetails    A pointer to a buffer
  1372.             Arguments:
  1373.                ScriptHandle
  1374.                  The script handle returned from haInitialize.
  1375.                pszDetails
  1376.                  A null-terminated string containing the connection
  1377.                  details for the new connection.
  1378.             Remarks:
  1379.             See haGetConnectionDetails for the format of this string.
  1380.             This function is supported in HAOS2. For HAWin, use
  1381.             haSetPortPrefs.
  1382.             Return Value:
  1383.             Returns the connection key handle for the new connection if
  1384.             successful. Otherwise, zero.
  1385.             See also:
  1386.                haDeleteConnection, haFindComTypes, haFindConnection,
  1387.                haFindConnectionTypes, haFindConnectionTypeDevices,
  1388.                haGetConnectionDetails, haGetCurrentConnection,
  1389.                haGetDefaultConnection, haSetConnectionDetails,
  1390.                haSetCurrentConnection
  1391.  
  1392.  
  1393. haCreateNewSession
  1394.  
  1395.             Opens a new session and creates a new session file.
  1396.             Syntax:
  1397.                HSESS haCreateNewSession(ScriptHandle, pszName)
  1398.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1399.                  LPSTR pszName       The name used for the session
  1400.             Arguments:
  1401.                ScriptHandle
  1402.                  The script handle returned from haInitialize.
  1403.                pszName
  1404.                  The name of the new session. This is the name that shows
  1405.                  up in the title bar of the new session, as well as the
  1406.                  Phonebook. It is also used to generate the filename, the
  1407.                  first eight characters being used, with non alphanumeric
  1408.                  characters being replaced by an underscore.
  1409.             Remarks:
  1410.                The session is not connected when it is initially created.
  1411.                The newly created session becomes the current session for
  1412.                the script. A script can interact with several sessions
  1413.                simultaneously by storing the session handles in variables
  1414.                and using haSetSession to move among them.
  1415.                In HAOS2, this function fails if the current session is
  1416.                connected.
  1417.             Return Value:
  1418.                Returns a session handle if successful. Otherwise a standard
  1419.                API error code.
  1420.             See Also:
  1421.                haCloseSession, haConnectSession, haOpenSession
  1422.  
  1423.  
  1424. haDeleteConnection
  1425.  
  1426.             Deletes the connection from the list.
  1427.             Syntax:
  1428.                INT haDeleteConnection(ScriptHandle, hCnctKey)
  1429.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1430.                  HKCNCT hCnctKey     A connection key handle
  1431.             Arguments:
  1432.                ScriptHandle
  1433.                  The script handle returned from haInitialize.
  1434.                hCnctKey
  1435.                  A connection key handle returned from
  1436.                  haGetCurrentConnection, haGetDefaultConnection or
  1437.                  haCreateConnection.
  1438.             Remarks:
  1439.             This function is supported in HAOS2. There is no comparable
  1440.             function in HAWin.
  1441.             Return Value:
  1442.             Returns 0 if successful. Otherwise, a standard API error code.
  1443.             See also:
  1444.                haCreateConnection, haFindComTypes, haFindConnection,
  1445.                haFindConnectionTypes, haFindConnectionTypeDevices,
  1446.                haGetConnectionDetails, haGetCurrentConnection,
  1447.                haGetDefaultConnection, haSetConnectionDetails,
  1448.                haSetCurrentConnection
  1449.  
  1450.  
  1451. haDisconnectSession
  1452.  
  1453.             This function disconnects a session.
  1454.             Syntax:
  1455.                INT haDisconnectSession(ScriptHandle)
  1456.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1457.             Arguments:
  1458.                ScriptHandle
  1459.                  The script handle returned from haInitialize.
  1460.             Remarks:
  1461.                A session cannot perform communications related operations
  1462.                once it is disconnected.
  1463.             Return Value:
  1464.                Returns 0 if successful. Otherwise, a standard API error
  1465.                code.
  1466.             See Also:
  1467.                haConnectSession, haCloseSession, haGetConnectionStatus,
  1468.                haOpenSession
  1469.             Example:
  1470.             /* -----------------------------------------------------------
  1471.   --------- */
  1472.             
  1473.             /* Disconnecting from a remote system. */
  1474.             
  1475.               ReturnCode = haDisconnectSession(ScriptHandle);
  1476.             
  1477.             /* -----------------------------------------------------------
  1478.   --------- */
  1479.  
  1480.  
  1481. haDropFuncs
  1482.  
  1483.             Removes registration of all HyperACCESS API functions with
  1484.             REXX.
  1485.             Syntax:
  1486.                    haDropFuncs
  1487.             Remarks:
  1488.                Call this function when HyperACCESS API functions are no
  1489.                longer needed.  For simple scripts, this is usually at the
  1490.                end of your script. Valid for HAOS2 REXX programs only.
  1491.                If an API function has not been registered, haDropFuncs
  1492.                still gives a successful return code.
  1493.             Return Values:
  1494.                    Returns 0 if successful.  Otherwise, a standard API
  1495.                error code.
  1496.             See Also:
  1497.                    haLoadFuncs
  1498.             Example:
  1499.             /* -----------------------------------------------------------
  1500.   --------- */
  1501.             
  1502.             /* Remove registration of all API functions from Rexx. */
  1503.             
  1504.             CALL haDropFuncs
  1505.             
  1506.             /* -----------------------------------------------------------
  1507.   --------- */
  1508.  
  1509.  
  1510. haFindComTypes
  1511.  
  1512.             Enumerates a list of communication interface types compatible
  1513.             with a connection type.
  1514.             Syntax:
  1515.                INT haFindComTypes(ScriptHandle, nFindFlag, nSize,
  1516.                pszComType,
  1517.                               nCompatibility)
  1518.                  SCRIPTHANDLE ScriptHandleThe program - HAOS2 link
  1519.                  INT nFindFlag       Find first / find next flag
  1520.                  INT nSize           Size of the following buffer
  1521.                  LPSTR pszComType    A pointer to a buffer
  1522.                  INT nCompatibility  Compatibility flags.
  1523.             Arguments:
  1524.                ScriptHandle
  1525.                  The script handle returned from haInitialize.
  1526.                nFindFlag
  1527.                  Search flag:
  1528.                  Value       Meaning
  1529.                  HA_FINDFIRSTBegin searching.
  1530.                  HA_FINDNEXT Continue searching.
  1531.                nSize
  1532.                  The size of the following buffer.
  1533.                pszComType
  1534.                  A pointer to a buffer that will receive a null-terminated
  1535.                  string corresponding to a communication interface type.
  1536.                nCompatibility
  1537.                  An integer value returned from haFindConnectionTypes that
  1538.                  describes which communication interface types are
  1539.                  compatible with the connection type.
  1540.             Remarks:
  1541.             This function returns the list that appears in the Type of
  1542.             interface drop-down list in the Connect through dialog box.
  1543.             Pass the nCompatibility parameter from haFindConnectionTypes.
  1544.             This function is supported in HAOS2.
  1545.             Return Value:
  1546.             Returns 0 if successful, or HA_ERR_NOMORE if no other matches
  1547.             found. Otherwise, a standard API error code.
  1548.             See also:
  1549.                haCreateConnection, haDeleteConnection, haFindConnection,
  1550.                haFindConnectionTypes, haFindConnectionTypeDevices,
  1551.                haGetConnectionDetails, haGetCurrentConnection,
  1552.                haGetDefaultConnection, haSetConnectionDetails,
  1553.                haSetCurrentConnection
  1554.  
  1555.  
  1556. haFindConnection
  1557.  
  1558.             Enumerates a list of defined connections.
  1559.             Syntax:
  1560.                HKCNCT haFindConnection(ScriptHandle, nFindFlag)
  1561.                  SCRIPTHANDLE ScriptHandle     The program - HyperACCESS
  1562.                                       link
  1563.                  INT nFindFlag       Find first / find next flag
  1564.             Arguments:
  1565.                ScriptHandle
  1566.                  The script handle returned from haInitialize.
  1567.                nFindFlag
  1568.                  Search flag:
  1569.                  Value       Meaning
  1570.                  HA_FINDFIRSTBegin searching for connections.
  1571.                  HA_FINDNEXT Continue searching for connections.
  1572.             Remarks:
  1573.             This function returns the list that appears in the Existing
  1574.             Connections dialog box. Returns zero if no connections remain.
  1575.             This function is supported in HAOS2.
  1576.             Return Value:
  1577.             Returns a connection key handle if successful. Otherwise,
  1578.             zero.
  1579.             See also:
  1580.                haCreateConnection, haDeleteConnection, haFindComTypes,
  1581.                haFindConnectionTypes, haFindConnectionTypeDevices,
  1582.                haGetConnectionDetails, haGetCurrentConnection,
  1583.                haGetDefaultConnection, haSetConnectionDetails,
  1584.                haSetCurrentConnection
  1585.  
  1586.  
  1587. haFindConnectionTypeDevices
  1588.  
  1589.             Enumerates a list of devices recognized by a connection type.
  1590.             Syntax:
  1591.                INT haFindConnectionTypeDevices(ScriptHandle, nFindFlag,
  1592.                nSize, pszDevice)
  1593.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1594.                  INT nFindFlag       Find first / find next flag
  1595.                  INT nSize           Size of the following buffer
  1596.                  LPSTR pszDevice     A pointer to a buffer
  1597.             Arguments:
  1598.                ScriptHandle
  1599.                  The script handle returned from haInitialize.
  1600.                nFindFlag
  1601.                  Search flag:
  1602.                  Value       Meaning
  1603.                  HA_FINDFIRSTBegin searching for connection type devices.
  1604.                  HA_FINDNEXT Continue searching for connection type
  1605.                               devices.
  1606.                nSize
  1607.                  The size of the following buffer.
  1608.                pszDevice
  1609.                  A pointer to a buffer that will receive a null-terminated
  1610.                  string corresponding to a device.
  1611.             Remarks:
  1612.             This function returns the list that appears in the Connect
  1613.             Through dialog box. Returns zero if no connections remain.
  1614.             This function is supported in HAOS2.
  1615.             Return Value:
  1616.             Returns 0 if successful, or HA_ERR_NOMORE if no other entries
  1617.             are in the list. Otherwise, a standard API error code.
  1618.             See also:
  1619.                haCreateConnection, haDeleteConnection, haFindComTypes,
  1620.                haFindConnection, haFindConnectionTypes,
  1621.                haGetConnectionDetails, haGetCurrentConnection,
  1622.                haGetDefaultConnection, haSetConnectionDetails,
  1623.                haSetCurrentConnection
  1624.             Example:
  1625.             /* -----------------------------------------------------------
  1626.   --------- */
  1627.             
  1628.             /* Remove registration of all API functions from Rexx. */
  1629.             
  1630.             CALL haDropFuncs
  1631.             
  1632.             /* -----------------------------------------------------------
  1633.   --------- */
  1634.  
  1635.  
  1636. haFindConnectionTypes
  1637.  
  1638.             Enumerates a list of connection types.
  1639.             Syntax:
  1640.                INT haFindConnectionTypes(ScriptHandle, nFindFlag, nSize,
  1641.                pszCnctType,
  1642.                              pnCompatibility)
  1643.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1644.                  INT nFindFlag       Find first / find next flag
  1645.                  INT nSize           Size of the following buffer
  1646.                  LPSTR pszCnctType   A pointer to a buffer
  1647.                  INT *pnCompatibilityA pointer to an integer
  1648.             Arguments:
  1649.                ScriptHandle
  1650.                  The script handle returned from haInitialize.
  1651.                nFindFlag
  1652.                  Search flag:
  1653.                  Value       Meaning
  1654.                  HA_FINDFIRSTBegin searching for connection types.
  1655.                  HA_FINDNEXT Continue searching for connection types.
  1656.                nSize
  1657.                  The size of the following buffer.
  1658.                pszCnctType
  1659.                  A pointer to a buffer that receives a null-terminated
  1660.                  string corresponding to a connection type.
  1661.                pnCompatibility
  1662.                  A pointer to an integer that will contain compatibility
  1663.                  flags for use in haFindComTypes.
  1664.             Remarks:
  1665.             This function returns the list of available connection types
  1666.             that appears in the Type of New Connection dialog box. This
  1667.             function is supported in HAOS2.
  1668.             Return Value:
  1669.             Returns 0 if successful, or HA_ERR_NOMORE if no other entries
  1670.             are in the list. Otherwise, a standard API error code.
  1671.             See also:
  1672.                haCreateConnection, haDeleteConnection, haFindComTypes,
  1673.                haFindConnection, haFindConnectionTypeDevices,
  1674.                haGetConnectionDetails, haGetCurrentConnection,
  1675.                haGetDefaultConnection, haSetConnectionDetails,
  1676.                haSetCurrentConnection
  1677.             Example:
  1678.             /* -----------------------------------------------------------
  1679.   --------- */
  1680.             
  1681.             /*This program segment displays supported connection types and
  1682.              *list of modems.
  1683.              */
  1684.             
  1685.             int  returnvalue;
  1686.             int  nCompat;
  1687.             char szCnctType[200];
  1688.             char szModem[200];
  1689.             
  1690.             printf("The supported connection types are:\n");
  1691.             returnvalue = haFindConnectionTypes(scripthandle, 1, 200,
  1692.   szCnctType,
  1693.                        &nCompat);
  1694.             while (returnvalue == 0)
  1695.               {
  1696.               printf("%s\n", szCnctType);
  1697.               returnvalue = haFindConnectionTypes(scripthandle, 2, 200,
  1698.   szCnctType,
  1699.                &nCompat);
  1700.               }
  1701.             printf( "\nThe current list of modems is:\n");
  1702.             returnvalue = haFindConnectionTypeDevices(scripthandle, 1,
  1703.   200, szModem);
  1704.             while (returnvalue == 0)
  1705.               {
  1706.               printf ("%s\n", szModem);
  1707.               returnvalue = haFindConnectionTypeDevices(scripthandle, 2,
  1708.   200,
  1709.                  szModem);
  1710.               }
  1711.             /* -----------------------------------------------------------
  1712.   --------- */
  1713.  
  1714.  
  1715. haGetAsciiSettings
  1716.  
  1717.             Gets settings that are found in the ASCII Settings dialog box.
  1718.             Syntax:
  1719.                INT haGetAsciiSettings(ScriptHandle, nCount, pnData)
  1720.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1721.                  INT nCount          The number of integers that follow
  1722.                  INT FAR *pnData     A pointer to an array of integers
  1723.                                       (16 bit values)
  1724.             Arguments:
  1725.                ScriptHandle
  1726.                  The script handle returned from haInitialize.
  1727.                nCount
  1728.                  The number of integers in the array pointed to by pnData.
  1729.                pnData
  1730.                  A pointer to an array of integers that are used to get
  1731.                  the ASCII Settings. Each array element has a value that
  1732.                  can be indexed by the following constants:
  1733.                  Value       Meaning
  1734.                  HA_AI_FLAGS Various individual flags (bits), described
  1735.                               below.
  1736.                  HA_AI_WFCHARInput wait for character.
  1737.                  HA_AI_OTABS Output tab expansion value.
  1738.                  HA_AI_CWAIT Character delay value.
  1739.                  HA_AI_LWAIT Line delay value.
  1740.                  HA_AI_ITABS Input tab conversion value.
  1741.                  The following flags(bits) are used in the HA_AI_FLAGS
  1742.                  word to determine the state of individual check box
  1743.                  items:
  1744.                  Value       Meaning
  1745.                  HA_AFS_LF   Append LF to line ends sent.
  1746.                  HA_AFS_BLS  Expand blank lines sent to include a space.
  1747.                  HA_AFS_ECHO Echo typed characters locally.
  1748.                  HA_AFS_WAIT Enable wait for line end character.
  1749.                  HA_AFS_TABS Enable tab expansion for sent characters.
  1750.                  HA_AFR_LF   Append LF to received line ends.
  1751.                  HA_AFR_7BIT Force incoming characters to 7 bits.
  1752.                  HA_AFR_ECHO Echo received characters to sender.
  1753.                  HA_AFR_WRAP Wrap lines that exceed terminal width.
  1754.                  HA_AFR_HEX  Show hex value of non-printing characters.
  1755.             Remarks:
  1756.                The integer HA_AI_FLAGS has individual flags (bits) which
  1757.                are either TRUE (1) or FALSE (0). Determining the value of
  1758.                individual bits is language dependent operation. You can
  1759.                test the value of a particular bit by performing a bitwise
  1760.                AND operation of HA_AI_FLAGS with the desired flag name
  1761.                defined above.
  1762.             Return Value:
  1763.                Returns 0 if successful. Otherwise, a standard API error
  1764.                code.
  1765.             See Also:
  1766.                haSetAsciiSettings
  1767.  
  1768.  
  1769. haGetBaudRate
  1770.  
  1771.             Returns the baud rate of the currently open session if the
  1772.             port type in use supports baud rates.
  1773.             Syntax:
  1774.                LONG haGetBaudrate(ScriptHandle)
  1775.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1776.             Arguments:
  1777.                ScriptHandle
  1778.                  The script handle returned from haInitialize.
  1779.             Remarks:
  1780.                
  1781.             Return Value:
  1782.                Returns the baud rate if successful. Otherwise, a standard
  1783.                API error code.
  1784.             See Also:
  1785.                haSetBaudRate
  1786.  
  1787.  
  1788. haGetCaptureFileName
  1789.  
  1790.             Returns the name of the capture file for the currently active
  1791.             session.
  1792.             Syntax:
  1793.                INT haGetCaptureFileName(ScriptHandle, nSize, pszBuffer)
  1794.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1795.                  INT nSize           The size of the following buffer
  1796.                  LPSTR pszBuffer     A pointer to a buffer
  1797.             Arguments:
  1798.                ScriptHandle
  1799.                  The script handle returned from haInitialize.
  1800.                nSize
  1801.                  The size of the following buffer.
  1802.                pszBuffer
  1803.                  A pointer to a buffer that is to contain the filename.
  1804.             Remarks:
  1805.                The buffer should be large enough to accomodate a complete
  1806.                path and filename. If the buffer is too small, only as much
  1807.                of the name as will fit will be copied.
  1808.             Return Value:
  1809.                Returns 0 if successful. Otherwise, a standard API error
  1810.                code.
  1811.             See Also:
  1812.                haSetCaptureFileName
  1813.             Example:
  1814.             /* -----------------------------------------------------------
  1815.   --------- */
  1816.             
  1817.             /* Get the capture filename and let the user change it.
  1818.               This program segment:
  1819.                - Gets the capture filename.
  1820.                            - Uses a standard C function to write formatted
  1821.                          data to a string.
  1822.                - Displays the filename in a message box and asks if user
  1823.   wants to it.
  1824.                - If the user selects the Yes response, another message box
  1825.   request
  1826.                  a new filename.
  1827.                - If the user enters a new filename, it's saved as the
  1828.   default
  1829.                  capture file. */
  1830.             
  1831.               ReturnCode = haGetCaptureFileName(ScriptHandle,
  1832.   sizeof(FName), FName);
  1833.                         sprintf(Buffer, "Change Capture Filename: %s",
  1834.                          FName);
  1835.                         ReturnCode = haMessageBox(ScriptHandle,
  1836.                          "HyperACCESS", Buffer, 0, 0, HA_MB_YN);
  1837.               if (ReturnCode >= 0)
  1838.                {
  1839.                SubReturnCode = haMessageBox(ScriptHandle, "HyperACCESS",
  1840.                            "Enter new Capture File:", sizeof(FName),
  1841.   FName);
  1842.                SubReturnCode = haSetCaptureFileName(ScriptHandle, FName);
  1843.                }
  1844.             
  1845.             /* -----------------------------------------------------------
  1846.   --------- */
  1847.  
  1848.  
  1849. haGetConnectionDetails
  1850.  
  1851.             Returns specific information about a connection handle.
  1852.             Syntax:
  1853.                INT haGetConnectionDetails(ScriptHandle, hCnctKey, nSize,
  1854.                pszDetails)
  1855.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1856.                  HKCNCT hCnctKey     The connection key handle
  1857.                  INT nSize           The size of the following buffer
  1858.                  LPSTR pszDetails    A pointer to a buffer
  1859.             Arguments:
  1860.                ScriptHandle
  1861.                  The script handle returned from haInitialize.
  1862.                hCnctKey
  1863.                  A connection key handle returned from
  1864.                  haGetCurrentConnection, haGetDefaultConnection, or
  1865.                  haCreateConnection.
  1866.                nSize
  1867.                  The size of the following buffer.
  1868.                pszDetails
  1869.                  A pointer to the buffer that will receive a null-
  1870.                  terminated string containing the connection details
  1871.                  associated with the connection key handle.
  1872.                  The connection details string has the following fields:
  1873.                  Field       Description
  1874.                  Key         A numeric value that uniquely identifies the
  1875.                               connection.
  1876.                  Connection Type  Currently, the only valid connection
  1877.                               types are:
  1878.                               Direct Cable
  1879.                               Modem or Modem Pool
  1880.                               TCP/IP
  1881.                  Connection DeviceCurrently, one of the following:
  1882.                               A modem name for Modem or Modem Pool type.
  1883.                               blank for Direct Cable and TCP/IP types.
  1884.                  Interface Type Currently, one of the following:
  1885.                               For Modem or Modem Pool type:
  1886.                                    Standard Comm Port
  1887.                                    Shared Comm Port
  1888.                               For TCP/IP type:
  1889.                                    The TCP/IP stack installed (e.g., IBM
  1890.                               TCP/IP)
  1891.                               For Direct Cable:
  1892.                                    Blank
  1893. Communicat   For Modem or Modem Pool or
  1894. ions         Direct Cable, the
  1895. Device       communications port (e.g.,
  1896.             COM1, COM2, or a shared port
  1897.             name). Blank for TCP/IP.
  1898. Connection   The description of the
  1899. Descriptio   connection as shown to the user
  1900. n            (e.g., Hayes compatible high-
  1901.             speed, COM2).
  1902.                  Internal Data  For Modem or Modem Pool, the default baud
  1903.                               rate. For Direct Cable, 1 if hardware
  1904.                               handshaking on, 0 if off.
  1905.             Remarks:
  1906.             This function is supported in HAOS2.
  1907.             Return Value:
  1908.             Returns 0 if successful. Otherwise, a standard API error code.
  1909.             See also:
  1910.                haCreateConnection, haDeleteConnection, haFindComTypes,
  1911.                haFindConnection, haFindConnectionTypes,
  1912.                haFindConnectionTypeDevices, haGetCurrentConnection,
  1913.                haGetDefaultConnection, haSetConnectionDetails,
  1914.                haSetCurrentConnection
  1915.             Examples:
  1916.             13160933;Direct Cable;undefined;Standard Com Port;COM4;Direct
  1917.   Cable, COM4;1
  1918.             13025901;Modem or Modem Pool;Hayes compatible high-
  1919.                  speed;Standard Com Port;COM2;Hayes compatible high-speed,
  1920.                  COM2;19200
  1921.  
  1922.  
  1923. haGetConnectionStatus
  1924.  
  1925.             Returns the connection status of the currently active session.
  1926.             Syntax:
  1927.                INT haGetConnectionStatus(ScriptHandle)
  1928.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1929.             Arguments:
  1930.                ScriptHandle
  1931.                  The script handle returned from haInitialize.
  1932.             Remarks:
  1933.                
  1934.             Return Value:
  1935.                Returns one of the following connection status codes if OK.
  1936.                Otherwise, a standard API error code.
  1937.                  Value       Meaning
  1938.                  HA_NOTSTARTED    Connection sequence has not started.
  1939.                  HA_CONNECTEDSession is connected.
  1940.                  HA_DISCONNECTED  Session is disconnected.
  1941.                  HA_CONNECTING    Session is attempting to connect.
  1942.                  HA_DISCONNECTING Session is in the process of
  1943.                               disconnecting.
  1944.                  HA_WAITING  Session is in answer mode, waiting for a
  1945.                               call.
  1946.                  HA_SURRENDERED   Session is in answer mode, waiting for a
  1947.                               call, but has surrendered its port to another
  1948.                               session for an outgoing call.
  1949.             See Also:
  1950.                haConnectSession, haDisconnectSession
  1951.             Example:
  1952.             /* -----------------------------------------------------------
  1953.   --------- */
  1954.             
  1955.             /* Check the status of the current connection. If offline,
  1956.   make connection.
  1957.               This program segment:
  1958.                - Checks connection status.
  1959.                - If disconnected, performs a standard connection sequence.
  1960.                - Wait for connection.
  1961.                - If connected on entry or connected successfully display
  1962.   messge.
  1963.                - If connection fails for any reason, display message. */
  1964.             
  1965.               ReturnCode = haGetConnectionStatus(ScriptHandle);
  1966.               if (ReturnCode == HA_DISCONNECTED)
  1967.                {
  1968.                SubReturnCode = haConnectSession(ScriptHandle,
  1969.   HA_CNCT_STANDARD);
  1970.                if (SubReturnCode == 0)
  1971.                  SubReturnCode = haWaitForConnection(ScriptHandle,
  1972.   HA_CONNECTED,
  1973.                              60000L);
  1974.                if (SubReturnCode == 0)
  1975.                  ReturnCode = HA_CONNECTED
  1976.                }
  1977.               if (ReturnCode == HA_CONNECTED)
  1978.                haMessageBox(ScriptHandle, "HyperACCESS", "Online!",
  1979.   0,0,HA_MB_OK);
  1980.               else
  1981.                haMessageBox(ScriptHandle, "HyperACCESS", "Connection
  1982.   Failed!",
  1983.                            0,0,HA_MB_OK);
  1984.             
  1985.             /* -----------------------------------------------------------
  1986.   --------- */
  1987.  
  1988.  
  1989. haGetConnectTime
  1990.  
  1991.             Returns the number of seconds that the session has been
  1992.             connected.
  1993.             Syntax:
  1994.                LONG haGetConnectTime(ScriptHandle)
  1995.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  1996.             Arguments:
  1997.                ScriptHandle
  1998.                  The script handle returned from haInitialize.
  1999.             Remarks:
  2000.                If the session is not connected, zero is returned.
  2001.             Return Value:
  2002.                Returns the number of seconds that the session has been
  2003.                connected if successful. Otherwise, if the return value is a
  2004.                negative number, it is a standard API error code.
  2005.             See Also:
  2006.                haConnectSession, haDisconnectSession
  2007.  
  2008.  
  2009. haGetConstantString
  2010.  
  2011.             Returns a string representation of a return value from a
  2012.             HyperACCESS REXX API function.
  2013.             Syntax:
  2014.                    haGetConstantString(pszContext, nRetVal)
  2015.                  pszContext          The name of the function that
  2016.                                       returned the constant
  2017.                  nRetVal             The return value
  2018.             Arguments:
  2019.                    pszContext
  2020.                  The name of a Hilgraeve API function.  As of this
  2021.                  writing, the only function names recognized are
  2022.                  haGetConnectionStatus, haGetDisplay, haGetPrinterStatus,
  2023.                  and haGetXferFinalStatus.
  2024.                    nRetVal
  2025.                  The return value from one of the functions named above.
  2026.             Remarks:
  2027.                Use this function for debugging.  Rather than remember what
  2028.                each return code represents, use this function to convert
  2029.                the code to a more meaningful description, and use it in a
  2030.                debug message. Valid for HAOS2 REXX programs only.
  2031.             Return Values:
  2032.                Returns a string representing the return value.  If nRetVal
  2033.                is not a valid API return code, or pszContext is not one of
  2034.                the recognized functions, this function returns the value
  2035.                unchanged.
  2036.             Example:
  2037.             /* -----------------------------------------------------------
  2038.   --------- */
  2039.             
  2040.             /* Get the connection status, and display a debug message
  2041.   stating the
  2042.              * status returned.
  2043.              */
  2044.             
  2045.             returnvalue = haGetConnectionStatus(ScriptHandle)
  2046.             retstr = haGetConstantString('haGetConnectionStatus',
  2047.   returnvalue)
  2048.             SAY 'Connection status is' retstr
  2049.             /* -----------------------------------------------------------
  2050.   --------- */
  2051.  
  2052.  
  2053. haGetConstantValue
  2054.  
  2055.             Returns an integer value corresponding to a constant string
  2056.             returned by a HyperACCESS REXX API function.
  2057.             Syntax:
  2058.                    haGetConstantValue(pszConstString)
  2059.                  pszConstantString   A pre-defined Hilgraeve API constant
  2060.                                       string
  2061.             Arguments:
  2062.                    pszConstantString
  2063.                  A string representation of a Hilgraeve API constant.
  2064.                  This constant could be an argument to an API function,
  2065.                  such as HA_MB_YN in a call to haMessageBox, or a return
  2066.                  value from an API function, like HA_ERR_OK.
  2067.             Remarks:
  2068.                This function tests return values of API functions that
  2069.                return a state rather than an error or success code.  It
  2070.                helps write code that is self-documenting. Valid for HAOS2
  2071.                REXX programs only.
  2072.             Return Values:
  2073.                Returns an integer corresponding to the constant string
  2074.                passed in.  If pszConstString is not a valid API constant
  2075.                string, it is returned unchanged.
  2076.             Example:
  2077.             /* -----------------------------------------------------------
  2078.   --------- */
  2079.             
  2080.             /* Get the connection status.  Use haGetConstantValue to
  2081.   interpret the
  2082.              * return code.
  2083.              */
  2084.             
  2085.             returnvalue = haGetConnectionStatus(ScriptHandle)
  2086.             if returnvalue == haGetConstantValue('HA_CONNECTED') THEN
  2087.               DO
  2088.                CALL haTypeText ScriptHandle, 0, 'Hello, world!'
  2089.               END
  2090.             
  2091.             /* -----------------------------------------------------------
  2092.   --------- */
  2093.  
  2094.  
  2095. haGetCurrentConnection
  2096.  
  2097.             Returns the connection handle for the currently opened
  2098.             session.
  2099.             Syntax:
  2100.                HKCNCT haGetCurrentConnection(ScriptHandle)
  2101.                  SCRIPTHANDLE ScriptHandle   The program - HyperACCESS
  2102.                                       link
  2103.             Arguments:
  2104.                ScriptHandle
  2105.                  The script handle returned from haInitialize.
  2106.             Remarks:
  2107.             This function is supported in HAOS2.
  2108.             Return Value:
  2109.             Returns a connection key handle if successful. Otherwise,
  2110.             zero.
  2111.             See also:
  2112.                haCreateConnection, haDeleteConnection, haFindComTypes,
  2113.                haFindConnection, haFindConnectionTypes,
  2114.                haFindConnectionTypeDevices, haGetConnectionDetails,
  2115.                haGetDefaultConnection, haSetConnectionDetails,
  2116.                haSetCurrentConnection
  2117.  
  2118.  
  2119. haGetDefaultConnection
  2120.  
  2121.             Returns the default connection key.
  2122.             Syntax:
  2123.                HKCNCT haGetDefaultConnection(ScriptHandle)
  2124.                  SCRIPTHANDLE ScriptHandleThe program - HAOS2 link
  2125.             Arguments:
  2126.                ScriptHandle
  2127.                  The script handle returned from haInitialize.
  2128.             Remarks:
  2129.             This function is supported in HAOS2.
  2130.             Return Value:
  2131.             Returns the connection key handle used by the default
  2132.             phonebook entry.
  2133.             See also:
  2134.                haCreateConnection, haDeleteConnection, haFindComTypes,
  2135.                haFindConnection, haFindConnectionTypes,
  2136.                haFindConnectionTypeDevices, haGetConnectionDetails,
  2137.                haGetCurrentConnection, haSetConnectionDetails,
  2138.                haSetCurrentConnection
  2139.  
  2140.  
  2141. haGetDialingPrefix
  2142.  
  2143.             Returns one of the dialing prefixes defined in the program.
  2144.             Syntax:
  2145.                INT haGetDialingPrefix(ScriptHandle, nIndex, nSize,
  2146.                pszBuffer)
  2147.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2148.                  INT nIndex          Which prefix string
  2149.                  INT nSize           The size of the following buffer
  2150.                  LPSTR pszBuffer     A pointer to a buffer
  2151.             Arguments:
  2152.                ScriptHandle
  2153.                  The script handle returned from haInitialize.
  2154.                nIndex
  2155.                  This parameter determines which prefix string to return.
  2156.                  Valid numbers are 1 thru 10.
  2157.                nSize
  2158.                  The size of the following buffer.
  2159.                pszBuffer
  2160.                  A pointer to the buffer that is to receive the prefix
  2161.                  string.
  2162.             Remarks:
  2163.                There is only one set of ten dialing prefix strings that is
  2164.                shared by all sessions. Only the number of the prefix string
  2165.                being used for a session is stored in each session file.
  2166.             Return Value:
  2167.                Returns 0 if successful. Otherwise, a standard API error
  2168.                code.
  2169.             See Also:
  2170.                haSetDialingPrefix, haSelectDialingPrefix
  2171.             Example:
  2172.             /* -----------------------------------------------------------
  2173.   --------- */
  2174.             
  2175.             /* Let the user change the dialing prefix if necessary.
  2176.               This program segment:
  2177.                - Gets the first dialing prefix.
  2178.                            - Uses a standard C function to write formatted
  2179.                          data to a string.
  2180.                - Displays the current prefix in a message box and asks for
  2181.   Yes/No
  2182.                  response to question.
  2183.                - If response is Yes, asks user for new prefix.
  2184.                - Sets new prefix (for all phonebook entries). */
  2185.             
  2186.               ReturnCode = haGetDialingPrefix(ScriptHandle, 1,
  2187.   sizeof(PNumber),
  2188.                            PNumber);
  2189.                         sprintf(Buffer, "Is this string correct: %s",
  2190.                          PNumber);
  2191.               ReturnCode = haMessageBox(ScriptHandle, "HyperACCESS",
  2192.   Buffer, 0, 0,
  2193.                            HA_MB_YN);
  2194.               if (ReturnCode == 0)
  2195.                {
  2196.                ReturnCode = haMessageBox(ScriptHandle, "HyperACCESS",
  2197.                            "Enter new prefix:", sizeof(PNumber), PNumber);
  2198.                ReturnCode = haSetDialingPrefix(ScriptHandle, 1, PNumber);
  2199.                }
  2200.             
  2201.             /* -----------------------------------------------------------
  2202.   --------- */
  2203.  
  2204.  
  2205. haGetDisplay
  2206.  
  2207.             Returns a value indicating the type of view currently being
  2208.             displayed by the current phonebook.
  2209.             Syntax:
  2210.                INT haGetDisplay(ScriptHandle)
  2211.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2212.             Arguments:
  2213.                ScriptHandle
  2214.                  The script handle returned from haInitialize.
  2215.             Remarks:
  2216.                
  2217.             Return Value:
  2218.                Returns one of the following codes if successful. Otherwise,
  2219.                a standard API error code.
  2220.                  Value       Meaning
  2221.                  HA_ICONIC   The Phonebook is being displayed as icons.
  2222.                  HA_STATS    The Statistics view is being displayed in the
  2223.                               Phonebook.
  2224.                  HA_DETAILS  The Details view is being displayed in the
  2225.                               Phonebook.
  2226.                  HA_NAMES    The Phonebook is being displayed as system
  2227.                               names.
  2228.                  HA_FILES    The Phonebook is being displayed as
  2229.                               filenames.
  2230.             See Also:
  2231.                haSetDisplay
  2232.  
  2233.  
  2234. haGetEmulator
  2235.  
  2236.             Returns the name of the terminal emulator for the currently
  2237.             active session.
  2238.             Syntax:
  2239.                INT haGetEmulator(ScriptHandle, nSize, pszBuffer)
  2240.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2241.                  INT nSize           The size of the following buffer
  2242.                  LPSTR pszBuffer     A pointer to a buffer
  2243.             Arguments:
  2244.                ScriptHandle
  2245.                  The script handle returned from haInitialize.
  2246.                nSize
  2247.                  The size of the following buffer.
  2248.                pszBuffer
  2249.                  A pointer to a buffer that is to receive the emulator
  2250.                  name.
  2251.             Remarks:
  2252.                
  2253.             Return Value:
  2254.                Returns 0 if successful. Otherwise, a standard API error
  2255.                code.
  2256.             See Also:
  2257.                haSetEmulator
  2258.             Example:
  2259.             /* -----------------------------------------------------------
  2260.   --------- */
  2261.             
  2262.             /* Change the screen color regardless of terminal emulator in
  2263.   use.
  2264.               This program segment:
  2265.                - Gets the current terminal emulator.
  2266.                - Change the terminal emulator to ANSI so that local
  2267.   commands can
  2268.                  change screen color.
  2269.                - Type local text to change screen color to blue letters on
  2270.   white
  2271.                  background (see DOS help for ANSI.SYS).
  2272.                - Sets the terminal emulator back to its original type. */
  2273.             
  2274.               ReturnCode = haGetEmulator(ScriptHandle, sizeof(Emulator),
  2275.   Emulator);
  2276.               ReturnCode = haSetEmulator(ScriptHandle, "ANSI");
  2277.               ReturnCode = haTypeLocalText(ScriptHandle, "\x1b[37;44;1m");
  2278.               ReturnCode = haSetEmulator(ScriptHandle, Emulator);
  2279.             
  2280.             /* -----------------------------------------------------------
  2281.   --------- */
  2282.  
  2283.  
  2284. haGetErrorString
  2285.  
  2286.             Return a REXX string representing an error code.
  2287.             Syntax:
  2288.                    haGetErrorString(nErrorCode)
  2289.                  nErrorCode           An API error code
  2290.             Arguments:
  2291.                    nErrorCode
  2292.                          An error code returned from an API function.
  2293.             Remarks:
  2294.                Use this function for debugging REXX programs.  Rather than
  2295.                remember what each error code represents, use this function
  2296.                to convert the code to a more meaningful description, and
  2297.                use it in a debug message. Valid for HAOS2 REXX programs
  2298.                only.
  2299.             Return Values:
  2300.                Returns a string representing the error code.  If nErrorCode
  2301.                is not a valid API error code, it is returned unchanged.
  2302.             Example:
  2303.             /* -----------------------------------------------------------
  2304.   --------- */
  2305.             
  2306.             /* Wait for one of several prompts, with a debug message so
  2307.   you know
  2308.              * which prompt was matched.
  2309.              */
  2310.             
  2311.             prompts = 'Name:'||'00'x||'Rank:'||'00'x||'Serial
  2312.   Number:'||'00'x||'00'x
  2313.             returnvalue = haWaitForPrompt(ScriptHandle, 3, prompts, 300,
  2314.   10000)
  2315.             SAY 'returnvalue is' haGetErrorString(returnvalue)
  2316.             
  2317.             /* -----------------------------------------------------------
  2318.   --------- */
  2319.  
  2320.  
  2321. haGetHWND
  2322.  
  2323.             Returns the window handle created by haInitialize to
  2324.             synchronize message traffic between the external program and
  2325.             HyperACCESS.
  2326.             Syntax:
  2327.                HWND haGetHWND(ScriptHandle)
  2328.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link.
  2329.             Arguments:
  2330.                ScriptHandle
  2331.                  The ScriptHandle returned from haInitialize for
  2332.                  connection to the HyperACCESS window.
  2333.             Remarks:
  2334.                The window handle is used for message passing to and from
  2335.                HyperACCESS. These messages are synchronized automatically
  2336.                by API functions. Use this window handle with caution.
  2337.             Return Value:
  2338.                Returns a window handle if successful. Otherwise, zero.
  2339.  
  2340.  
  2341. haGetInput
  2342.  
  2343.             Gets data received from the remote system.
  2344.             Syntax:
  2345.                INT haGetInput(ScriptHandle, nMode, nCount, lStartTimeout,
  2346.                lCharTimeout, pszBuffer)
  2347.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2348.                  INT nMode           Additional processing options
  2349.                  INT nCount          The number of characters to wait for
  2350.                  LONG lStartTimeout  The timeout for the first character
  2351.                  LONG lCharTimeout   The intercharacter timeout
  2352.                  LPSTR pszBuffer     A pointer to a buffer
  2353.             Arguments:
  2354.                ScriptHandle
  2355.                  The script handle returned from haInitialize.
  2356.                nMode
  2357.                  Determines what, if any, extra processing of the input is
  2358.                  to be performed.
  2359.                  Value             Meaning
  2360.                  HA_GI_BACKSPACE    Process backspaces.
  2361.                  HA_GI_NOBACKSPACE  Do not process backspaces.
  2362.                nCount
  2363.                  The count determines the number of characters to wait
  2364.                  for. If the count is
  2365.                  (-1), wait for a carriage return.
  2366.                lStartTimeout
  2367.                  This timeout value, measured in milliseconds, determines
  2368.                  how long to wait for the first character before returning
  2369.                  to the caller. If this timeout is exceeded before any new
  2370.                  characters are received, the error code HA_ERR_TIMED_OUT
  2371.                  is returned.
  2372.                lCharTimeout
  2373.                  This timeout value, measured in milliseconds, determines
  2374.                  how long to wait between characters before returning to
  2375.                  the caller. If this timeout is exceeded, after at least
  2376.                  one character has been received, but before a new
  2377.                  character is received, the function returns the number of
  2378.                  characters already received. If the function returns
  2379.                  fewer characters than were requested, it is because an
  2380.                  intercharacter timeout occurred.
  2381.                pszBuffer
  2382.                  A pointer to a buffer to hold the acquired characters.
  2383.             Remarks:
  2384.                If nMode is HA_GI_NOBACKSPACE, backspace characters are
  2385.                stored in the buffer. If nMode is HA_GI_BACKSPACE, backspace
  2386.                characters are processed before the buffer is returned.
  2387.             Return Value:
  2388.                Returns the number of characters received if successful.
  2389.                Otherwise, a standard API error code.
  2390.             See Also:
  2391.                haWaitForPrompt, haWaitForString
  2392.             Example:
  2393.             /* -----------------------------------------------------------
  2394.   --------- */
  2395.             
  2396.             /* Prompt remote user for data, and respond.
  2397.               This program segment:
  2398.                - Sends text to remote system requesting input from remote
  2399.   user.
  2400.                - Gets input from communications port, but lets HyperACCESS
  2401.   process
  2402.                  any backspace characters. Waits 100 sec. for first
  2403.   character.
  2404.                  Waits 30 sec. between characters.
  2405.                - If remote user responds, formats response and types
  2406.   message to
  2407.                  remote user. */
  2408.             
  2409.               ReturnCode = haTypeText(ScriptHandle, 0, "Enter First Name:
  2410.   ");
  2411.               ReturnCode = haGetInput(ScriptHandle, HA_GI_BACKSPACE, -1,
  2412.   100000L,
  2413.                            30000L, FName);
  2414.               if (ReturnCode >= 0)
  2415.                {
  2416.                            sprintf(Buffer, "Welcome to the system, %s",
  2417.                          FName);
  2418.                            ReturnCode = haTypeText(ScriptHandle, 0,
  2419.                          Buffer);
  2420.                }
  2421.             
  2422.             /* -----------------------------------------------------------
  2423.   --------- */
  2424.  
  2425.  
  2426. haGetLearnFileName
  2427.  
  2428.             Returns the name of the learn file (script) for the currently
  2429.             active session.
  2430.             Syntax:
  2431.                INT haGetLearnFileName(ScriptHandle, nSize, pszBuffer)
  2432.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2433.                  INT nSize           The size of the following buffer
  2434.                  LPSTR pszBuffer     A pointer to a buffer
  2435.             Arguements:
  2436.                ScriptHandle
  2437.                  The script handle returned from haInitialize.
  2438.                nSize
  2439.                  The size of the following buffer.
  2440.                pszBuffer
  2441.                  A pointer to a buffer that is to contain the filename.
  2442.             Remarks:
  2443.                The buffer should be large enough to accomodate a complete
  2444.                path and filename. If the buffer is too small, only as much
  2445.                of the name as will fit will be copied.
  2446.             Return Value:
  2447.                Returns 0 if successful. Otherwise, a standard API error
  2448.                code.
  2449.             See Also:
  2450.                haSetLearnFileName, haGetCaptureFileName
  2451.  
  2452.  
  2453. haGetLogFileName
  2454.  
  2455.             Returns the name of the current log file.
  2456.             Syntax:
  2457.                INT haGetLogFileName(ScriptHandle, nSize, pszBuffer)
  2458.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2459.                  INT nSize           The size of the following buffer
  2460.                  LPSTR pszBuffer     A pointer to a buffer
  2461.             Arguments:
  2462.                ScriptHandle
  2463.                  The script handle returned from haInitialize.
  2464.                nSize
  2465.                  The size of the following buffer.
  2466.                pszBuffer
  2467.                  A pointer to the buffer that is to receive the log
  2468.                  filename.
  2469.             Remarks:
  2470.                The buffer should be large enough to accomodate a complete
  2471.                path and filename.
  2472.             Return Value:
  2473.                Returns 0 if successful. Otherwise, a standard API error
  2474.                code.
  2475.             See Also:
  2476.                haSetLogFileName
  2477.             Example:
  2478.             /* -----------------------------------------------------------
  2479.   --------- */
  2480.             
  2481.             /* Get the log filename and let the user change files if
  2482.   desired.
  2483.               This program segment:
  2484.                - Gets the log filename for the current session.
  2485.                            - Uses a standard C function to write formatted
  2486.                          data to a string.
  2487.                - Displays log filename in a message box and asks for
  2488.   Yes/No
  2489.                  response to question.
  2490.                - If response is Yes, asks user for new filename and sets
  2491.   new file. */
  2492.             
  2493.               ReturnCode = haGetLogFileName(ScriptHandle, 128, LogName);
  2494.                         sprintf(Buffer, "Change Log Filename: %s",
  2495.                          LogName);
  2496.                         ReturnCode = haMessageBox(ScriptHandle,
  2497.                          "HyperACCESS", Buffer, 0, 0, HA_MB_YN);
  2498.               if (ReturnCode == 0)
  2499.                {
  2500.                ReturnCode = haMessageBox(ScriptHandle, "HyperACCESS",
  2501.                            "Enter new Log File:", sizeof(LogName),
  2502.   LogName);
  2503.                ReturnCode = haSetLogFileName(ScriptHandle, LogName);
  2504.                }
  2505.             
  2506.             /* -----------------------------------------------------------
  2507.   --------- */
  2508.  
  2509.  
  2510. haGetNameString
  2511.  
  2512.             Returns the identification strings entered by the user during
  2513.             program installation.
  2514.             Syntax:
  2515.                INT haGetNameString(ScriptHandle, nSize, pszBuffer)
  2516.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2517.                  INT nSize           The size of the following buffer
  2518.                  LPSTR pszBuffer     A pointer to a buffer
  2519.             Arguments:
  2520.                ScriptHandle
  2521.                  The script handle returned from haInitialize.
  2522.                nSize
  2523.                  The size of the following buffer.
  2524.                pszBuffer
  2525.                  A pointer to the buffer that will receive the strings.
  2526.             Remarks:
  2527.                The user name data string gets set during program
  2528.                installation. This string consists of six lines in HAWin and
  2529.                seven lines in HAOS2. Each line is terminated with a
  2530.                carriage return, linefeed pair. Any of the strings may be
  2531.                blank, with only the terminating pair. The strings are name,
  2532.                company, street address, city, state, zip code, and country.
  2533.                HAWin Version 2.1 and prior don't support country.
  2534.             Return Value:
  2535.                Returns 0 if successful. Otherwise, a standard API error
  2536.                code.
  2537.             See Also:
  2538.                haSetNameString
  2539.  
  2540.  
  2541. haGetOpenSession
  2542.  
  2543.             Returns a session handle from the list of open sessions.
  2544.             Syntax:
  2545.                HSESS haGetOpenSession(ScriptHandle, nIndex)
  2546.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2547.                  INT nIndex          Which session handle to return
  2548.             Arguments:
  2549.                ScriptHandle
  2550.                  The script handle returned from haInitialize.
  2551.                nIndex
  2552.                  An index indicating which session handle from the list to
  2553.                  return. This index can range from 0 to n-1 where n is the
  2554.                  number of open sessions.
  2555.             Remarks:
  2556.                As sessions are opened, they are added to a list of open
  2557.                sessions within HyperACCESS. This function returns session
  2558.                handles from that list. In HAOS2, there is only one open
  2559.                session, so nIndex must be 0. Any other value is an error.
  2560.             Return Value:
  2561.                Returns a session handle if successful. Otherwise, zero.
  2562.             See Also:
  2563.                haGetPhonebookEntry, haGetSession, haOpenSession,
  2564.                haSetSession
  2565.  
  2566.  
  2567. haGetPhonebookEntry
  2568.  
  2569.             Returns the filename for an entry in the current phonebook.
  2570.             Syntax:
  2571.                INT haGetPhonebookEntry(ScriptHandle, nIndex, nSize,
  2572.                pszBuffer)
  2573.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2574.                  INT nIndex          Which entry in the phonebook
  2575.                  INT nSize           The size of the following buffer
  2576.                  LPSTR pszBuffer     A pointer to a buffer
  2577.             Arguments:
  2578.                ScriptHandle
  2579.                  The script handle returned from haInitialize.
  2580.                nIndex
  2581.                  The index into Phonebook that selects the session
  2582.                  filename desired.
  2583.                nSize
  2584.                  The size of the following buffer.
  2585.                pszBuffer
  2586.                  A pointer to a buffer that is to receive the filename.
  2587.             Remarks:
  2588.                The buffer should be large enough to accomodate a complete
  2589.                path and filename.
  2590.                Remember that the order of sessions in Phonebook can change
  2591.                depending on sorting type selected. An entry that was
  2592.                previously at one index may not be there at a later time.
  2593.             Return Value:
  2594.                Returns 0 if successful. Otherwise, a standard API error
  2595.                code.
  2596.             See Also:
  2597.                haGetOpenSession
  2598.             Example:
  2599.             /* -----------------------------------------------------------
  2600.   --------- */
  2601.             
  2602.             /* Open the first phonebook entry in the phonebook and connect
  2603.   to it.
  2604.               This program segment:
  2605.                - Gets the filename of the first phonebook entry.
  2606.                - Requests HyperACCESS to open and connect to it.
  2607.                  (Don't wait for connection to complete.) */
  2608.             
  2609.               ReturnCode = haGetPhonebookEntry(ScriptHandle, 1,
  2610.   sizeof(FName), FName);
  2611.               ReternCode = haOpenSession(ScriptHandle, FName);
  2612.               ReturnCode = haConnectSession(ScriptHandle,
  2613.   HA_CNCT_STANDARD);
  2614.             
  2615.             /* -----------------------------------------------------------
  2616.   --------- */
  2617.  
  2618.  
  2619. haGetPortMode
  2620.  
  2621.             Returns the current settings for the number of bits per
  2622.             character, the number of stop bits, and the parity type.
  2623.             Syntax:
  2624.                INT haGetPortMode(ScriptHandle)
  2625.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2626.             Arguments:
  2627.                ScriptHandle
  2628.                  The script handle returned from haInitialize.
  2629.             Remarks:
  2630.                The integer value returned has flags (bits) which are either
  2631.                TRUE (1) or
  2632.                FALSE (0). Determining the value of individual bits is
  2633.                language dependent operation. You can test the value of a
  2634.                particular bit by performing a bitwise AND operation of the
  2635.                returned value with the desired flag name defined below.
  2636.             Return Value:
  2637.                Returns a value that may be one or more of the following
  2638.                values ORed together if successful. Otherwise, a standard
  2639.                API error code.
  2640.                  Value       Meaning
  2641.                  HA_M_AUTO   Auto-detect is set.
  2642.                  HA_M_7_BITS Characters contain 7 bits.
  2643.                  HA_M_8_BITS Characters contain 8 bits.
  2644.                  HA_M_E_PRTY Characters have even parity.
  2645.                  HA_M_O_PRTY Characters have odd parity.
  2646.                  HA_M_N_PRTY Characters have no parity.
  2647.                  HA_M_M_PRTY Characters have mark parity.
  2648.                  HA_M_S_PRTY Characters have space parity.
  2649.                  HA_M_1_STOP Characters have one stop bit.
  2650.                  HA_M_1_5_STOP    Characters have 1.5 stop bits.
  2651.                  HA_M_2_STOP Characters have two stop bits.
  2652.             See Also:
  2653.                haSetPortMode
  2654.             Example:
  2655.             /* -----------------------------------------------------------
  2656.   --------- */
  2657.             /* Get and display all port mode settings.
  2658.                         This program segment:
  2659.                            - Gets the port mode.
  2660.                            - Uses HyperACCESS bit masks to determine
  2661.                          settings and translate
  2662.                              bit settings to understandable character
  2663.                          strings.
  2664.                            - Uses standard C functions to convert the baud
  2665.                          rate to a string
  2666.                              and write formatted data to a string.
  2667.                            - Displays the resulting string in a message
  2668.                          box. */
  2669.             
  2670.                         ReturnCode = haGetPortMode(ScriptHandle);
  2671.                         if (ReturnCode & HA_M_8_BIT)
  2672.                            strcpy(DataBits, "8");
  2673.                         if (ReturnCode & HA_M_7_BIT)
  2674.                            strcpy(DataBits, "7");
  2675.                         if (ReturnCode & HA_M_N_PRTY)
  2676.                            strcpy(Parity, "None");
  2677.                         if (ReturnCode & HA_M_O_PRTY)
  2678.                            strcpy(Parity, "Odd");
  2679.                         if (ReturnCode & HA_M_E_PRTY)
  2680.                            strcpy(Parity, "Even");
  2681.                         if (ReturnCode & HA_M_M_PRTY)
  2682.                            strcpy(Parity, "Mark");
  2683.                         if (ReturnCode & HA_M_S_PRTY)
  2684.                            strcpy(Parity, "Space");
  2685.                         if (ReturnCode & HA_M_1_STOP)
  2686.                            strcpy(StopBits, "1");
  2687.                         if (ReturnCode & HA_M_2_STOP)
  2688.                            strcpy(StopBits, "2");
  2689.             
  2690.                         sprintf(Buffer, "Port Mode: %s,%s,%s",
  2691.                          Parity,DataBits,StopBits);
  2692.             
  2693.                         ReturnCode = haMessageBox(ScriptHandle,
  2694.                          "Communications", Buffer, 0, 0, HA_MB_OK);
  2695.             
  2696.             /* -----------------------------------------------------------
  2697.   --------- */
  2698.  
  2699.  
  2700. haGetPortName
  2701.  
  2702.             Returns the name of the port for the currently active session.
  2703.             Syntax:
  2704.                INT haGetPortName(ScriptHandle, nSize, pszBuffer)
  2705.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2706.                  INT nSize           The size of the following buffer
  2707.                  LPSTR pszBuffer     A pointer to a buffer
  2708.             Arguments:
  2709.                ScriptHandle
  2710.                  The script handle returned from haInitialize.
  2711.                nSize
  2712.                  The size of the following buffer.
  2713.                pszBuffer
  2714.                  A pointer to the buffer that will receive the port name.
  2715.                  
  2716.             Remarks:
  2717.                A port is identified by a port type and a port name. The
  2718.                format and range of values of the port name depend on the
  2719.                port type selected. For example, if the port type is
  2720.                Standard Com Port, the port name will be COM1, COM2, etc. If
  2721.                the port type specifies a network connection, the port name
  2722.                might be a server name or a named network resource.
  2723.             Return Value:
  2724.                Returns 0 if successful. Otherwise, a standard API error
  2725.                code.
  2726.             Example:
  2727.                         ReturnCode = haGetPortName(ScriptHandle,
  2728.                          sizeof(PortName), PortName);
  2729.  
  2730.  
  2731. haGetPortPrefs
  2732.  
  2733.             Returns strings identifying the type and name of the port
  2734.             being used for communications. It also returns the name of the
  2735.             connection device (modem).
  2736.             Syntax:
  2737.                INT haGetPortPrefs(ScriptHandle, nSizeType, pszType,
  2738.                nSizeName, pszName, nSizeDevice, pszDevice)
  2739.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2740.                  INT nSizeType       The size of the type buffer
  2741.                  LPSTR pszType       A pointer to the type buffer
  2742.                  INT nSizeName       The size of the name buffer
  2743.                  LPSTR pszName       A pointer to the name buffer
  2744.                  INT nSizeDevice     The size of the device buffer
  2745.                  LPSTR pszDevice     A pointer to the device buffer
  2746.             Arguments:
  2747.                ScriptHandle
  2748.                  The script handle returned from haInitialize.
  2749.                nSizeType
  2750.                  The size of the type buffer.
  2751.                pszType
  2752.                  A pointer to a buffer that will receive the
  2753.                  communications port type.
  2754.                nSizeName
  2755.                  The size of the name buffer.
  2756.                pszName
  2757.                  A pointer to a buffer that will receive the
  2758.                  communications port name.
  2759.                nSizeDevice
  2760.                  The size of the device buffer.
  2761.                pszDevice
  2762.                  A pointer to a buffer that will receive the
  2763.                  communications port device.
  2764.             Remarks:
  2765.                The port type and port name values are stored per session in
  2766.                the session settings file. The name of the connection device
  2767.                (commonly a modem name) associated with each port applies to
  2768.                all sessions using that port.
  2769.             Return Value:
  2770.                Returns 0 if successful. Otherwise, a standard API error
  2771.                code.
  2772.             See Also:
  2773.                haGetPortName, haGetPortType, haSetPortPrefs
  2774.             Example:
  2775.             /* -----------------------------------------------------------
  2776.   --------- */
  2777.             
  2778.             /* Gather and display port information.
  2779.               This program segment:
  2780.                - Gets the port type, name, and device name.
  2781.                - Displays the resulting string in a message box. */
  2782.             
  2783.                         ReturnCode = haGetPortPrefs(ScriptHandle,
  2784.                          sizeof(PType), PType, sizeof(PortName), PortName,
  2785.                          sizeof(DName), DName);
  2786.                         sprintf(Buffer, "Port Info: %s:%s, %s", PType,
  2787.                          PortName, DName);
  2788.                         ReturnCode = haMessageBox(ScriptHandle,
  2789.                          "HyperACCESS", Buffer, 0, 0, HA_MB_OK);
  2790.             
  2791.             /* The function "haGetPortType" also gets port type, but none
  2792.   of the other
  2793.               information: */
  2794.               ReturnCode = haGetPortType(ScriptHandle, sizeof(PType),
  2795.   PType);
  2796.             
  2797.             /* -----------------------------------------------------------
  2798.   --------- */
  2799.  
  2800.  
  2801. haGetPortType
  2802.  
  2803.             Returns the type of communications port associated with the
  2804.             currently active session.
  2805.             Syntax:
  2806.                INT haGetPortType(ScriptHandle, nSize, pszBuffer)
  2807.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2808.                  INT nSize           The size of the following buffer
  2809.                  LPSTR pszBuffer     A pointer to a buffer
  2810.             Arguments:
  2811.                ScriptHandle
  2812.                  The script handle returned from haInitialize.
  2813.                nSIze
  2814.                  The size of the following buffer.
  2815.                pszBuffer
  2816.                  A pointer to a buffer that will receive the
  2817.                  communications port type.
  2818.             Remarks:
  2819.                A port type and name identify a port. For each port type
  2820.                supported, there is a driver file implemented as a DLL
  2821.                module with a name of the form HAC*.DLL. Adding driver
  2822.                modules adds port types. Removing driver modules removes the
  2823.                associated port type from the list of those available.
  2824.             Return Value:
  2825.                Returns 0 if successful. Otherwise, a standard API error
  2826.                code.
  2827.             See Also:
  2828.                haGetPortName, haGetPortPrefs
  2829.             Example:
  2830.             /* -----------------------------------------------------------
  2831.   --------- */
  2832.             /* Get and display port type.
  2833.               This program segment:
  2834.                - Gets the port type and displays it in a message box. */
  2835.             
  2836.               ReturnCode = haGetPortType(ScriptHandle, sizeof(PType),
  2837.   PType)
  2838.               ReturnCode = haMessageBox(ScriptHandle,
  2839.             /* -----------------------------------------------------------
  2840.   --------- */
  2841.  
  2842.  
  2843. haGetCursorPosition
  2844.  
  2845.             Returns the current cursor position on the emulator screen.
  2846.             Syntax:
  2847.                INT haGetCursorPosition(ScriptHandle, pnRow, pnCol)
  2848.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2849.                  INT FAR* pnRow      The row number
  2850.                  INT FAR* pnCol      The column number
  2851.             Arguments:
  2852.                ScriptHandle
  2853.                  The script handle returned from haInitialize.
  2854.                pnRow
  2855.                  A pointer to integer sized storage for the row number.
  2856.                pnCol
  2857.                  A pointer to integer sized storage for the column number.
  2858.             Remarks:
  2859.                Row and column numbers start at zero and are limited by the
  2860.                emulator.
  2861.             Return Value:
  2862.                Returns 0 if successful. Otherwise, a standard API error
  2863.                code.
  2864.             See Also:
  2865.                haGetTextFromScreen, haSetCursorPosition
  2866.  
  2867.  
  2868. haGetPrinterStatus
  2869.  
  2870.             Returns the current state of capturing to the printer.
  2871.             Syntax:
  2872.                INT haGetPrinterStatus(ScriptHandle)
  2873.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2874.             Arguments:
  2875.                ScriptHandle
  2876.                  The script handle returned from haInitialize.
  2877.             Remarks:
  2878.             
  2879.             Return Value:
  2880.                Returns one of the following codes if successful,
  2881.                Otherwise,a standard API error code.
  2882.                  Value       Meaning
  2883.                  HA_PRINTER_ON    Print capture has been started
  2884.                  HA_PRINTER_PAUSEDPrint capture has been paused
  2885.                  HA_PRINTER_OFF   Print capture is not running
  2886.             See Also:
  2887.                haCaptureToPrinterBegin, haCaptureToPrinterControl
  2888.  
  2889.  
  2890. haGetRingsForAnswer
  2891.  
  2892.             Returns the current number of times an incoming call rings
  2893.             before the call is answered.
  2894.             Syntax:
  2895.                INT haGetRingsForAnswer(ScriptHandle)
  2896.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2897.             Arguments:
  2898.                ScriptHandle
  2899.                  The script handle returned from haInitialize.
  2900.             Remarks:
  2901.                This function returns the value set by an earlier call to
  2902.                haSetRingsForAnswer or the default value for the device
  2903.                being used if haSetRingsForAnswer has not been called.
  2904.             Return Value:
  2905.                Returns the number of rings to wait if successful.
  2906.                Otherwise, a standard API error code.
  2907.             See Also:
  2908.                haSetRingsForAnswer
  2909.  
  2910.  
  2911. haGetRuntimeValue
  2912.  
  2913.             Returns one of the runtime strings stored with each session.
  2914.             Syntax:
  2915.                INT haGetRuntimeValue(ScriptHandle, nValue, nPrompt, nSize,
  2916.                pszBuffer)
  2917.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2918.                  INT nValue          Which runtime string to return
  2919.                  INT nPrompt         To prompt or not to prompt
  2920.                  INT nSize           The size of the following buffer
  2921.                  LPSTR pszBuffer     A pointer to a buffer
  2922.             Arguments:
  2923.                ScriptHandle
  2924.                  The script handle returned from haInitialize.
  2925.                nValue
  2926.                  Which runtime string to return:
  2927.                  Value             Meaning
  2928.                  HA_RV_USERNAME     The currently defined user name.
  2929.                  HA_RV_USERID       The currently defined user ID.
  2930.                  HA_RV_PASSWORD     The currently defined password.
  2931.                nPrompt
  2932.                  If TRUE (non-zero), HyperACCESS prompts the user for a
  2933.                  value if none has been stored in the session.
  2934.                nSize
  2935.                  The size of the following buffer.
  2936.                pszBuffer
  2937.                  A pointer to a buffer that will receive the runtime
  2938.                  string.
  2939.             Remarks:
  2940.                If the string is not currently set, the function call can
  2941.                instruct HyperACCESS to prompt for the string by setting
  2942.                nPrompt to TRUE. The dialog that is used to prompt the user
  2943.                has a checkbox in it that allows the user to specify that
  2944.                they want the value they enter to be stored for future use.
  2945.                The user can view and change values they store by using the
  2946.                Runtime Values dialog selected from the Properties menu. If
  2947.                the session has a stored value, it is returned without input
  2948.                from the user regardless of the setting of nPrompt.
  2949.             Return Value:
  2950.                Returns 0 if successful. Otherwise, a standard API error
  2951.                code.
  2952.             Example:
  2953.             /* -----------------------------------------------------------
  2954.                          --------- */
  2955.             
  2956.             /* Get runtime values for NAME, USERID, and PASSWORD. Then use
  2957.                          those values.
  2958.                         This program segment:
  2959.                            - Gets runtime values if they exist. The TRUE
  2960.                          parameter indicates
  2961.                              that HyperACCESS should automatically prompt
  2962.                          for a value if one
  2963.                              isn't already stored.
  2964.                            - Use the UserId and password as part of a
  2965.                          login sequence with a
  2966.                              remote system.*/
  2967.             
  2968.                         ReturnCode = haGetRuntimeValue(ScriptHandle,
  2969.                          HA_RV_USERNAME, TRUE, sizeof(UName), UName);
  2970.                         ReturnCode = haGetRuntimeValue(ScriptHandle,
  2971.                          HA_RV_USERID, TRUE, sizeof(UID), UID);
  2972.                         ReturnCode = haGetRuntimeValue(ScriptHandle,
  2973.                          HA_RV_PASSWORD, TRUE, sizeof(PWord), PWord);
  2974.             
  2975.                         /* Assume a connection has been made for this
  2976.                          example to talk to. */
  2977.                            ReturnCode = haWaitForPrompt(ScriptHandle, 1,
  2978.                          "LOGON ID:", 1000L, 60000L);
  2979.                            ReturnCode = haTypeText(ScriptHandle, 0, UID);
  2980.                            ReturnCode = haWaitForPrompt(ScriptHandle, 1,
  2981.                          "Password:", 1000L, 60000L);
  2982.                            ReturnCode = haTypeText(ScriptHandle, 0,
  2983.                          PWord);
  2984.             
  2985.             /* -----------------------------------------------------------
  2986.                          --------- */
  2987.  
  2988.  
  2989. haGetSelectedText
  2990.  
  2991.             Get the selected (highlighted) text from the associated
  2992.             session window.
  2993.             Syntax:
  2994.                  INT haGetSelectedText(ScriptHandle, nSize, pszBuffer)
  2995.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  2996.                  INT nSize           The size of the following buffer
  2997.                  LPSTR pszBuffer     A pointer to a buffer
  2998.             Arguments:
  2999.                ScriptHandle
  3000.                  The script handle returned from haInitialize.
  3001.                nSize
  3002.                  The size of the following buffer.
  3003.                pszBuffer
  3004.                  A pointer to a buffer that is to receive the selected
  3005.                  text.
  3006.             Remarks:
  3007.                Since there is no way to predict how much text the user is
  3008.                going to select, make the buffer as big as is possible and
  3009.                still be reasonable. Remember, it still won't be large
  3010.                enough every time.
  3011.             Return Value:
  3012.                Returns 0 if successful. Otherwise a standard API error
  3013.                code.
  3014.             See Also:
  3015.                haGetTextFromScreen
  3016.  
  3017.  
  3018. haGetSerNumString
  3019.  
  3020.             Returns the serial number string from HyperACCESS.
  3021.             Syntax:
  3022.                INT haGetSerNumString(ScriptHandle, nSize, pszBuffer)
  3023.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3024.                  INT nSize           The size of the following buffer
  3025.                  LPSTR pszBuffer     A pointer to a buffer
  3026.             Arguments:
  3027.                ScriptHandle
  3028.                  The script handle returned from haInitialize.
  3029.                nSize
  3030.                  The size of the following buffer.
  3031.                pszBuffer
  3032.                  A pointer to a buffer to receive the serial number
  3033.                  string.
  3034.             Remarks:
  3035.                The serial number is initially set by the installation
  3036.                procedure and is visible in the program's Help About
  3037.                HyperACCESS dialog box. This function returns the serial
  3038.                number as a string.
  3039.             Return Value:
  3040.                Returns 0 if successful. Otherwise, a standard API error
  3041.                code.
  3042.             See Also:
  3043.                
  3044.  
  3045.  
  3046. haGetSession
  3047.  
  3048.             Returns the session handle currently associated with the
  3049.             program - HyperACCESS link.
  3050.             Syntax:
  3051.                HSESS haGetSession(ScriptHandle)
  3052.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3053.             Arguments:
  3054.                ScriptHandle
  3055.                  The script handle returned from haInitialize.
  3056.             Remarks:
  3057.                Each open session in HyperACCESS is uniquely identified by a
  3058.                session handle. Several other API functions operate on the
  3059.                current session handle.
  3060.             Return Value:
  3061.                This function returns a session handle associated with the
  3062.                script, or zero if no session is currently associated with
  3063.                the script.
  3064.             See Also:
  3065.                haCloseSession, haOpenSession, haSetSession
  3066.  
  3067.  
  3068. haGetSessionName
  3069.  
  3070.             Returns the name of the current session.
  3071.             Syntax:
  3072.                INT haGetSessionName(ScriptHandle, nSize, pszBuffer)
  3073.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3074.                  INT nSize           The size of the following buffer
  3075.                  LPSTR pszBuffer     A pointer to a buffer
  3076.             Arguments:
  3077.                ScriptHandle
  3078.                  The script handle returned from haInitialize.
  3079.                nSize
  3080.                  The size of the following buffer.
  3081.                pszBuffer
  3082.                  A pointer to a buffer that is to recieve the string.
  3083.             Remarks:
  3084.                The session name is the string that is displayed in the
  3085.                title bar of an open session. It is also displayed in some
  3086.                of the Phonebook views.
  3087.             Return Value:
  3088.                Returns 0 if successful. Otherwise, a standard API error
  3089.                code.
  3090.             See Also:
  3091.                haGetSessionDataString
  3092.  
  3093.  
  3094. haGetSessionDataString
  3095.  
  3096.             Returns one of the 20 internal data strings associated the
  3097.             session.
  3098.             Syntax:
  3099.                INT haGetSessionDataString(ScriptHandle, nIndex, nSize,
  3100.                pszBuffer)
  3101.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3102.                  INT nIndex          Indicates which string to return
  3103.                  INT nSize           The size of the following buffer
  3104.                  LPSTR pszBuffer     A pointer to a buffer
  3105.             Arguments:
  3106.                ScriptHandle
  3107.                  The script handle returned from haInitialize.
  3108.                nIndex
  3109.                  An index (0 - 19) indicating which string is to be
  3110.                  returned.
  3111.                nSize
  3112.                  The size of the following buffer.
  3113.                pszBuffer
  3114.                  A pointer to a buffer that is to receive the data string.
  3115.             Remarks:
  3116.                Each session has 20 internal data strings associated with
  3117.                it. The first ten strings are always blank when a session is
  3118.                opened. They can be used in situations where new data must
  3119.                be received before being used. The second ten strings are
  3120.                stored in the session file when a session is closed and
  3121.                restored when the session is reopened. You can use these
  3122.                strings in a program for storing user settings, file
  3123.                locations, etc.
  3124.             Return Value:
  3125.                Returns 0 if successful. Otherwise, a standard API error
  3126.                code.
  3127.             See Also:
  3128.                haSetSessionDataString
  3129.  
  3130.  
  3131. haGetTextFromScreen
  3132.  
  3133.             Returns text from the emulator screen.
  3134.             Syntax:
  3135.                INT haGetTextFromScreen(ScriptHandle, nRow, nCol, nCount,
  3136.                pszBuffer)
  3137.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3138.                  INT nRow            The row number
  3139.                  INT nCol            The column number
  3140.                  INT nCount          The number of bytes to return
  3141.                  LPSTR pszBuffer     A pointer to a buffer
  3142.             Arguments:
  3143.                ScriptHandle
  3144.                  The script handle returned from haInitialize.
  3145.                nRow
  3146.                  The row number used to address the screen. Addresses
  3147.                  start at zero and are limited by the emulator in use.
  3148.                nCol
  3149.                  The column number used to address the screen. Addresses
  3150.                  start at zero and are limited by the emulator in use.
  3151.                nCount
  3152.                  The number of characters of text to return.
  3153.                pszBuffer
  3154.                  A pointer to a buffer large enough to hold the specified
  3155.                  number of characters.
  3156.             Remarks:
  3157.                Row and column addresses start at zero and are limited by
  3158.                the emulator. You can retrieve text from only one row at a
  3159.                time.
  3160.             Return Value:
  3161.                Returns 0 if successful. Otherwise, a standard API error
  3162.                code.
  3163.             See Also:
  3164.                haGetInput, haTypeText
  3165.             Example:
  3166.             /* -----------------------------------------------------------
  3167.                          --------- */
  3168.             
  3169.             /* Get text from specific screen positions.
  3170.                         This program segment:
  3171.                            - Requests 10 characters starting at screen
  3172.                          position 0,35
  3173.                              where           0 is vertical position (from
  3174.                          top),
  3175.                                             35 is horizontal position
  3176.                          (from left). */
  3177.             
  3178.                         ReturnCode = haGetTextFromScreen(ScriptHandle, 0,
  3179.                          35, 10, Buffer);
  3180.             
  3181.             /* -----------------------------------------------------------
  3182.                          --------- */
  3183.  
  3184.  
  3185. haGetVersion
  3186.  
  3187.             Returns a string indicating the version of HyperACCESS.
  3188.             Syntax:
  3189.                INT haGetVersion(ScriptHandle, nSize, pszBuffer)
  3190.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3191.                  INT nSize           The size of the following buffer
  3192.                  LPSTR pszBuffer     A pointer to a buffer
  3193.             Arguments:
  3194.                ScriptHandle
  3195.                  The script handle returned from haInitialize.
  3196.                nSize
  3197.                  The size of the following buffer.
  3198.                pszBuffer
  3199.                  A pointer to a buffer that is to receive the version
  3200.                  number string.
  3201.             Remarks:
  3202.                The version number is returned formatted as a string.
  3203.             Return Value:
  3204.                Returns 0 if successful. Otherwise, a standard API error
  3205.                code.
  3206.             Example:
  3207.             /* -----------------------------------------------------------
  3208.                          --------- */
  3209.             
  3210.             /* Gets HyperACCESS version number, and display it.
  3211.                         This program segment:
  3212.                            - Gets HyperACCESS version number
  3213.                            - Uses a standard C function to write formatted
  3214.                          data to a string.
  3215.                            - Displays the version number in a message box
  3216.                          that only accepts an OK
  3217.                              response. */
  3218.             
  3219.                         ReturnCode = haGetVersion(ScriptHandle,
  3220.                          sizeof(Vers), Vers);
  3221.                         sprintf(Buffer, "Version: %s", Vers);
  3222.                         ReturnCode = haMessageBox(ScriptHandle,
  3223.                          "HyperACCESS", Buffer, 0, 0, HA_MB_OK);
  3224.             /* -----------------------------------------------------------
  3225.                          --------- */
  3226.  
  3227.  
  3228. haGetWindowStateBits
  3229.  
  3230.             Returns a group of flags (bits) that describe the visibility
  3231.             and state of HyperACCESS.
  3232.             Syntax:
  3233.                INT haGetWindowStateBits(ScriptHandle)
  3234.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3235.             Arguments:
  3236.                ScriptHandle
  3237.                  The script handle returned from haInitialize.
  3238.             Remarks:
  3239.                The integer value returned has flags (bits) which are either
  3240.                TRUE (1) or FALSE (0). Determining the value of individual
  3241.                bits is language dependent operation. You can test the value
  3242.                of a particular bit by performing a bitwise AND operation of
  3243.                the returned value with the desired flag name defined below.
  3244.             Return Value:
  3245.                Any of the following flags may be ORed together and returned
  3246.                if the call is successful. Otherwise, a standard API error
  3247.                code is returned.
  3248.                  Value             Meaning
  3249.                  HA_FRAME_IS_ACTIVE The frame is active.
  3250.                  HA_FRAME_IS_ICONIC The frame is iconic.
  3251.                  HA_SESSION_IS_ACTIVE    The session is active.
  3252.                  HA_SESSION_IS_ICONIC    The session is iconic.
  3253.             See Also:
  3254.                haGetSession, haSetSession
  3255.  
  3256.  
  3257. haGetXferDirectory
  3258.  
  3259.             Returns the default transfer directory for the current
  3260.             session.
  3261.             Syntax:
  3262.                INT haGetXferDirectory(ScriptHandle, nDirection, nSize,
  3263.                pszBuffer)
  3264.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3265.                  INT nDirection      Select which directory
  3266.                  INT nSize           The size of the following buffer
  3267.                  LPSTR pszBuffer     A pointer to a buffer
  3268.             Arguments:
  3269.                ScriptHandle
  3270.                  The script handle returned from haInitialize.
  3271.                nDirection
  3272.                  Selects sending or receiving.
  3273.                  Value       Meaning
  3274.                  HA_XFER_SENDSelects the sending directory.
  3275.                  HA_XFER_RECVSelects the receiving directory.
  3276.                nSize
  3277.                  The size of the following buffer.
  3278.                pszBuffer
  3279.                  A pointer to a buffer to receive the name of the transfer
  3280.                  directory.
  3281.             Remarks:
  3282.                The buffer should be large enough to accomodate a complete
  3283.                path.
  3284.             Return Value:
  3285.                Returns 0 if successful. Otherwise, a standard API error
  3286.                code.
  3287.             See Also:
  3288.                haSetXferDirectory
  3289.             Example:
  3290.             /* -----------------------------------------------------------
  3291.                          --------- */
  3292.             
  3293.             /* Get (and set) directory path to receive files.
  3294.                         This program segment:
  3295.                            - Gets default receive directory path.
  3296.                            - Use a message box to ask if the user wants to
  3297.                          change the default path.
  3298.                            - If the user responds Yes, request a new
  3299.                          directory path using a
  3300.                              message box.
  3301.                            - Sets the new directory as the default. */
  3302.             
  3303.                         ReturnCode = haGetXferDirectory(ScriptHandle,
  3304.                          HA_XFER_RECV, sizeof(DName), DName);
  3305.                         ReturnCode = haMessageBox(ScriptHandle,
  3306.                          "HyperACCESS:",
  3307.                                             "Change Receive Directory
  3308.                          Path?", 0, 0, HA_MB_YN);
  3309.                         if (ReturnCode == 1)
  3310.                            {
  3311.                            SubReturnCode = haMessageBox(ScriptHandle,
  3312.                          "HyperACCESS:",
  3313.                                             "Enter Receive Directory:",
  3314.                          sizeof(DName), DName, HA_MB_OK);
  3315.                            SubReturnCode =
  3316.                          haSetXferDirectory(ScriptHandle, HA_XFER_RECV,
  3317.                                             DName);
  3318.                            }
  3319.             
  3320.             /* -----------------------------------------------------------
  3321.                          --------- */
  3322.  
  3323.  
  3324. haGetXferDropList
  3325.  
  3326.             Returns a path and filename from an internal list of files
  3327.             dropped on the session.
  3328.             Syntax:
  3329.                INT haGetXferDropList(ScriptHandle, nIndex, nSize,
  3330.                pszBuffer)
  3331.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3332.                  INT nIndex          Which item to return
  3333.                  INT nSize           The size of the following buffer
  3334.                  LPSTR pszBuffer     A pointer to a buffer
  3335.             Arguments:
  3336.                ScriptHandle
  3337.                  The script handle returned from haInitialize.
  3338.                nIndex
  3339.                  Selects which item in the list of dropped files is to be
  3340.                  returned. Selections start at zero.
  3341.                nSize
  3342.                  The size of the following buffer.
  3343.                pszBuffer
  3344.                  A pointer to a buffer that is to receive the filename
  3345.                  from the list of dropped files.
  3346.             Remarks:
  3347.                HyperACCESS supports drag and drop operations on open
  3348.                sessions as well as selected dialog boxes. When files are
  3349.                dropped on an open session, an external task is run to
  3350.                handle the dropped files. Use this function to get the path
  3351.                and filename of dropped files from the list, one at a time.
  3352.                Not currently supported in HAOS2.
  3353.             Return Value:
  3354.                Returns 0 if successful. Otherwise, a standard API error
  3355.                code.
  3356.             See Also:
  3357.                haClearXferDropList, haGetXferSendList, haXferDropSend
  3358.  
  3359.  
  3360. haGetXferFinalStatus
  3361.  
  3362.             Returns the final status of the most recent file transfer.
  3363.             Syntax:
  3364.                INT haGetXferFinalStatus(ScriptHandle)
  3365.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3366.             Arguments:
  3367.                ScriptHandle
  3368.                  The script handle returned from haInitialize.
  3369.             Remarks:
  3370.                A file transfer started with nFlag TRUE completes before the
  3371.                function call returns (see haXferReceive, haXferSend,
  3372.                haXferDropSend). In that case, call haGetXferFinalStatus
  3373.                upon return from function that initiated transfer to get the
  3374.                final status. If nFlag is FALSE, the function call that
  3375.                starts the transfer returns while transfer continues. In
  3376.                that case, haGetXferStatus can monitor progress of the
  3377.                transfer. When haGetXferStatus or haWaitForXfer indicates
  3378.                that transfer has completed, use haGetXferFinalStatus to
  3379.                determine whether the transfer completed successfully.
  3380.             Return Value:
  3381.                Returns one of the following values if successful.
  3382.                Otherwise, a standard API error code.
  3383.                  Value             Meaning
  3384.                  HA_XFS_OK          Transfer completed successfully.
  3385.                  HA_XFS_RMT_CANNED  Transfer cancelled at other end.
  3386.                  HA_XFS_USER_CANNED Transfer cancelled locally (by the
  3387.                                     user).
  3388.                  HA_XFS_LOST_CARRIERCarrier lost during transfer.
  3389.                  HA_XFS_ERROR_LIMIT The protocol-defined error limit
  3390.                                     exceeded.
  3391.                  HA_XFS_NO_RESPONSE The remote end of the transfer stopped
  3392.                                     responding.
  3393.                  HA_XFS_OUT_OF_SEQ  A protocol packet was received out-of-
  3394.                                     sequence and recovery was not
  3395.                                     possible.
  3396.                  HA_XFS_BAD_FORMAT  A protocol packet was received with a
  3397.                                     correct checksum but with an illegal
  3398.                                     format.
  3399.                  HA_XFS_TOO_MANY    The remote sender tried to send
  3400.                                     multiple files but the receiver could
  3401.                                     accept only one.
  3402.                  HA_XFS_DISK_FULL   The disk filled up before transfer
  3403.                                     completed.
  3404.                  HA_XFS_CANT_OPEN   A file could not be opened to store a
  3405.                                     received file.
  3406.                  HA_XFS_DISK_ERROR  A disk error occurred during transfer.
  3407.                  HA_XFS_NO_MEM      The program could not allocate
  3408.                                     sufficient memory to complete
  3409.                                     transfer.
  3410.                  HA_XFS_FILE_EXISTS A file was received with the same name
  3411.                                     as an existing file and no option to
  3412.                                     rename the file was specified.
  3413.                  HA_XFS_COMPLETE    The transfer completed successfully.
  3414.                  HA_XFS_CANT_START  The protocol could not successfully
  3415.                                     negotiate start of a transfer.
  3416.                  HA_XFS_OLDER_FILE  An option to accept only newer files
  3417.                                     was specified, and the received file
  3418.                                     is older than the existing file.
  3419.                  HA_XFS_NO_FILETIME An option to accept only newer files
  3420.                                     was specified, and the sender did not
  3421.                                     include the date and time of the file
  3422.                                     being sent.
  3423.                  HA_XFS_WONT_CANCEL An attempt was made to negotiate a
  3424.                                     graceful cancel of the transfer with
  3425.                                     the remote system, but it did not
  3426.                                     respond to the request.
  3427.                  HA_XFS_GEN_FAILURE Any error not explicitly covered in
  3428.                                     the other return codes.
  3429.                  HA_XFS_NO_VSCAN    Virus scanning requested, but no virus
  3430.                                     data file is available. (Not available
  3431.                                     in OS/2.)
  3432.                  HA_XFS_VIRUS_DETECTVirus scanning requested, and a virus
  3433.                                     was detected in the file being
  3434.                                     received. (Not available in OS/2.)
  3435.                  HA_XFS_USER_SKIP   The user used the skip button.
  3436.                  HA_XFS_REFUSE      The remote system refused to accept a
  3437.                                     file that we attempted to send.
  3438.             See Also:
  3439.                haGetXferStatus, haWaitForXfer, haXferSend, haXferReceive
  3440.  
  3441.  
  3442. haGetXferParameters
  3443.  
  3444.             Returns an integer value composed of flags (bits) that
  3445.             determine how a transfer operation is carried out.
  3446.             Syntax:
  3447.                INT haGetXferParameters(ScriptHandle)
  3448.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3449.             Arguments:
  3450.                ScriptHandle
  3451.                  The script handle returned from haInitialize.
  3452.             Remarks:
  3453.                The integer value returned has flags (bits) which are either
  3454.                TRUE (1) or FALSE (0). Determining the value of individual
  3455.                bits is language dependent operation. You can test the value
  3456.                of a particular bit by performing a bitwise AND operation of
  3457.                the returned value with the desired flag name defined below.
  3458.                Keep in mind that some file transfer protocols, such as
  3459.                Xmodem, have no provision for sending filenames, file sizes,
  3460.                or modification times with files.
  3461.             Return Value:
  3462.                Returns one or more of the following flags, if successful.
  3463.                Otherwise, a standard API error code.
  3464.                  Value       Meaning
  3465.                  XF_DN_MASK  A mask for the next 6 flags. These flags are
  3466.                               used if the selected filename is already
  3467.                               being used.
  3468.                  XF_DN_APPENDAppend if filename is already used.
  3469.                  XF_DN_OVERWRT    Overwrite if filename is already used.
  3470.                  XF_DN_REFUSERefuse the transfer if filename is already
  3471.                               used.
  3472.                  XF_DN_NEWER Overwrite if the received file is newer than
  3473.                               the current file.
  3474.                  XF_DN_DATE  Generate a new filename based on the old name
  3475.                               and the current date.
  3476.                  Value       Meaning
  3477.                  XF_DN_SEQ   Generate a new filename based on the old name
  3478.                               and a sequence number.
  3479.                  XF_CHECK_VIRUS   Enable virus detection.
  3480.                  XF_USE_FILENAME  Use received filename, if any, in naming
  3481.                               file.
  3482.                  XF_USE_DIRECTORY Use received directory, if any, in
  3483.                               naming file.
  3484.                  XF_SAVE_PARTIAL  Save partial file if transfer is
  3485.                               interrupted.
  3486.                  XF_USE_DATETIME  Use received file date and time, if any.
  3487.             See Also:
  3488.                haSetXferParameters, haXferReceive, haXferSend
  3489.             Example:
  3490.             /* -----------------------------------------------------------
  3491.                          --------- */
  3492.             
  3493.             /* Check a current transfer parameter, and changes its value.
  3494.                         This program segment:
  3495.                            - Gets a current transfer parameter
  3496.                              (checks save partial received files).
  3497.                            - Sets transfer parameter (to save). */
  3498.             
  3499.                         ReturnCode = haGetXferParameters(ScriptHandle);
  3500.                         if ( !(ReturnCode & XF_SAVE_PARTIAL) )
  3501.                            {
  3502.                            ReturnCode |= XF_SAVE_PARTIAL ;      // Add
  3503.                          save partial
  3504.             
  3505.                            haSetXferParameters(ScriptHandle, ReturnCode);
  3506.             
  3507.             /* -----------------------------------------------------------
  3508.                          --------- */
  3509.                
  3510.  
  3511.  
  3512. haGetXferProtocol
  3513.  
  3514.             Returns the current default transfer protocol.
  3515.             Syntax:
  3516.                INT haGetXferProtocol(ScriptHandle, nDirection)
  3517.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3518.                  INT nDirection      Selects send or receive
  3519.             Arguments:
  3520.                ScriptHandle
  3521.                  The script handle returned from haInitialize.
  3522.                nDirection
  3523.                  Selects sending or receiving.
  3524.                  Value       Meaning
  3525.                  HA_XFER_SENDGets the sending protocol.
  3526.                  HA_XFER_RECVGets the receiving protocol.
  3527.             Remarks:
  3528.                
  3529.             Return Value:
  3530.                Returns one of the following values if successful.
  3531.                Otherwise, a standard API error code.
  3532.                  Value       Meaning
  3533.                  HA_HYPERP   Hilgraeve's HyperProtocol.
  3534.                  HA_COMPUSERV_B   CompuServe B+.
  3535.                  HA_KERMIT   Kermit.
  3536.                  HA_XMODEM   XMODEM.
  3537.                  HA_XMODEM_1K1K XMODEM.
  3538.                  HA_YMODEM   YMODEM.
  3539.                  Value       Meaning
  3540.                  HA_YMODEM_G YMODEM-G.
  3541.                  HA_ZMODEM   ZMODEM.
  3542.             See Also:
  3543.                haSetXferProtocol, haXferReceive, haXferSend
  3544.  
  3545.  
  3546. haGetXferSendList
  3547.  
  3548.             Returns a path and filename from the internal file send list.
  3549.             Syntax:
  3550.                INT haGetXferSendList(ScriptHandle, nIndex, nSize,
  3551.                pszBuffer)
  3552.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3553.                  INT nIndex          Which item to return
  3554.                  INT nSize           The size of the following buffer
  3555.                  LPSTR pszBuffer     A pointer to a buffer
  3556.             Arguments:
  3557.                ScriptHandle
  3558.                  The script handle returned from haInitialize.
  3559.                nIndex
  3560.                  Selects which item in the list of files is to be
  3561.                  returned. Selections start at zero.
  3562.                nSize
  3563.                  The size of the following buffer. The buffer should be
  3564.                  large enough to accomodate a complete path and filename.
  3565.                pszBuffer
  3566.                  A pointer to a buffer that is to receive the path and
  3567.                  filename from the list of files.
  3568.             Remarks:
  3569.                You can build a list of files that HyperACCESS maintains
  3570.                internally and then send all files in the list by using
  3571.                haXferSendFromList. Files are normally added to the list by
  3572.                haXferAddToSendList. You can examine the list using this
  3573.                function.
  3574.             Return Value:
  3575.                Returns 0 if successful. Otherwise, a standard API error
  3576.                code.
  3577.             See Also:
  3578.                haClearXferSendList, haGetXferDropList, haXferAddToSendList,
  3579.                haXferSendFromList
  3580.  
  3581.  
  3582. haGetXferStatus
  3583.  
  3584.             Returns a percentage value that indicates how much of a
  3585.             transfer has completed.
  3586.             Syntax:
  3587.                INT haGetXferStatus(ScriptHandle)
  3588.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3589.             Arguments:
  3590.                ScriptHandle
  3591.                  The script handle returned from haInitialize.
  3592.             Remarks:
  3593.                The number returned is between 0 and 99. This function is
  3594.                only useful if a transfer is started with the nFlag argument
  3595.                set FALSE. See the remarks under haXferSendFromList for an
  3596.                explanation.
  3597.             Return Value:
  3598.                Returns 0 thru 99 if successful. Otherwise, a standard API
  3599.                error code.
  3600.             See Also:
  3601.                haWaitForXfer, haXferReceive, haXferSend, haXferSendBatch,
  3602.                haXferSendFromList, haXferSendList
  3603.  
  3604.  
  3605. haInitialize
  3606.  
  3607.             This required function must be called before any other API
  3608.             functions. The arguments for haInitialize are operating system
  3609.             dependent, so a program that runs on multiple platforms will
  3610.             require conditional compilation to account for the different
  3611.             calling sequences.
  3612.             HAOS2 Syntax:
  3613.                SCRIPTHANDLE haInitialize(argc, argv)
  3614.                  INT argc            Number of arguments in the command
  3615.                                       line
  3616.                  LPSTR * argv        Array of pointers to strings of
  3617.                                       command line arguments
  3618.             HAWin Syntax:
  3619.                SCRIPTHANDLE haInitialize(hParentHwnd, hInst, hPrevInst,
  3620.                lpCmdLine)
  3621.                  HWND hParentHwnd    The parent window handle
  3622.                  HANDLE hInst        The current instance handle
  3623.                  HANDLE hPrevInst    The previous instance handle
  3624.                  LPSTR lpCmdLine     The command line
  3625.             Arguments:
  3626.                argc
  3627.                  A count of the number of arguments in the command line.
  3628.                  This value is returned by OS/2.
  3629.                argv
  3630.                  An array of pointers to strings of command line
  3631.                  arguments. This array is provided by OS/2.
  3632.                hParentHwnd
  3633.                  A window handle that the external API is to be a child
  3634.                  of.
  3635.                hInst
  3636.                  The current instance of the task.
  3637.                hPrevInst
  3638.                  The previous instance of the task, if any.
  3639.                lpCmdLine
  3640.                  The command line that started the task.
  3641.             Remarks:
  3642.                This function performs necessary initialization so that an
  3643.                external API task can communicate with HyperACCESS. It must
  3644.                be called before any other external API function is called.
  3645.                All of the parameters are those generally passed in to a C
  3646.                program by the operating system. Programmers using C or a
  3647.                similar Software Development Kit (SDK) should pass the
  3648.                parameters to haInitialize without modification.
  3649.                For Visual Basic there is no WinMain entry point available
  3650.                to the user. Visual Basic users need to use the Command$
  3651.                function to retrieve the command line. The C interpreter
  3652.                used by HyperACCESS is a special case. The function must be
  3653.                called, but the parameters may be NULL, because WinMain is
  3654.                handled internally. Users of other SDKs are encouraged to
  3655.                search appropriate documentation to find the necessary
  3656.                functions.
  3657.                A single external program may call haInitialize more than
  3658.                once to create multiple simultaneous control scripts. Doing
  3659.                so allows the program to execute multiple tasks in
  3660.                HyperACCESS simultaneously or to control more than one
  3661.                HyperACCESS session at the same time. Each call to
  3662.                haInitialize must be matched with a call to haTerminate when
  3663.                the program is done.
  3664.             Return Value:
  3665.                Returns an external API script handle if successful.
  3666.                Otherwise, zero.
  3667.             See Also:
  3668.                haTerminate
  3669.  
  3670.  
  3671. haLearnControl
  3672.  
  3673.             Turns learning(recording) on or off for the currently active
  3674.             session.
  3675.             Syntax:
  3676.                INT haLearnControl(ScriptHandle, nCmd)
  3677.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3678.                  INT nCmd            The control command
  3679.             Arguements:
  3680.                ScriptHandle
  3681.                  The script handle returned from haInitialize.
  3682.                nCmd
  3683.                  This is a constant value that represents the command to
  3684.                  be applied to the HyperACCESS learning(recording) system.
  3685.                  Value       Meaning
  3686.                  HA_L_START  Start learning(recording).
  3687.                  HA_L_STOP   Stop learning(recording) and save the learned
  3688.                               script in the default file.
  3689.                  HA_L_ABORT  Stop learning(recording) but do not save the
  3690.                               learned script.
  3691.             Remarks:
  3692.                
  3693.             Return Value:
  3694.                Returns 0 if successful. Otherwise, a standard API error
  3695.                code.
  3696.             See Also:
  3697.                haSetLearnFileName, haCaptureControl
  3698.  
  3699.  
  3700. haLoadFuncs
  3701.  
  3702.             Register additional HyperACCESS API functions in REXX.
  3703.             Syntax:
  3704.                    haLoadFuncs
  3705.             Remarks:
  3706.                This function provides a simple way of registering all
  3707.                HyperACCESS API functions with REXX.  You should call this
  3708.                API function before any other in a REXX script. To call
  3709.                haLoadFuncs, you must use the OS/2 built-in function
  3710.                RxFuncAdd. Valid for HAOS2 REXX programs only.
  3711.                All REXX entry points in the API actually have an 'Rx'
  3712.                prefix.  So, for example, the REXX entry point for
  3713.                haInitialize is RxhaInitialize.  If you prefer to register
  3714.                only those functions used by your script because of memory
  3715.                constraints, you must use the 'Rx' entry point name in your
  3716.                RxFuncAdd call.
  3717.                If functions are already registered, haLoadFuncs still gives
  3718.                a successful return code.
  3719.             Return Value:
  3720.                    Returns 0 if successful.  Otherwise, a standard API
  3721.                error code.
  3722.             See Also:
  3723.                    haDropFuncs
  3724.             Example:
  3725.             /* -----------------------------------------------------------
  3726.                          --------- */
  3727.             
  3728.             /* Register the API function haLoadFuncs.  It's located in the
  3729.   file
  3730.              * HA_AUTO.DLL, and is internally named RxhaLoadFuncs.  Then
  3731.   call
  3732.              * haLoadFuncs to register all other API functions with Rexx.
  3733.              */
  3734.             
  3735.             CALL RxFuncAdd 'haLoadFuncs', 'HA_AUTO', 'RxhaLoadFuncs'
  3736.             CALL haLoadFuncs
  3737.             
  3738.             /* -----------------------------------------------------------
  3739.   --------- */
  3740.  
  3741.  
  3742. haMenuString
  3743.  
  3744.             Performs HyperACCESS menu actions as if mnemonic keystrokes
  3745.             were used.
  3746.             Syntax:
  3747.                INT haMenuString(ScriptHandle, pszString)
  3748.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3749.                  LPSTR pszString     A pointer to a string of characters
  3750.                                       terminated by a null
  3751.             Arguments:
  3752.                ScriptHandle
  3753.                  The script handle returned from haInitialize.
  3754.                pszString
  3755.                  A pointer to a string of characters representing menu
  3756.                  actions. For example, "FX" would represent the menu
  3757.                  selections File and Exit.
  3758.             Remarks:
  3759.                This function lets a programmer perform actions in
  3760.                HyperACCESS by specifying the menu mnemonic keystrokes that
  3761.                would perform the operation. This function can be said to
  3762.                follow the menus to perform the requested function. For
  3763.                example, to exit HyperACCESS the string "FX" for File and
  3764.                Exit would be used.
  3765.             Return Value:
  3766.                Returns 0 if successful. Otherwise, a standard API error
  3767.                code.
  3768.             Example:
  3769.             /* -----------------------------------------------------------
  3770.                          --------- */
  3771.             
  3772.             /* Let the user set default transfer protocols.
  3773.                         This program segment:
  3774.                            - Uses the Properties/Transfer Protocols...
  3775.                          menu item to display
  3776.                              the File Transfer properties sheet (Transfer
  3777.                          Protocols dialog in
  3778.                              HAWin) so the user can select new protocols.
  3779.                          */
  3780.             
  3781.                         ReturnCode = haMenuString(ScriptHandle, "PT");
  3782.             
  3783.             /* -----------------------------------------------------------
  3784.                          --------- */
  3785.  
  3786.  
  3787. haMessageBox
  3788.  
  3789.             Displays a dialog box and accepts keyboard or mouse input from
  3790.             the user.
  3791.             Syntax:
  3792.                INT haMessageBox(ScriptHandle, pszTitle, pszMessage, nSize,
  3793.                pszBuffer, nButtons)
  3794.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3795.                  LPSTR pszTitle      The title of the message box
  3796.                  LPSTR pszMessage    The message to be displayed
  3797.                  INT nSize           The size of the following buffer
  3798.                  LPSTR pszBuffer     A pointer to a buffer
  3799.                  INT nButtons        What buttons to display
  3800.             Arguments:
  3801.                ScriptHandle
  3802.                  The script handle returned from haInitialize.
  3803.                pszTitle
  3804.                  The title of the message box. No commas or NULLs are
  3805.                  allowed.
  3806.                pszMessage
  3807.                  The message in the message box. No commas or NULLs are
  3808.                  allowed.
  3809.                nSize
  3810.                  The size of the following buffer. If the message box does
  3811.                  not need an input field, this must be set to zero.
  3812.                pszBuffer
  3813.                  A pointer to a buffer to receive user keyboard input. If
  3814.                  the message box does not need an input field, this
  3815.                  pointer must be set to NULL.
  3816.                nButtons
  3817.                  The following button groups are available:
  3818.                  Value       Meaning
  3819.                  HA_MB_OK    Use a single OK button.
  3820.                  HA_MB_OKC   Use OK and Cancel buttons.
  3821.                  HA_MB_YN    Use Yes and No buttons.
  3822.             Remarks:
  3823.                This function brings up a dialog box similar to a
  3824.                HyperACCESS display box. It allows the external API task to
  3825.                display messages on the local desktop and get local input.
  3826.                The external task is not required to use this function to
  3827.                create a message box. It can use standard operating system
  3828.                function calls instead. This function is made available as a
  3829.                helpful alternative.
  3830.             Return Value:
  3831.                Returns 0 if Cancel or No is selected, 1 if OK or Yes is
  3832.                selected. Otherwise, a standard API error code.
  3833.  
  3834.  
  3835. haNotifyOnTerminate
  3836.  
  3837.             Posts a message to a specified window when the session closes.
  3838.             Syntax:
  3839.                INT haNotifyOnTerminate(ScriptHandle, hWnd, nMsg)
  3840.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3841.                  HWND hWnd           A window handle to post to
  3842.                  INT nMsg            The message to be posted
  3843.             Arguments:
  3844.                ScriptHandle
  3845.                  The script handle returned from haInitialize.
  3846.                hWnd
  3847.                  The handle of the window that the following message is to
  3848.                  be posted to.
  3849.                nMsg
  3850.                  The message that is to be posted to the previous window
  3851.                  handle.
  3852.             Remarks:
  3853.                Posting messages across tasks is not a standard method in a
  3854.                Windows program. However, it can sometimes be useful. In
  3855.                this case, the message is posted if the script handle is
  3856.                still valid and the window handle is still valid. There is
  3857.                no type of checking done on the message. It is up to the
  3858.                user to correctly deal with it.
  3859.             Return Value:
  3860.                Returns 0 if successful. Otherwise, a standard API error
  3861.                code.
  3862.             See Also:
  3863.                haGetHWND
  3864.  
  3865.  
  3866. haOpenSession
  3867.  
  3868.             Opens an existing phonebook entry. In HAOS2, displays the
  3869.             Terminal panel. In HAWin, opens a new session window.
  3870.             Syntax:
  3871.                HSESS haOpenSession(ScriptHandle, pszName)
  3872.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3873.                  LPSTR pszName       Name of a session file
  3874.             Arguments:
  3875.                ScriptHandle
  3876.                  The script handle returned from haInitialize.
  3877.                pszName
  3878.                  The path and filename of the session file to use.
  3879.             Remarks:
  3880.                The session is not connected when it is initially opened.
  3881.                The newly opened session becomes the current session for the
  3882.                script. In HAWin, a script can interact with several
  3883.                sessions simultaneously by storing the session handles in
  3884.                variables and using haSetSession to move among them. In
  3885.                HAOS2, there is only one session for each instance of
  3886.                HyperACCESS, so you must call haInitialize for each instance
  3887.                and use the correct script handle.
  3888.             Return Value:
  3889.                Returns a session handle if successful. Otherwise, a
  3890.                standard API error code.
  3891.             See Also:
  3892.                haCloseSession, haConnectSession, haGetPhonebookEntry,
  3893.                haGetSession, haInitialize, haSetSession
  3894.  
  3895.  
  3896. haReleaseRemoteInput
  3897.  
  3898.             Decrements the counter used to determine how and when a
  3899.             session processes characters.
  3900.             Syntax:
  3901.                INT haReleaseRemoteInput(ScriptHandle)
  3902.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3903.             Arguments:
  3904.                ScriptHandle
  3905.                  The script handle returned from haInitialize.
  3906.             Remarks:
  3907.                When the counter is greater than zero, a session does not
  3908.                process characters. When the counter is zero, a session
  3909.                processes characters. When a session is opened, the count is
  3910.                set to zero. If a script is run from within a session, the
  3911.                counter is incremented. If the script exits from within a
  3912.                session, the counter is decremented.
  3913.                If you create a script that doesn't process received
  3914.                characters using functions such as haGetInput or
  3915.                haWaitForPrompt, and you want the current session to
  3916.                continue to process received data normally, you must call
  3917.                haReleaseRemoteInput for the session.
  3918.                If you create scripts that change control among several
  3919.                sessions using haSetSession, you can use haBlockRemoteInput
  3920.                and haReleaseRemoteInput to control when the sessions
  3921.                process received data. This ensures that your script doesn't
  3922.                miss any characters.
  3923.                If you have multiple scripts for one session, only one
  3924.                script at a time should process received data using
  3925.                haGetInput or haWaitForPrompt. The others should use
  3926.                haReleaseRemoteInput, otherwise data remains blocked.
  3927.             Return Value:
  3928.                Returns 0 if successful. Otherwise, a standard API error
  3929.                code.
  3930.             See Also:
  3931.                haBlockRemoteInput
  3932.  
  3933.  
  3934. haReloadPhonebook
  3935.  
  3936.             Causes HyperACCESS to rescan for Phonebook files.
  3937.             Syntax:
  3938.                INT haReloadPhonebook(ScriptHandle)
  3939.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3940.             Arguments:
  3941.                ScriptHandle
  3942.                  The script handle returned from haInitialize.
  3943.             Remarks:
  3944.                This function is useful to notify HyperACCESS that something
  3945.                in Phonebook has changed. If you add or remove session files
  3946.                from the phonebook directory or modify session files
  3947.                directly, you can use this function to force HyperACCESS to
  3948.                redisplay the phonebook with the changes.
  3949.             Return Value:
  3950.                Returns 0 if successful. Otherwise, a standard API error
  3951.                code.
  3952.             See Also:
  3953.                haGetPhonebookEntry
  3954.  
  3955.  
  3956. haSavePhonebook
  3957.  
  3958.             Writes the HyperACCESS preferences file to disk.
  3959.             Syntax:
  3960.                INT haSavePhonebook(ScriptHandle)
  3961.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3962.             Arguments:
  3963.                ScriptHandle
  3964.                  The script handle returned from haInitialize.
  3965.             Remarks:
  3966.                HyperACCESS stores program-wide settings. It keeps this
  3967.                information in memory while it is running, and writes these
  3968.                settings to the disk file as it exits. This function writes
  3969.                these settings immediately.
  3970.             Return Value:
  3971.                Returns 0 if successful. Otherwise, a standard API error
  3972.                code.
  3973.             See Also:
  3974.                haReloadPhonebook
  3975.  
  3976.  
  3977. haSelectDialingPrefix
  3978.  
  3979.             Specifies the dialing prefix that is to be used by the current
  3980.             session.
  3981.             Syntax:
  3982.                INT haSelectDialingPrefix(ScriptHandle, nIndex)
  3983.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  3984.                  INT nIndex          Which prefix to use
  3985.             Arguments:
  3986.                ScriptHandle
  3987.                  The script handle returned from haInitialize.
  3988.                nIndex
  3989.                  Specifies which prefix to use. A value of zero means no
  3990.                  prefix is used. Valid choices are 1 - 9.
  3991.             Remarks:
  3992.                HyperACCESS uses the dialing prefix as part of the phone
  3993.                number when it attempts to establish a connection.
  3994.             Return Value:
  3995.                Returns 0 if successful. Otherwise, a standard API error
  3996.                code.
  3997.             See Also:
  3998.                haGetDialingPrefix, haSetDialingPrefix
  3999.             Example:
  4000.             /* -----------------------------------------------------------
  4001.                          --------- */
  4002.             
  4003.             /* Select dialing prefix.
  4004.                         This program segment:
  4005.                            - Selects the first dialing prefix as the one
  4006.                          to use
  4007.                              for this session */
  4008.             
  4009.                         ReturnCode = haSelectDialingPrefix(ScriptHandle,
  4010.                          1);
  4011.             
  4012.             /* -----------------------------------------------------------
  4013.                          --------- */
  4014.  
  4015.  
  4016. haSetAdlOverride
  4017.  
  4018.             Changes the automatic download override setting.
  4019.             Syntax:
  4020.                INT haSetAdlOverride(ScriptHandle, nFlag)
  4021.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4022.                  INT nFlag           The new setting of the automatic
  4023.                                       download override switch
  4024.             Arguments:
  4025.                ScriptHandle
  4026.                  The script handle returned from haInitialize.
  4027.                nFlag
  4028.                  If TRUE (non-zero), the automatic download feature for
  4029.                  Hyperprotocol, and ZModem transfers is disabled. If FALSE
  4030.                  (zero), the automatic download capability is controlled
  4031.                  by user settings available in the interface.
  4032.             Remarks:
  4033.                This override of the setting in the HyperProtocol Settings
  4034.                and Zmodem Settings dialog boxes is not available from the
  4035.                user interface. This override is available only when
  4036.                controlling HyperACCESS from an external program. It allows
  4037.                you to disable the automatic downloading capabilities built
  4038.                into HyperACCESS to avoid situations where an automatic
  4039.                download might compromise security restrictions built into a
  4040.                program.
  4041.             Return Value:
  4042.                Returns 0 if successful. Otherwise, a standard API error
  4043.                code.
  4044.             Example:
  4045.             /* -----------------------------------------------------------
  4046.                          --------- */
  4047.             
  4048.             /* Turn off automatic download feature of Zmodem and
  4049.                          HyperProtocol. */
  4050.             
  4051.                         ReturnCode = haSetAdlOverride(ScriptHandle, TRUE);
  4052.             
  4053.             /* -----------------------------------------------------------
  4054.                          --------- */
  4055.  
  4056.  
  4057. haSetAsciiSettings
  4058.  
  4059.             Change settings that are found in the ASCII Settings dialog
  4060.             box.
  4061.             Syntax:
  4062.                INT haSetAsciiSettings(ScriptHandle, nCount, pnData)
  4063.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4064.                  INT nCount          The number of integers that follow
  4065.                  INT FAR *pnData     A pointer to an array of integers
  4066.             Arguments:
  4067.                ScriptHandle
  4068.                  The script handle returned from haInitialize.
  4069.                nCount
  4070.                  The number of integers that are in the pnData array.
  4071.                pnData
  4072.                  A pointer to an array of integers that are used to set
  4073.                  ASCII settings values. Each array element sets a
  4074.                  different value and can be indexed by the following
  4075.                  constants:
  4076.                  Value       Meaning
  4077.                  HA_AI_FLAGS Various individual flags(bits), described
  4078.                               below.
  4079.                  HA_AI_WFCHARInput wait for character.
  4080.                  HA_AI_OTABS Output tab expansion value.
  4081.                  HA_AI_CWAIT Character delay value.
  4082.                  HA_AI_LWAIT Line delay value.
  4083.                  HA_AI_ITABS Input tab conversion value.
  4084.                  The following flags(bits) are used in the HA_AI_FLAGS
  4085.                  word to set the state of individual check box items:
  4086.                  Value       Meaning
  4087.                  HA_AFS_LF   Append LF to sent line ends.
  4088.                  HA_AFS_BLS  Expand blank lines sent to include a space.
  4089.                  HA_AFS_ECHO Echo typed characters locally.
  4090.                  HA_AFS_WAIT Enable wait for line end character.
  4091.                  HA_AFS_TABS Enable tab expansion for sent characters.
  4092.                  HA_AFR_LF   Append LF to received line ends.
  4093.                  HA_AFR_7BIT Force incoming characters to 7 bits.
  4094.                  HA_AFR_ECHO Echo received characters to sender.
  4095.                  HA_AFR_WRAP Wrap lines that exceed terminal width.
  4096.                  HA_AFR_HEX  Show hex value of non-printing characters.
  4097.             Remarks:
  4098.                The integer at index HA_AI_FLAGS has individual flags
  4099.                (bits), which are either TRUE (1) or FALSE (0). Setting the
  4100.                value of individual bits is a language dependent operation.
  4101.                You can set the value of a particular bit by performing a
  4102.                bitwise OR operation. You can also add all the flagnames
  4103.                that you want set (TRUE) and assign the result to the array
  4104.                location identified by HA_AI_FLAGS.
  4105.             Return Value:
  4106.                Returns 0 if successful. Otherwise, a standard API error
  4107.                code.
  4108.             See Also:
  4109.                haGetAsciiSettings
  4110.             Example:
  4111.             /* -----------------------------------------------------------
  4112.                          --------- */
  4113.             
  4114.             /* Set ASCII Settings for a communications session.
  4115.             This program segment sets HyperACCESS to:
  4116.                - Append LF to sent lines.
  4117.                - Expand blank lines to include a space.
  4118.                - Append LF to received line ends.        */
  4119.             
  4120.             nSettings =                                   HA_AFS_LF  |
  4121.   HA_AFS_BLS | HA_AFR_LF;
  4122.             
  4123.             haSetAsciiSettings(hScriptHandle, 3, &nSettings);
  4124.             
  4125.             /* -----------------------------------------------------------
  4126.                          --------- */
  4127.  
  4128.  
  4129. haSetBaudRate
  4130.  
  4131.             Changes the speed, generally referred to as the baud rate, of
  4132.             the communications device associated with the current session.
  4133.             The port type of the communications device determines the
  4134.             range of acceptable values.
  4135.             Syntax:
  4136.                INT haSetBaudRate(ScriptHandle, lSpeed)
  4137.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4138.                  LONG lSpeed         The new speed for the device
  4139.             Arguments:
  4140.                ScriptHandle
  4141.                  The script handle returned from haInitialize.
  4142.                lSpeed
  4143.                  The new speed for the device.
  4144.             Remarks:
  4145.                Some device types do not need a baud rate setting. For those
  4146.                that don't, this setting is ignored. For those that do, it
  4147.                is checked when a connection is attempted.
  4148.             Return Value:
  4149.                Returns 0 if successful. Otherwise, a standard API error
  4150.                code.
  4151.             See Also:
  4152.                haGetBaudRate
  4153.             Example:
  4154.             /* -----------------------------------------------------------
  4155.                          --------- */
  4156.             
  4157.             /* Change the baud rate of the current session.
  4158.                            - This program segment sets the baud rate to
  4159.                          19,200. */
  4160.             
  4161.                         ReturnCode = haSetBaudRate(ScriptHandle, 19200L);
  4162.             
  4163.             /* -----------------------------------------------------------
  4164.                          --------- */
  4165.  
  4166.  
  4167. haSetCaptureFileName
  4168.  
  4169.             Changes the default name of the capture file for the currently
  4170.             active session.
  4171.             Syntax:
  4172.                INT haSetCaptureFileName(ScriptHandle, pszPtr)
  4173.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4174.                  LPSTR pszPtr        A pointer to a path and filename
  4175.             Arguments:
  4176.                ScriptHandle
  4177.                  The script handle returned from haInitialize.
  4178.                pszPtr
  4179.                  A pointer to a string containing the new capture path and
  4180.                  filename.
  4181.             Remarks:
  4182.                
  4183.             Return Value:
  4184.                Returns 0 if successful. Otherwise, a standard API error
  4185.                code.
  4186.             See Also:
  4187.                haCaptureBegin, haCaptureControl, haGetCaptureFileName
  4188.             Example:
  4189.             /* -----------------------------------------------------------
  4190.                          --------- */
  4191.             
  4192.             /* Set capture filename.
  4193.             This program segment:
  4194.                - Sets a string to a program defined path and filename.
  4195.                - Calls haSetCaptureFileName to set the name.   */
  4196.             
  4197.             strcpy(szFilename, "C:\\HAOS2\\HAOS2.CAP");
  4198.             
  4199.             ReturnCode = haSetCaptureFileName(hScriptHandle, szFilename);
  4200.             
  4201.             /* -----------------------------------------------------------
  4202.                          --------- */
  4203.  
  4204.  
  4205. haSetConnectionDetails
  4206.  
  4207.             Changes the connection details associated with a connection
  4208.             key handle.
  4209.             Syntax:
  4210.                INT haSetConnectionDetails(ScriptHandle, hCnctKey,
  4211.                pszDetails)
  4212.                  SCRIPTHANDLE ScriptHandleThe program - HAOS2 link
  4213.                  HKCNCT hCnctKey     A connection key handle
  4214.                  LPSTR pszDetails    A pointer to a buffer
  4215.             Arguments:
  4216.                ScriptHandle
  4217.                  The script handle returned from haInitialize.
  4218.                hCnctKey
  4219.                  A connection key handle returned from
  4220.                  haGetCurrentConnection, haGetDefaultConnection, or
  4221.                  haCreateConnection.
  4222.                pszDetails
  4223.                  A null-terminated string containing new connection
  4224.                  details.
  4225.             Remarks:
  4226.             For details on the buffer format, see haGetConnectionDetails.
  4227.             This function is supported in HAOS2.
  4228.             Return Value:
  4229.             Returns 0 if successful. Otherwise, a standard API error code.
  4230.             See also:
  4231.                haCreateConnection, haDeleteConnection, haFindComTypes,
  4232.                haFindConnection, haFindConnectionTypes,
  4233.                haFindConnectionTypeDevices, haGetConnectionDetails,
  4234.                haGetCurrentConnection, haGetDefaultConnection,
  4235.                haSetCurrentConnection
  4236.  
  4237.  
  4238. haSetCurrentConnection
  4239.  
  4240.             Set the connection handle used by the currently opened
  4241.             session.
  4242.             Syntax:
  4243.                INT haSetCurrentConnection(ScriptHandle, hCnctKey)
  4244.                  SCRIPTHANDLE ScriptHandleThe program - HAOS2 link
  4245.                  HKCNCT hCnctKey     The connection key handle to use
  4246.             Arguments:
  4247.                ScriptHandle
  4248.                  The script handle returned from haInitialize.
  4249.                hCnctKey
  4250.                  A connection key handle returned from
  4251.                  haGetCurrentConnection, haGetDefaultConnection, or
  4252.                  haCreateConnection.
  4253.             Remarks:
  4254.             This function is supported in HAOS2.
  4255.             Return Value:
  4256.             Returns 0 if successful. Otherwise, a standard API error code.
  4257.             See also:
  4258.                haCreateConnection, haDeleteConnection, haFindComTypes,
  4259.                haFindConnection, haFindConnectionTypes,
  4260.                haFindConnectionTypeDevices, haGetConnectionDetails,
  4261.                haGetCurrentConnection, haGetDefaultConnection,
  4262.                haSetConnectionDetails
  4263.  
  4264.  
  4265. haSetCursorPosition
  4266.  
  4267.             Positions the cursor on the emulator screen.
  4268.             Syntax:
  4269.                INT haSetCursorPosition(ScriptHandle, nRow, nCol)
  4270.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4271.                  INT nRow            The row number
  4272.                  INT nCol            The column number
  4273.             Arguments:
  4274.                ScriptHandle
  4275.                  The script handle returned from haInitialize.
  4276.                nRow
  4277.                  The row number of the new cursor position.
  4278.                nCol
  4279.                  The column number of the new cursor position.
  4280.             Remarks:
  4281.                Row and column numbers start at zero and are limited by the
  4282.                emulator.
  4283.             Return Value:
  4284.                Returns 0 if successful. Otherwise, a standard API error
  4285.                code.
  4286.             See Also:
  4287.                haGetCursorPosition, haGetTextFromScreen
  4288.  
  4289.  
  4290. haSetDialingPrefix
  4291.  
  4292.             Sets one of the dialing prefix strings stored by HyperACCESS.
  4293.             Syntax:
  4294.                INT haSetDialingPrefix(ScriptHandle, nIndex, pszPtr)
  4295.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4296.                  INT nIndex          Which string to change
  4297.                  LPSTR pszPtr        A pointer to the new string
  4298.             Arguments:
  4299.                ScriptHandle
  4300.                  The script handle returned from haInitialize.
  4301.                nIndex
  4302.                  Which string to change. Valid choices are 1 thru 9.
  4303.                pszPtr
  4304.                  A pointer to a string containing the new prefix string.
  4305.             Remarks:
  4306.                Dialing prefix strings are stored globally in the
  4307.                preferences file, and all sessions use the same set of
  4308.                strings. If, for example, string 1 is changed from within a
  4309.                particular session, all sessions that use dialing prefix
  4310.                string 1 will be affected.
  4311.             Return Value:
  4312.                Returns 0 if successful. Otherwise, a standard API error
  4313.                code.
  4314.             See Also:
  4315.                haGetDialingPrefix, haSelectDialingPrefix
  4316.             Example:
  4317.             /* -----------------------------------------------------------
  4318.                          --------- */
  4319.             
  4320.             /* Changes a dialing prefix to a new value.
  4321.                         This program segment:
  4322.                            - Changes the first dialing prefix (for all
  4323.                          sessions) to "1-313" */
  4324.             
  4325.                         ReturnCode = haSetDialingPrefix(ScriptHandle, 1,
  4326.                          "1-313");
  4327.             
  4328.             /* -----------------------------------------------------------
  4329.                          --------- */
  4330.  
  4331.  
  4332. haSetDisplay
  4333.  
  4334.             Changes display mode of the Phonebook.
  4335.             Syntax:
  4336.                INT haSetDisplay(ScriptHandle, nMode)
  4337.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4338.                  INT nMode           The mode to change to
  4339.             Arguments:
  4340.                ScriptHandle
  4341.                  The script handle returned from haInitialize.
  4342.                nMode
  4343.                  The valid display modes are:
  4344.                  Value       Meaning
  4345.                  HA_ICONIC   The Phonebook will be displayed as icons.
  4346.                  HA_STATS    The Statistics view will be displayed in the
  4347.                               Phonebook.
  4348.                  HA_DETAILS  The Details view will be displayed in the
  4349.                               Phonebook.
  4350.                  HA_NAMES    The Phonebook will be displayed as system
  4351.                               names.
  4352.                  HA_FILES    The Phonebook will be displayed as filenames.
  4353.             Remarks:
  4354.                Changing the display mode of the phonebook causes the
  4355.                phonebook window to redisplay with the proper format.
  4356.             Return Value:
  4357.                Returns 0 if successful. Otherwise, a standard API error
  4358.                code.
  4359.             See Also:
  4360.                haGetDisplay
  4361.  
  4362.  
  4363. haSetEcho
  4364.  
  4365.             Enables and disables echo of received characters.
  4366.             Syntax:
  4367.                INT haSetEcho(ScriptHandle, nEcho)
  4368.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4369.                  INT nEcho           To echo or not to echo
  4370.             Arguments:
  4371.                ScriptHandle
  4372.                  The script handle returned from haInitialize.
  4373.                nEcho
  4374.                  If the value is TRUE, echoing is enabled. If it is FALSE,
  4375.                  echoing is disabled.
  4376.             Remarks:
  4377.                When this setting is TRUE, every character received from a
  4378.                remote system is transmitted back to the remote system for
  4379.                display. This setting is normally set to TRUE only when
  4380.                HyperACCESS is serving as a host system.
  4381.             Return Value:
  4382.                Returns 0 if successful. Otherwise, a standard API error
  4383.                code.
  4384.             See Also:
  4385.                haSetLocalEcho
  4386.             Example:
  4387.             /* -----------------------------------------------------------
  4388.                          --------- */
  4389.             
  4390.             /* Set character echo for half duplex operation.
  4391.                         This program segment:
  4392.                            - Disables echo of characters received.
  4393.                            - Enables echo of characters sent so they
  4394.                          display locally. */
  4395.             
  4396.                         ReturnCode = haSetEcho(ScriptHandle, FALSE);
  4397.                         ReturnCode = haSetLocalEcho(ScriptHandle, TRUE);
  4398.             
  4399.             /* -----------------------------------------------------------
  4400.                          --------- */
  4401.  
  4402.  
  4403. haSetEmulator
  4404.  
  4405.             Changes the emulator that is used by the currently active
  4406.             session.
  4407.             Syntax:
  4408.                INT haSetEmulator(ScriptHandle, pszPtr)
  4409.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4410.                  LPSTR pszPtr        A pointer to the new emulator
  4411.             Arguments:
  4412.                ScriptHandle
  4413.                  The script handle returned from haInitialize.
  4414.                pszPtr
  4415.                  A pointer to a string containing the name of the new
  4416.                  emulator.
  4417.             Remarks:
  4418.                Only valid emulator names are accepted. The type of emulator
  4419.                loaded determines how HyperACCESS decodes received control
  4420.                sequences.
  4421.             Return Value:
  4422.                Returns 0 if successful. Otherwise, a standard API error
  4423.                code.
  4424.             See Also:
  4425.                haGetEmulator
  4426.  
  4427.  
  4428. haSetLearnFileName
  4429.  
  4430.             Changes the default name of the learn file(script) for the
  4431.             currently active session.
  4432.             Syntax:
  4433.                INT haSetLearnFileName(ScriptHandle, pszPtr)
  4434.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4435.                  LPSTR pszPtr        A ponter to a filename
  4436.             Arguements:
  4437.                ScriptHandle
  4438.                  The script handle returned from haInitialize.
  4439.                pszPtr
  4440.                  A pointer to a string containing the new learn filename.
  4441.             Remarks:
  4442.                
  4443.             Return Value:
  4444.                Returns 0 if successful. Otherwise a standard API error
  4445.                code.
  4446.             See Also:
  4447.                haGetLearnFileName, haSetCaptureFileName
  4448.  
  4449.  
  4450. haSetLocalDisplay
  4451.  
  4452.             Enable or disable display of data on the local emulator
  4453.             screen.
  4454.             Syntax:
  4455.                INT haSetLocalDisplay(ScriptHandle, nFlag)
  4456.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4457.                  INT nFlag           The local display flag.
  4458.             Arguments:
  4459.                ScriptHandle
  4460.                  The script handle returned from haInitialize.
  4461.                nFlag
  4462.                  If TRUE, displays all characters on the local emulator
  4463.                  screen. If FALSE, suppresses display.
  4464.             Remarks:
  4465.                If FALSE, will suppress display of both incoming and locally
  4466.                echoed characters.
  4467.             Return Value:
  4468.                Returns 0 if successful. Otherwise, a standard API error
  4469.                code.
  4470.             See Also:
  4471.             Example:
  4472.             /* -----------------------------------------------------------
  4473.                          --------- */
  4474.             
  4475.             /* Hide received characters.
  4476.                         This program segment:
  4477.                            - Disables display of received characters.
  4478.                            - Waits for a carriage return (or 30 seconds).
  4479.                            - Enables display of received characters after
  4480.                          one line */
  4481.             
  4482.                         ReturnCode = haSetLocalDisplay(ScriptHandle,
  4483.                          TRUE);
  4484.                         ReturnCode = haWaitForLines(ScriptHandle, 1,
  4485.                          30000L);
  4486.                         ReturnCode = haSetLocalDisplay(ScriptHandle,
  4487.                          FALSE);
  4488.             
  4489.             /* -----------------------------------------------------------
  4490.                          --------- */
  4491.  
  4492.  
  4493. haSetLocalEcho
  4494.  
  4495.             Enable or disables local display of transmitted characters.
  4496.             Syntax:
  4497.                INT haSetLocalEcho(ScriptHandle, nEcho)
  4498.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4499.                  INT nEcho           To echo or not to echo
  4500.             Arguments:
  4501.                ScriptHandle
  4502.                  The script handle returned from haInitialize.
  4503.                nEcho
  4504.                  If TRUE, transmitted characters are displayed locally. If
  4505.                  FALSE, transmitted characters are not diplayed unless
  4506.                  they are echoed back by the remote system.
  4507.             Remarks:
  4508.                
  4509.             Return Value:
  4510.                Returns 0 if successful. Otherwise, a standard API error
  4511.                code.
  4512.             See Also:
  4513.                haSetEcho
  4514.  
  4515.  
  4516. haSetLogFileName
  4517.  
  4518.             Changes the name of the log file for the currently active
  4519.             session.
  4520.             Syntax:
  4521.                INT haSetLogFileName(ScriptHandle, pszPtr)
  4522.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4523.                  LPSTR pszPtr        A pointer to the new path and
  4524.                                       filename
  4525.             Arguments:
  4526.                ScriptHandle
  4527.                  The script handle returned from haInitialize.
  4528.                pszPtr
  4529.                  A pointer to a string containing the new log file path
  4530.                  and filename.
  4531.             Remarks:
  4532.                All calls and file transfers are recorded in the log file.
  4533.             Return Value:
  4534.                Returns 0 if successful. Otherwise, a standard API error
  4535.                code.
  4536.             See Also:
  4537.                haGetLogFileName
  4538.  
  4539.  
  4540. haSetLogonTask
  4541.  
  4542.             Sets the task that is run when the currently active session
  4543.             successfully completes a connection.
  4544.             Syntax:
  4545.                INT haSetLogonTask(ScriptHandle, pszPtr)
  4546.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4547.                  LPSTR pszPtr        A pointer to a path and filename
  4548.             Arguments:
  4549.                ScriptHandle
  4550.                  The script handle returned from haInitialize.
  4551.                pszPtr
  4552.                  A pointer to a string containing the new path and
  4553.                  filename.
  4554.             Remarks:
  4555.                Normally, a logon task calls haInitialize and runs as a
  4556.                script, however, any executable file can be run.
  4557.             Return Value:
  4558.                Returns 0 if successful. Otherwise, a standard API error
  4559.                code.
  4560.             Example:
  4561.             /* -----------------------------------------------------------
  4562.                          --------- */
  4563.             
  4564.             /* Set connect program for the current session. */
  4565.             
  4566.                         ReturnCode = haSetLogonTask(ScriptHandle,
  4567.                          "C:\\MYDIR\\BOB.C");
  4568.             
  4569.             /* -----------------------------------------------------------
  4570.                          --------- */
  4571.  
  4572.  
  4573. haSetMessageTimer
  4574.  
  4575.             Sets a timer for dismissing message boxes that report errors
  4576.             and unusual conditions.
  4577.             Syntax:
  4578.                INT haSetMessageTimer(ScriptHandle, nSeconds)
  4579.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4580.                  INT nSeconds        The number of seconds before timeout
  4581.             Arguments:
  4582.                ScriptHandle
  4583.                  The script handle returned from haInitialize.
  4584.                nSeconds
  4585.                  The number of seconds before timeout. A value of zero (0)
  4586.                  means that the message box is not displayed at all. A
  4587.                  value of minus one (-1) means no timeout is to be used
  4588.                  and the message box will be displayed until the user
  4589.                  responds to it. Minus one (-1) is the initial session
  4590.                  default.
  4591.             Remarks:
  4592.                An external task can perform most of the operations that a
  4593.                user can perform. One of the few exceptions is dismissing
  4594.                message boxes that report errors and unusual conditions.
  4595.                This function changes the way standard HyperACCESS message
  4596.                boxes function by setting a timeout value. If no user
  4597.                interaction dismisses the message box within the timeout
  4598.                value, the box times out and dismisses itself. Each message
  4599.                box attempts to perform an appropriate action upon timeout.
  4600.                The timeout affects only the current session and is valid
  4601.                for as long as the session lasts, even if the script
  4602.                terminates before the session is closed.
  4603.             Return Value:
  4604.                Returns 0 if successful. Otherwise, a standard API error
  4605.                code.
  4606.             Example:
  4607.             /* -----------------------------------------------------------
  4608.                          --------- */
  4609.             
  4610.             /* Dismiss message boxes after fixed period of time.
  4611.               This lets a user respond, or continues with default actions
  4612.                          if no user
  4613.                response received in fixed time interval (10 seconds, in
  4614.                          example). */
  4615.             
  4616.                         ReturnCode = haSetMessageTimer(ScriptHandle, 10);
  4617.             /* -----------------------------------------------------------
  4618.                          --------- */
  4619.  
  4620.  
  4621. haSetNameString
  4622.  
  4623.             Sets the internal HyperACCESS user name and address field.
  4624.             Syntax:
  4625.                INT haSetNameString(ScriptHandle, pszPtr)
  4626.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4627.                  LPSTR pszPtr        A pointer to the new string
  4628.             Arguments:
  4629.                ScriptHandle
  4630.                  The script handle returned from haInitialize.
  4631.                pszPtr
  4632.                  A pointer to a string. This string is six lines in HAWin
  4633.                  and seven lines in HAOS2. Each line is terminated by a
  4634.                  carriage return - line feed pair. The first line is the
  4635.                  name line. The second line is the company line. The third
  4636.                  line is the street address. The fourth line is the city.
  4637.                  The fifth line is the state. The sixth line is the zip
  4638.                  code. The seventh line is country.
  4639.             Remarks:
  4640.                These values are normally established by the setup program
  4641.                at installation.
  4642.             Return Value:
  4643.                Returns 0 if successful. Otherwise, a standard API error
  4644.                code.
  4645.             See Also:
  4646.                haGetNameString
  4647.             Example:
  4648.             /* -----------------------------------------------------------
  4649.                          --------- */
  4650.             
  4651.             /* Set the User name and address information.
  4652.             
  4653.             This program segment:
  4654.                - Defines a character string variable.
  4655.                - Sets the variable to the name and address desired.
  4656.                - Sets the internal HyperACCESS user name and address
  4657.   field.
  4658.                - This example assumes the HAOS2 definition that includes
  4659.                  a country field.   */
  4660.             
  4661.             char szNameString[128];       // Variable to store the name
  4662.   string
  4663.             
  4664.             strcpy(szNameString, "Mr. Joel Pendergast\r\n"
  4665.                                 "Pendergast Consulting\r\n"
  4666.                                 "123 Main St.\r\n"
  4667.                                 "Anywhere\r\n"
  4668.                                 "MI\r\n"
  4669.                                 "48999\r\n"
  4670.                                 "USA\r\n");
  4671.             ReturnValue = haSetNameString(hScriptHandle, szNameString);
  4672.             
  4673.             /* -----------------------------------------------------------
  4674.                          --------- */
  4675.  
  4676.  
  4677. haSetPortMode
  4678.  
  4679.             Changes current settings for number of bits per character,
  4680.             number of parity bits, and parity type.
  4681.             Syntax:
  4682.                INT haSetPortMode(ScriptHandle, nMode)
  4683.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4684.                  INT nMode           Flags for the new settings
  4685.             Arguments:
  4686.                ScriptHandle
  4687.                  The script handle returned from haInitialize.
  4688.                nMode
  4689.                  The mode is set by ORing selected flags together:
  4690.                  Value       Meaning
  4691.                  HA_M_AUTO   Auto-detect is set.
  4692.                  HA_M_7_BITS Characters contain 7 bits.
  4693.                  HA_M_8_BITS Characters contain 8 bits.
  4694.                  HA_M_E_PRTY Characters have even parity.
  4695.                  HA_M_O_PRTY Characters have odd parity.
  4696.                  HA_M_N_PRTY Characters have no parity.
  4697.                  HA_M_M_PRTY Characters have mark parity.
  4698.                  HA_M_S_PRTY Characters have space parity.
  4699.                  HA_M_1_STOP Characters have one stop bit.
  4700.                  HA_M_1_5_STOP    Characters have 1.5 stop bits.
  4701.                  HA_M_2_STOP Characters have two stop bits.
  4702.             Remarks:
  4703.                The integer nMode has individual flags (bits) which are
  4704.                either TRUE (1) or FALSE (0). Setting the value of
  4705.                individual bits is language dependent. However, in C, you
  4706.                can set the value of a particular bit by performing a
  4707.                bitwise OR operation of nMode with the desired flag name
  4708.                defined above. You can also add all the flagnames that you
  4709.                want set (TRUE) and assign the result to nMode.
  4710.                For example:
  4711.         
  4712.               haSetPortMode(ScriptHandle, HA_M_8BITS + HA_M_N_PRTY +
  4713.                         HA_M_1_STOP);
  4714.             Return Value:
  4715.                Returns 0 if successful. Otherwise, a standard API error
  4716.                code.
  4717.             See Also:
  4718.                haGetPortMode
  4719.             Example:
  4720.             /* -----------------------------------------------------------
  4721.                          --------- */
  4722.             
  4723.             /* Change communications parameters.
  4724.                         This program segment:
  4725.                            - Sets the port mode to 8 bit, no parity, 1
  4726.                          stop bit.
  4727.                            - Sets the port name to "COM1".
  4728.                            - Sets the port type to "Standard COM Port".
  4729.                          */
  4730.             
  4731.                         ReturnCode = haSetPortMode(ScriptHandle,
  4732.                          HA_M_8_BITS + HA_M_N_PRTY + HA_M_1_STOP);
  4733.                         ReturnCode = haSetPortName(ScriptHandle, "COM1");
  4734.                         ReturnCode = haSetPortType(ScriptHandle, "STANDARD
  4735.                          COM PORT");
  4736.             
  4737.             /* -----------------------------------------------------------
  4738.                          --------- */
  4739.  
  4740.  
  4741. haSetPortName
  4742.  
  4743.             Changes the device name that is associated with the currently
  4744.             active session.
  4745.             Syntax:
  4746.                INT haSetPortName(ScriptHandle, pszPtr)
  4747.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4748.                  LPSTR pszPtr        A pointer to the new name
  4749.             Arguments:
  4750.                ScriptHandle
  4751.                  The script handle returned from haInitialize.
  4752.                pszPtr
  4753.                  A pointer to a string containing the new name.
  4754.             Remarks:
  4755.                The setting for port type determines which values are
  4756.                acceptable as port names. For example, the port type
  4757.                Standard Com Port can have values such as COM1 and COM2.
  4758.                Other port types accept different names as appropriate. In
  4759.                general, HyperACCESS doesn't attempt to prescreen names.
  4760.                Instead, they are passed to the communications driver for
  4761.                verification. This function is only supported in HAWin.
  4762.             Return Value:
  4763.                Returns 0 if successful. Otherwise, a standard API error
  4764.                code.
  4765.             See Also:
  4766.                haGetPortName, haSetPortPrefs, haSetPortType
  4767.  
  4768.  
  4769. haSetPortPrefs
  4770.  
  4771.             Changes the connection device associated with a communications
  4772.             port.
  4773.             Syntax:
  4774.                INT haSetPortPrefs(ScriptHandle, pszType, pszName,
  4775.                pszDevice)
  4776.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4777.                  LPSTR pszType       A pointer to the port type
  4778.                  LPSTR pszName       A pointer to the port name
  4779.                  LPSTR pszDevice     A pointer to the commumications
  4780.                                       device
  4781.             Arguments:
  4782.                ScriptHandle
  4783.                  The script handle returned from haInitialize.
  4784.                pszType
  4785.                  A pointer to a string containing the device type.
  4786.                pszName
  4787.                  A pointer to a string containing the port name.
  4788.                pszDevice
  4789.                  A pointer to a string containing the connection device
  4790.                  name.
  4791.             Remarks:
  4792.                This function lets you set the three values that, together,
  4793.                define a connection path. The device type and port name can
  4794.                also be set by haSetPortType and haSetPortName,
  4795.                respectively. This function also lets you set the connection
  4796.                device (modem). Acceptable values for port name and
  4797.                connection device depend on the port type in use.
  4798.                Each session has an assigned port type and port name. The
  4799.                connection device name, however, is defined globally for
  4800.                each port type - port name combination. The user defines
  4801.                these combinations, and HyperACCESS stores them along with
  4802.                the connection devices associated with them. As a result,
  4803.                changing a connection device in one session impacts all
  4804.                sessions that use the same port type - port name
  4805.                combination. For example, if in the session MCI Mail, you
  4806.                specify that an XYZ SuperModem is attached to Standard Com
  4807.                Port, COM1, then any session that is set up to use Standard
  4808.                Com Port, COM1, will now also expect to use an XYZ
  4809.                SuperModem. This is supported in HAWin.
  4810.             Return Value:
  4811.                Returns 0 if successful. Otherwise, a standard API error
  4812.                code.
  4813.             See Also:
  4814.                haGetPortPrefs, haSetPortName, haSetPortType
  4815.             Example:
  4816.             /* -----------------------------------------------------------
  4817.                          --------- */
  4818.             
  4819.             /* Change communications parameters and modem.
  4820.                         This program segement:
  4821.                            - Uses one function call to set port name, port
  4822.                          type, and modem */
  4823.             
  4824.                         ReturnCode = haSetPortPrefs(ScriptHandle,
  4825.                          "STANDARD COM PORT", "COM1", "Amstrad Quad");
  4826.             
  4827.             /* -----------------------------------------------------------
  4828.                          --------- */
  4829.  
  4830.  
  4831. haSetPortType
  4832.  
  4833.             Changes the device type associated with the currently active
  4834.             session.
  4835.             Syntax:
  4836.                INT haSetPortType(ScriptHandle, pszPtr)
  4837.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4838.                  LPSTR pszPtr        A pointer to the device type
  4839.             Arguments:
  4840.                ScriptHandle
  4841.                  The context handle returned from haInitialize.
  4842.                pszPtr
  4843.                  A pointer to a string containing the device type.
  4844.             Remarks:
  4845.                HyperACCESS supports many types of communications devices.
  4846.                Each device type may consist of one or more actual ports.
  4847.                For example, if the port type is Standard Com Port, you may
  4848.                have COM1 and COM2 available as port names. Each port type
  4849.                is implemented as a driver module in a *.DLL file on the
  4850.                disk. Changing the port type changes the values acceptable
  4851.                as port name and connection device name (modem). This
  4852.                function is only supported in HAWin.
  4853.             Return Value:
  4854.                Returns 0 if successful. Otherwise, a standard API error
  4855.                code.
  4856.             See Also:
  4857.                haGetPortType
  4858.  
  4859.  
  4860. haSetPulseTone
  4861.  
  4862.             Sets the device dialing method to pulse or tone.
  4863.             Syntax:
  4864.                INT haSetPulseTone(ScriptHandle, nMode)
  4865.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4866.                  INT nMode           Select pulse or tone
  4867.             Arguments:
  4868.                ScriptHandle
  4869.                  The script handle returned from haInitialize.
  4870.                nMode
  4871.                  Valid values are:
  4872.                  Value       Meaning
  4873.                  HA_PT_PULSE Set to pulse mode dialing.
  4874.                  HA_PT_TONE  Set to tone mode dialing.
  4875.             Remarks:
  4876.                This setting will be used only by connection devices that
  4877.                place calls over dial-up phone lines.
  4878.             Return Value:
  4879.                Returns 0 if successful. Otherwise, a standard API error
  4880.                code.
  4881.             Example:
  4882.             /* -----------------------------------------------------------
  4883.                          --------- */
  4884.             
  4885.             /* Change dialing type to PULSE */
  4886.             
  4887.                         ReturnCode = haSetPulseTone(ScriptHandle,
  4888.                          HA_PT_PULSE);
  4889.             
  4890.             /* -----------------------------------------------------------
  4891.                          --------- */
  4892.  
  4893.  
  4894. haSetRingsForAnswer
  4895.  
  4896.             Changes the number of rings that the modem should wait before
  4897.             answering a call.
  4898.             Syntax:
  4899.                INT haSetRingsForAnswer(ScriptHandle, nCount)
  4900.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4901.                  INT nCount          The number of rings to wait
  4902.             Arguments:
  4903.                ScriptHandle
  4904.                  The script handle returned from haInitialize.
  4905.                nCount
  4906.                  The number of rings that the modem is instructed to wait
  4907.                  for before answering.
  4908.             Remarks:
  4909.                
  4910.             Return Value:
  4911.                Returns 0 if successful. Otherwise, a standard API error
  4912.                code.
  4913.             See Also:
  4914.                haConnectSession, haGetRingsForAnswer
  4915.             Example:
  4916.             /* -----------------------------------------------------------
  4917.                          --------- */
  4918.             
  4919.             /* Set the number of rings to answer the phone, and put modem
  4920.                          in answer mode.
  4921.                         This program segment:
  4922.                            - Sets the number of rings before answer to 3.
  4923.                            - Connects the session to its port in answer
  4924.                          mode. */
  4925.             
  4926.                         ReturnCode = haSetRingsForAnswer(ScriptHandle, 3);
  4927.                         ReturnCode = haConnectSession(ScriptHandle,
  4928.                          HA_CNCT_ANSWER_MODE);
  4929.             
  4930.             /* -----------------------------------------------------------
  4931.                          --------- */
  4932.  
  4933.  
  4934. haSetRuntimeValue
  4935.  
  4936.             Changes one of the runtime strings stored with each session.
  4937.             Syntax:
  4938.                INT haSetRuntimeValue(ScriptHandle, nValue, pszBuffer)
  4939.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4940.                  INT nValue          Which runtime string to set
  4941.                  LPSTR pszBuffer     A pointer to a buffer
  4942.             Arguments:
  4943.                ScriptHandle
  4944.                  The script handle returned from haInitialize.
  4945.                nValue
  4946.                  Which runtime string to return:
  4947.                  Value       Meaning
  4948.                  HA_RV_USERNAME   Set the user name.
  4949.                  HA_RV_USERIDSet the user ID.
  4950.                  HA_RV_PASSWORD   Set the password.
  4951.                pszBuffer
  4952.                  A pointer to a buffer that has the runtime string.
  4953.             Remarks:
  4954.                Unconditionally sets a stored runtime value without
  4955.                prompting the user.
  4956.             Return Value:
  4957.                Returns 0 if successful. Otherwise, a standard API error
  4958.                code.
  4959.  
  4960.  
  4961. haSetSession
  4962.  
  4963.             Changes the session handle that is accociated with the current
  4964.             program - HyperACCESS link.
  4965.             Syntax:
  4966.                INT haSetSession(ScriptHandle, hSession)
  4967.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  4968.                  HSESS hSession      A session handle
  4969.             Arguments:
  4970.                ScriptHandle
  4971.                  The script handle returned from haInitialize.
  4972.                hSession
  4973.                  A session handle returned by haGetSession or
  4974.                  haOpenSession.
  4975.             Remarks:
  4976.                The session handle identifies which session an external task
  4977.                is associated with. This is necessary because HAWin allows
  4978.                multiple concurrent communications sessions within the same
  4979.                task. In HAOS2, there is only one session for each instance
  4980.                of HyperACCESS.
  4981.                haSetSession doesn't save the session handle that was
  4982.                previously associated with the ScriptHandle, but a program
  4983.                can save the previous session handle in a variable and
  4984.                restore it later using haSetSession.
  4985.                If you write a program that attempts to control more than
  4986.                one session, you should read the remarks for functions
  4987.                haBlockRemoteInput and haReleaseRemoteInput.
  4988.             Return Value:
  4989.                Returns 0 if successful. Otherwise, a standard API error
  4990.                code.
  4991.             See Also:
  4992.                haBlockRemoteInput, haCloseSession, haGetSession,
  4993.                haOpenSession, haReleaseRemoteInput
  4994.  
  4995.  
  4996. haSetSessionDataString
  4997.  
  4998.             Sets one of the data strings stored with each session.
  4999.             Syntax:
  5000.                INT haSetSessionDataString(ScriptHandle, nIndex, pszPtr)
  5001.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5002.                  INT nIndex          Which string to set
  5003.                  LPSTR pszPtr        A pointer to a string
  5004.             Arguments:
  5005.                ScriptHandle
  5006.                  The script handle returned from haInitialize.
  5007.                nIndex
  5008.                  The index of the string to be set. Valid numbers are 0
  5009.                  thru 19.
  5010.                pszPtr
  5011.                  A pointer to the new string.
  5012.             Remarks:
  5013.                The first ten session data strings (0 - 9) are not stored in
  5014.                the session file and will be blank when a session is opened.
  5015.                The second ten (10 - 19) are available for general script
  5016.                use and are saved with the session. They can be used to
  5017.                store any values that should be maintained unchanged from
  5018.                one execution to the next.
  5019.             Return Value:
  5020.                Returns 0 if successful. Otherwise, a standard API error
  5021.                code.
  5022.             See Also:
  5023.                haGetSessionDataString
  5024.  
  5025.  
  5026. haSetStripTo7Bits
  5027.  
  5028.             Enables and disables stripping of received characters to 7
  5029.             bits.
  5030.             Syntax:
  5031.                INT haSetStripTo7Bits(ScriptHandle, nStrip)
  5032.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5033.                  INT nStrip          Enable or disable stripping
  5034.             Arguments:
  5035.                ScriptHandle
  5036.                  The script handle returned from haInitialize.
  5037.                nStrip
  5038.                  If TRUE, stripping is enabled. If FALSE, stripping is
  5039.                  disabled.
  5040.             Remarks:
  5041.                When this setting is TRUE, the high order bit of each
  5042.                received character is forced to zero prior to display. This
  5043.                is done regardless of the parity or data bits settings for
  5044.                the communications channel.
  5045.             Return Value:
  5046.                Returns 0 if successful. Otherwise, a standard API error
  5047.                code.
  5048.             See Also:
  5049.                haSetAsciiSettings (HA_AI_FLAGS value HA_AFR_7BIT)
  5050.  
  5051.  
  5052. haSetXferDirectory
  5053.  
  5054.             Changes one of the default transfer directories for the
  5055.             currently active session.
  5056.             Syntax:
  5057.                INT haSetXferDirectory(ScriptHandle, nDirection, pszPtr)
  5058.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5059.                  INT nDirection      Which directory to change
  5060.                  LPSTR pszPtr        A pointer to a string containing the
  5061.                                       directory path
  5062.             Arguments:
  5063.                ScriptHandle
  5064.                  The script handle returned from haInitialize.
  5065.                nDirection
  5066.                  Describes which directory to change:
  5067.                  Value       Meaning
  5068.                  HA_XFER_SENDSelects the sending directory.
  5069.                  HA_XFER_RECVSelects the receiving directory.
  5070.                pszPtr
  5071.                  A pointer to a string containing the new directory path.
  5072.             Remarks:
  5073.                
  5074.             Return Value:
  5075.                Returns 0 if successful. Otherwise, a standard API error
  5076.                code.
  5077.             See Also:
  5078.                haGetXferDirectory
  5079.  
  5080.  
  5081. haSetXferParameters
  5082.  
  5083.             Provides an integer value composed of flags (bits) that
  5084.             determine how a transfer operation is carried out.
  5085.             Syntax:
  5086.                INT haSetXferParameters(ScriptHandle, lParams)
  5087.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5088.                  LONG lParams        The new parameters
  5089.             Arguments:
  5090.                ScriptHandle
  5091.                  The script handle returned from haInitialize.
  5092.                lParams
  5093.                  The transfer parameters are describe by the following
  5094.                  flags which may be used to modify the current parameters:
  5095.                  Value             Meaning
  5096.                  XF_DN_MASK         A mask for the next 6 flags. These
  5097.                                     flags are used if the selected
  5098.                                     filename is already being used.
  5099.                  XF_DN_APPEND       Append if filename is already used.
  5100.                  XF_DN_OVERWRT      Overwrite if filename is already used.
  5101.                  XF_DN_REFUSE       Refuse the transfer if filename is
  5102.                                     already used.
  5103.                  XF_DN_NEWER        Overwrite if the received file is
  5104.                                     newer than the current file.
  5105.                  XF_DN_DATE         Generate a new filename based on the
  5106.                                     old name and the current date.
  5107.                  XF_DN_SEQ          Generate a new filename based on the
  5108.                                     old name and a sequence number.
  5109.                  XF_CHECK_VIRUS     Enable virus detection.
  5110.                  XF_USE_FILENAME    Use received filename in naming file.
  5111.                  XF_USE_DIRECTORY   Use received directory in naming file.
  5112.                  Value             Meaning
  5113.                  XF_SAVE_PARTIAL    Save partial file from interrupted
  5114.                                     transfer.
  5115.                  XF_USE_DATETIME    Use received file date and time.
  5116.             Remarks:
  5117.                The integer lParams has individual flags (bits), which are
  5118.                either TRUE (1) or FALSE (0). Setting the value of
  5119.                individual bits is a language dependent operation. You can
  5120.                set the value of a particular bit by performing a bitwise OR
  5121.                operation of lParams with the desired flag name defined
  5122.                above. You can also add all the flag names that you want set
  5123.                (TRUE) and assign the result to lParams.
  5124.             Return Value:
  5125.                Returns 0 if successful. Otherwise, a standard API error
  5126.                code.
  5127.             See Also:
  5128.                haGetXferParameters
  5129.             Example:
  5130.             /* -----------------------------------------------------------
  5131.                          --------- */
  5132.             
  5133.             /* Check a current transfer parameter, and changes its value.
  5134.                         This program segment:
  5135.                            - Gets a current transfer parameter (checks
  5136.                          append mask).
  5137.                            - Sets transfer parameter (to overwrite). */
  5138.             
  5139.                         ReturnCode = haGetXferParameters(ScriptHandle);
  5140.                         if (ReturnCode == XF_DN_APPEND)
  5141.                            ReturnCode = haSetXferParameters(ScriptHandle,
  5142.                          XF_DN_OVERWRT);
  5143.             
  5144.             /* -----------------------------------------------------------
  5145.                          --------- */
  5146.  
  5147.  
  5148. haSetXferProtocol
  5149.  
  5150.             Changes one of the default transfer protocols for the
  5151.             currently active session.
  5152.             Syntax:
  5153.                INT haSetXferProtocol(ScriptHandle, nDirection, nProtocol)
  5154.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5155.                  INT nDirection      Selects the direction
  5156.                  INT nProtocol       Selects the protocol
  5157.             Arguments:
  5158.                ScriptHandle
  5159.                  The script handle returned from haInitialize.
  5160.                nDirection
  5161.                  Describes which direction to change:
  5162.                  Value             Meaning
  5163.                  HA_XFER_SENDSets the sending protocol.
  5164.                  HA_XFER_RECVSets the receiving protocol.
  5165.                nProtocol
  5166.                  Select the new protocol
  5167.                  Value             Meaning
  5168.                  HA_HYPERP   Hilgraeves HyperProtocol.
  5169.                  HA_COMPUSERV_B   CompuServ B+.
  5170.                  HA_KERMIT   Kermit.
  5171.                  HA_XMODEM   XMODEM.
  5172.                  HA_XMODEM_1K1K XMODEM.
  5173.                  HA_YMODEM   YMODEM.
  5174.                  HA_YMODEM_G YMODEM-G.
  5175.                  HA_ZMODEM   ZMODEM.
  5176.             Remarks:
  5177.                
  5178.             Return Value:
  5179.                Returns 0 if successful. Otherwise, a standard API error
  5180.                code.
  5181.             See Also:
  5182.                haGetXferProtocol, haXferDropSend, haXferReceive,
  5183.                haXferSend, haXferSendBatch, haXferSendFromList,
  5184.                haXferSendList
  5185.             Example:
  5186.             /* -----------------------------------------------------------
  5187.                          --------- */
  5188.             
  5189.             /* Set the default receive protocol
  5190.                         This program segment:
  5191.                            - Sets the default receive protocol to
  5192.                          HyperProtocol. */
  5193.             
  5194.                         ReturnCode = haSetXferProtocol(ScriptHandle,
  5195.                          HA_XFER_RECV, HA_HYPERP);
  5196.             
  5197.             /* -----------------------------------------------------------
  5198.                          --------- */
  5199.  
  5200.  
  5201. haSizeHyperACCESS
  5202.  
  5203.             Changes the size and visibility of the HyperACCESS application
  5204.             window.
  5205.             Syntax:
  5206.                INT haSizeHyperACCESS(ScriptHandle, nMode)
  5207.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5208.                  INT nMode           What to do to the program
  5209.             Arguments:
  5210.                ScriptHandle
  5211.                  The script handle returned from haInitialize.
  5212.                nMode
  5213.                  The following GUI operations can be performed by
  5214.                  HyperACCESS:
  5215.                  Value       Meaning
  5216.                  HA_S_MAX    Maximize HyperACCESS.
  5217.                  HA_S_MIN    Minimize HyperACCESS.
  5218.                  HA_S_RSTR   Restore HyperACCESS.
  5219.                  HA_S_HIDE   Hide HyperACCESS.
  5220.             Remarks:
  5221.                
  5222.             Return Value:
  5223.                Returns 0 if successful. Otherwise, a standard API error
  5224.                code.
  5225.             See Also:
  5226.                haSizePhonebook, haSizeSession
  5227.             Example:
  5228.             /* -----------------------------------------------------------
  5229.                          --------- */
  5230.             
  5231.             /* Set HyperACCESS window sizes.
  5232.                         This program segment:
  5233.                            - Maximizes the HyperACCESS application
  5234.                          window.*/
  5235.             
  5236.                         ReturnCode = haSizeHyperACCESS(ScriptHandle,
  5237.                          HA_S_MAX);
  5238.             /* -----------------------------------------------------------
  5239.                          --------- */
  5240.  
  5241.  
  5242. haSizePhonebook
  5243.  
  5244.             Changes the size of the Phonebook window within HyperACCESS.
  5245.             Syntax:
  5246.                INT haSizePhonebook(ScriptHandle, nMode)
  5247.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5248.                  INT nMode           How to change the Phonebook
  5249.             Arguments:
  5250.                ScriptHandle
  5251.                  The script handle returned from haInitialize.
  5252.                nMode
  5253.                  The following Windows operations can be performed on the
  5254.                  Phonebook:
  5255.                  Value       Meaning
  5256.                  HA_S_MAX    Maximize the Phonebook.
  5257.                  HA_S_MIN    Minimize the Phonebook.
  5258.                  HA_S_RSTR   Restore the Phonebook.
  5259.             Remarks:
  5260.                Used in HAWin. Ignored in HAOS2 (always gives a successful
  5261.                return).
  5262.             Return Value:
  5263.                Returns 0 if successful. Otherwise, a standard API error
  5264.                code.
  5265.             See Also:
  5266.                haSizeHyperACCESS, haSizeSession
  5267.  
  5268.  
  5269. haSizeSession
  5270.  
  5271.             Changes the size of the currently active session window.
  5272.             Syntax:
  5273.                INT haSizeSession(ScriptHandle, nMode)
  5274.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5275.                  INT nMode           How to change the session
  5276.             Arguments:
  5277.                ScriptHandle
  5278.                  The script handle returned from haInitialize.
  5279.                nMode
  5280.                  The following Windows operations can be performed on the
  5281.                  session:
  5282.                  Value       Meaning
  5283.                  HA_S_MAX    Maximize the session.
  5284.                  HA_S_MIN    Minimize the session.
  5285.                  HA_S_RSTR   Restore the session.
  5286.             Remarks:
  5287.                Used in HAWin. Ignored in HAOS2 (always gives a successful
  5288.                return).
  5289.             Return Value:
  5290.                Returns 0 if successful. Otherwise, a standard API error
  5291.                code.
  5292.             See Also:
  5293.                haSizeHyperACCESS, haSizePhonebook
  5294.  
  5295.  
  5296. haSkipConnection
  5297.  
  5298.             Clears the perform connection flag.
  5299.             Syntax:
  5300.                INT haSkipConnection(ScriptHandle)
  5301.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5302.             Arguments:
  5303.                ScriptHandle
  5304.                  The script handle returned from haInitialize.
  5305.             Remarks:
  5306.                In HyperACCESS, you can define a program that runs before a
  5307.                connection is attempted and one that runs (as a logon) after
  5308.                a connection has been completed. Normally, HyperACCESS runs
  5309.                the preconnection program, attempts to connect to the remote
  5310.                system, and then, if the connection is successful, runs the
  5311.                logon program.
  5312.                If you write a preconnection program that does some advance
  5313.                processing and then determines that the connection should
  5314.                not proceed, or you want to make the connection from within
  5315.                the preconnection program, you can disable the automatic
  5316.                connection that is normally attempted when the preconnect
  5317.                program ends.
  5318.                If haSkipConnection is called during the preconnect program,
  5319.                HyperACCESS doesn't attempt to automatically connect the
  5320.                session when it terminates and won't run the logon program.
  5321.             Return Value:
  5322.                Returns 0 if successful. Otherwise, a standard API error
  5323.                code.
  5324.             See Also:
  5325.                haOpenSession, haConnectSession
  5326.  
  5327.  
  5328. haSleep
  5329.  
  5330.             Causes the API interface to enter the HyperACCESS server idle
  5331.             loop for a specified period of time.
  5332.             Syntax:
  5333.                INT haSleep(ScriptHandle, lTime)
  5334.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5335.                  LONG lTime          How long to sleep
  5336.             Arguments:
  5337.                ScriptHandle
  5338.                  The script handle returned from haInitialize.
  5339.                lTime
  5340.                  The amount of time to sleep, measured in milliseconds.
  5341.             Remarks:
  5342.                While an application sleeps, the session neither sends nor
  5343.                receives characters. During this time, however, windows
  5344.                messages continue to be dispatched to prevent the Windows
  5345.                environment from becoming inactive.
  5346.             Return Value:
  5347.                Returns 0 if successful. Otherwise, a standard API error
  5348.                code.
  5349.             See Also:
  5350.                haWait
  5351.             Example:
  5352.             /* -----------------------------------------------------------
  5353.                          --------- */
  5354.             
  5355.             /* Pause execution of the API program. haSleep doesn't block
  5356.                          other tasks from
  5357.               getting CPU time, and lets HyperACCESS continue to send and
  5358.                          receive data.
  5359.                         This program segment:
  5360.                            - Pauses for 10 seconds. */
  5361.             
  5362.                         ReturnCode = haSleep(ScriptHandle, 10000L);
  5363.             
  5364.             /* -----------------------------------------------------------
  5365.                          --------- */
  5366.  
  5367.  
  5368. haSpawn
  5369.  
  5370.             Starts up another external task (or script).
  5371.             Syntax:
  5372.                INT haSpawn(ScriptHandle, pszName)
  5373.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5374.                  LPSTR pszName                 The name of the external
  5375.                                       task
  5376.             Arguments:
  5377.                ScriptHandle
  5378.                  The script handle returned from haInitialize.
  5379.                pszName
  5380.                  A buffer containing the file name of the external task
  5381.                  that is to be run.
  5382.             Remarks:
  5383.                
  5384.             Return Value:
  5385.                Returns 0 if successful. Otherwise, a standard API error
  5386.                code.
  5387.  
  5388.  
  5389. haTerminate
  5390.  
  5391.             Releases any resources that are allocated to the external API
  5392.             task interface.
  5393.             HAOS2 Syntax:
  5394.                INT haTerminate(ScriptHandle)
  5395.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5396.             HAWin Syntax:
  5397.                INT haTerminate(ScriptHandle, hWndParent)
  5398.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5399.                  HWND hWndParent     A window handle
  5400.             Arguments:
  5401.                ScriptHandle
  5402.                  The script handle returned from haInitialize.
  5403.                hWndParent
  5404.                  The same window handle that was passed to haInitialize.
  5405.             Remarks:
  5406.                You call this function after all external API operations
  5407.                have been performed. It releases any resources that are
  5408.                allocated to the external API task interface. Any later use
  5409.                of the program - HyperACCESS link results in an error. This
  5410.                function makes an implicit call to haReleaseRemoteInput for
  5411.                its current session.
  5412.             Return Value:
  5413.                Returns 0 if successful. Otherwise, a standard API error
  5414.                code.
  5415.             See Also:
  5416.                haInitialize, haReleaseRemoteInput
  5417.  
  5418.  
  5419. haTextSend
  5420.  
  5421.             Queues a text file for transmission through the port of a
  5422.             connected session.
  5423.             Syntax:
  5424.                INT haTextSend(ScriptHandle, pszFilename)
  5425.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5426.                  LPSTR pszFilename   The name of the path and filename to
  5427.                                       be sent
  5428.             Arguments:
  5429.                ScriptHandle
  5430.                  The script handle returned from haInitialize.
  5431.                pszFilename
  5432.                  A pointer to a null terminated string containing the path
  5433.                  and filename of the file to be sent.
  5434.             Remarks:
  5435.                The file is sent out the port as though it were being typed
  5436.                rapidly by the user. If any other data is waiting to be
  5437.                transmitted, it will be sent first.
  5438.             Return Value:
  5439.                Returns 0 if successful. Otherwise, a standard API error
  5440.                code.
  5441.             See Also:
  5442.                haTypeText, haWaitForOutputDone
  5443.             Example:
  5444.             /* -----------------------------------------------------------
  5445.                          --------- */
  5446.             
  5447.             /* Send a text file as if it were typed.
  5448.                         This program segment:
  5449.                            - Sends a text file as typed data. */
  5450.             
  5451.                         ReturnCode = haTextSend(ScriptHandle,
  5452.                          "C:\\MYDIR\\LETTER.TXT");
  5453.             
  5454.             /* -----------------------------------------------------------
  5455.                          --------- */
  5456.  
  5457.  
  5458. haTypeLocalText
  5459.  
  5460.             Displays text on screen using the current emulator.
  5461.             Syntax:
  5462.                INT haTypeLocalText(ScriptHandle, nSize, pszPtr)
  5463.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5464.                  INT nSize           The number of characters
  5465.                  LPSTR pszPtr        A pointer to a string
  5466.             Arguments:
  5467.                ScriptHandle
  5468.                  The script handle returned from haInitialize.
  5469.                nSize
  5470.                  The number of characters in the string to follow. If the
  5471.                  following string is a zero terminated string, this value
  5472.                  can be 0. If the string has embedded zero characters,
  5473.                  then this value must be the number of characters in the
  5474.                  string, including the zero characters.
  5475.                pszPtr
  5476.                  A pointer to a string of characters.
  5477.             Remarks:
  5478.                The text is treated as though it had been received from the
  5479.                remote system. It is displayed on screen, captured as
  5480.                appropriate, passed into the backscroll buffer, etc.
  5481.             Return Value:
  5482.                Returns 0 if successful. Otherwise, a standard API error
  5483.                code.
  5484.             See Also:
  5485.                haTypeText, haWaitForPrompt, haWaitForString
  5486.  
  5487.  
  5488. haTypeText
  5489.  
  5490.             Transmits a string of characters through the port of a
  5491.             connected session.
  5492.             Syntax:
  5493.                INT haTypeText(ScriptHandle, nSize, pszPtr)
  5494.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5495.                  INT nSize           The number of characters
  5496.                  LPSTR pszPtr        A pointer to a string
  5497.             Arguments:
  5498.                ScriptHandle
  5499.                  The script handle returned from haInitialize.
  5500.                nSize
  5501.                  The number of characters in the string to follow. If the
  5502.                  following string is a zero terminated string, this value
  5503.                  can be 0. If the string has embedded zero characters,
  5504.                  then this value is the number of characters in the
  5505.                  string, including the embedded zero characters.
  5506.                pszPtr
  5507.                  A pointer to a string of characters.
  5508.             Remarks:
  5509.                The characters are buffered as necessary.
  5510.             Return Value:
  5511.                Returns 0 if successful. Otherwise, a standard API error
  5512.                code.
  5513.             See Also:
  5514.                haTypeLocalText, haWaitForPrompt, haWaitForString
  5515.  
  5516.  
  5517. haWait
  5518.  
  5519.             Wait for a specified period of time without blocking remote
  5520.             input.
  5521.             Syntax:
  5522.                INT haWait(ScriptHandle, lTimeout)
  5523.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5524.                  LONG lTimeout       How long to wait
  5525.             Arguments:
  5526.                ScriptHandle
  5527.                  The script handle returned from haInitialize.
  5528.                lTimeout
  5529.                  How long to wait in milliseconds.
  5530.             Remarks:
  5531.                This function is similar to haSleep, except that it permits
  5532.                processing of received characters while haSleep blocks
  5533.                remote input.
  5534.             Return Value:
  5535.                Returns 0 if successful. Otherwise, a standard API error
  5536.                code.
  5537.             See Also:
  5538.                haGetInput, haSleep, haWaitForActivity, haWaitForLull,
  5539.                haWaitForPrompt, haWaitForString
  5540.  
  5541.  
  5542. haWaitForActivity
  5543.  
  5544.             Waits for any character to be received from the remote system.
  5545.             Syntax:
  5546.                INT haWaitForActivity(ScriptHandle, lTimeout)
  5547.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5548.                  LONG lTimeout       How long to wait
  5549.             Arguments:
  5550.                ScriptHandle
  5551.                  The script handle returned from haInitialize.
  5552.                lTimeout
  5553.                  How long to wait for a character, measured in
  5554.                  milliseconds.
  5555.             Remarks:
  5556.                If no character is received before the timer expires, an
  5557.                error is returned. This function is most often used to wait
  5558.                for the remote system to complete an operation that doesn't
  5559.                generate output.
  5560.             Return Value:
  5561.                Returns 0 if successful. Otherwise, a standard API error
  5562.                code.
  5563.             See Also:
  5564.                haGetInput, haWaitForLines, haWaitForLull
  5565.  
  5566.  
  5567. haWaitForConnection
  5568.  
  5569.             Waits for the connection status to match the supplied
  5570.             parameter.
  5571.             Syntax:
  5572.                INT haWaitForConnection(ScriptHandle, nStatus, lTimeout)
  5573.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5574.                  INT nStatus         The status to wait for
  5575.                  LONG lTimeout       How long to wait
  5576.             Arguments:
  5577.                ScriptHandle
  5578.                  The script handle returned from haInitialize.
  5579.                nStatus
  5580.                  The function waits for one of the following:
  5581.                  Value             Meaning
  5582.                  HA_CONNECTED       The session is currently connected.
  5583.                  HA_DISCONNECTED    The session is currently disconnected.
  5584.                  HA_CONNECTING      The session is currently in the
  5585.                                     process of attempting a connection.
  5586.                lTimeout
  5587.                  How long to wait for the connection state before timing
  5588.                  out, measured in milliseconds.
  5589.             Remarks:
  5590.                This function should be used to wait for a connection to
  5591.                complete rather than calling haGetConnectionStatus
  5592.                repeatedly. In an event driven environment like Windows, it
  5593.                is important to make sure that a program doesn't hog the
  5594.                system while waiting for an external event.
  5595.             Return Value:
  5596.                Returns 0 if successful. Otherwise, a standard API error
  5597.                code.
  5598.             See Also:
  5599.                haConnectSession, haDisconnectSession, haGetConnectionStatus
  5600.  
  5601.  
  5602. haWaitForLines
  5603.  
  5604.             Waits for a specified number of lines to be received.
  5605.             Syntax:
  5606.                INT haWaitForLines(ScriptHandle, nLines, lTimeout)
  5607.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5608.                  INT nLines          Number of lines to wait for
  5609.                  LONG lTimeout       How long to wait
  5610.             Arguments:
  5611.                ScriptHandle
  5612.                  The script handle returned from haInitialize.
  5613.                nLines
  5614.                  The number of lines to wait for.
  5615.                Argument
  5616.                  How long to wait before returning an error, measured in
  5617.                  milliseconds.
  5618.             Remarks:
  5619.                A line is considered to be received when a carriage return
  5620.                character is received. If the function does not receive the
  5621.                specified number of lines within the time limit, an error is
  5622.                returned.
  5623.             Return Value:
  5624.                Returns 0 if successful. Otherwise, a standard API error
  5625.                code.
  5626.             See Also:
  5627.                haWaitForActivity, haWaitForLull
  5628.  
  5629.  
  5630. haWaitForLull
  5631.  
  5632.             Waits for a pause or a gap in the input data stream of a
  5633.             specified minimum size.
  5634.             Syntax:
  5635.                INT haWaitForLull(ScriptHandle, lPause, lTimeout)
  5636.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5637.                  LONG lPause         The size of the pause
  5638.                  LONG lTimeout       The timeout limit
  5639.             Arguments:
  5640.                ScriptHandle
  5641.                  The script handle returned from haInitialize.
  5642.                lPause
  5643.                  The size of the pause or gap to wait for, measured in
  5644.                  milliseconds.
  5645.                lTimeout
  5646.                  How long to wait for the pause or gap, measured in
  5647.                  milliseconds.
  5648.             Remarks:
  5649.                If a pause or gap is not found within the specified timeout
  5650.                interval, an error is returned.
  5651.             Return Value:
  5652.                Returns 0 if successful. Otherwise, a standard API error
  5653.                code.
  5654.             See Also:
  5655.                haWaitForActivity, haWaitForLines, haWaitForPrompt
  5656.             Example:
  5657.             /* -----------------------------------------------------------
  5658.                          --------- */
  5659.             
  5660.             /* Wait for activity from remote system.
  5661.                         This program segment:
  5662.                            - Waits up to 100 seconds for HyperACCESS to
  5663.                          receive a character
  5664.                              from the remote system. */
  5665.             
  5666.                         ReturnCode = haWaitForActivity(ScriptHandle,
  5667.                          100000L);
  5668.             
  5669.             /* Wait for no activity from remote system.
  5670.                         This program segment:
  5671.                            - Waits up to 100 seconds for HyperACCESS to
  5672.                          stop receiving
  5673.                             characters from the remote system. It defines
  5674.                          a lull as 5 seconds
  5675.                             without activity. */
  5676.             
  5677.                         ReturnCode = haWaitForLull(ScriptHandle, 5000L,
  5678.                          100000L);
  5679.             
  5680.             
  5681.             /* -----------------------------------------------------------
  5682.                          --------- */
  5683.  
  5684.  
  5685. haWaitForOutputDone
  5686.  
  5687.             Waits for a session to finish sending any text that may be in
  5688.             the buffer and hasn't been transmitted.
  5689.             Syntax:
  5690.                INT haWaitForOutputDone(ScriptHandle, lTimeout)
  5691.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5692.                  LONG lTimeout       How long to wait before returning
  5693.             Arguments:
  5694.                ScriptHandle
  5695.                  The script handle returned from haInitialize.
  5696.                lTimeout
  5697.                  The number of milliseconds to wait for the output to
  5698.                  finish before returning an error.
  5699.             Remarks:
  5700.                Because different types of communication devices buffer
  5701.                outgoing data differently, this function can't always
  5702.                determine when all data has actually been transmitted. It
  5703.                will return after HyperACCESS has passed all outgoing data
  5704.                from its internal buffers to the communications device.
  5705.             Return Value:
  5706.                Returns 0 if successful. Otherwise, a standard API error
  5707.                code.
  5708.             See Also:
  5709.                haTextSend, haTypeText
  5710.  
  5711.  
  5712. haWaitForPrompt
  5713.  
  5714.             Checks characters read from the connected device to see if
  5715.             they match any of a number of specified character strings.
  5716.             Syntax:
  5717.                INT haWaitForPrompt(ScriptHandle, nCount, pszText, lPause,
  5718.                lTimeout)
  5719.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5720.                  INT nCount          The number of strings to follow
  5721.                  LPSTR pszText       A pointer to a string sequence
  5722.                  LONG lPause         How long a pause to require
  5723.                  LONG lTimeout       How long to wait before timeout
  5724.             Arguments:
  5725.                ScriptHandle
  5726.                  The script handle returned from haInitialize.
  5727.                nCount
  5728.                  This variable determines the number of strings that are
  5729.                  to be searched for.
  5730.                pszText
  5731.                  A pointer to the first of a series of strings to search
  5732.                  for. The strings follow one another in memory and are
  5733.                  separated by a single NULL ('\0') character. The last
  5734.                  string is also terminated by an additional NULL ('\0')
  5735.                  character.
  5736.                lPause
  5737.                  This value, measured in milliseconds, is how long a pause
  5738.                  must be seen after one of the strings is seen before a
  5739.                  positive return is generated.
  5740.                lTimeout
  5741.                  This value, measured in milliseconds, is how long to wait
  5742.                  for one of the strings to arrive before returning an
  5743.                  error.
  5744.             Remarks:
  5745.                Once a match is made, the function checks for a pause or gap
  5746.                in the input stream of a specified period. If no characters
  5747.                are received during this period, the index of the string
  5748.                that was matched is returned. Otherwise, the search
  5749.                continues until the timeout value is exceeded. If the
  5750.                timeout is exceeded, an error is returned.
  5751.                When responding to prompts from a remote system, this
  5752.                function is often more reliable than haWaitForString. If,
  5753.                for example, you needed to wait for a prompt such as "Enter
  5754.                password ", a call to haWaitForString(..., "password", ...)
  5755.                could match the word "password" prematurely as it was
  5756.                displayed in a paragraph of instructions. Alternatively, if
  5757.                you use haWaitForPrompt(..., "password", 500L, ...), you
  5758.                would skip the descriptive paragraph because additional text
  5759.                would immediately follow "password"and the prompt delay
  5760.                wouldn't be satisfied.
  5761.             Return Value:
  5762.                Returns the index of the string that matched, if successful.
  5763.                Otherwise, a standard API error code.
  5764.             See Also:
  5765.                haGetInput, haWaitForString
  5766.  
  5767.  
  5768. haWaitForString
  5769.  
  5770.             Checks characters read from the connected device to see of
  5771.             they match any number of specified character strings.
  5772.             Syntax:
  5773.                INT haWaitForString(ScriptHandle, nCount, pszText, lTimeout)
  5774.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5775.                  INT nCount          The number of strings to follow
  5776.                  LPSTR pszText       A pointer to a string sequence
  5777.                  LONG lTimeout       How long to wait before timeout
  5778.             Arguments:
  5779.                ScriptHandle
  5780.                  The script handle returned from haInitialize.
  5781.                nCount
  5782.                  This variable determines the number of strings that are
  5783.                  to be searched for.
  5784.                pszText
  5785.                  A pointer to the first of a series of strings to search
  5786.                  for. The strings follow one another in memory and are
  5787.                  separated by a single NULL ('\0') character. The last
  5788.                  string is also terminated by a NULL ('\0') character.
  5789.                lTimeout
  5790.                  This value, measured in milliseconds, is how long to wait
  5791.                  for one of the strings to arrive before returning an
  5792.                  error.
  5793.             Remarks:
  5794.                Unlike haWaitForPrompt, this function doesn't require a
  5795.                pause after a string match.
  5796.             Return Value:
  5797.                Returns the index of the string that matched, if successful.
  5798.                Otherwise, a standard API error code.
  5799.             See Also:
  5800.                haGetInput, haWaitForPrompt
  5801.  
  5802.  
  5803. haWaitForXfer
  5804.  
  5805.             Waits for a transfer to complete.
  5806.             Syntax:
  5807.                INT haWaitForXfer(ScriptHandle, lTimeout)
  5808.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5809.                  LONG lTimeout       How long to wait
  5810.             Arguments:
  5811.                ScriptHandle
  5812.                  The script handle returned from haInitialize.
  5813.                lTimeout
  5814.                  The number of milliseconds to wait for the transfer to
  5815.                  end before returning an error.
  5816.             Remarks:
  5817.                This function can be called any time after the transfer is
  5818.                started. It returns when the transfer is complete. It is
  5819.                only needed if the call that started the transfer did not
  5820.                specify the wait flag itself.
  5821.             Return Value:
  5822.                Returns 0 if successful. Otherwise, a standard API error
  5823.                code.
  5824.             See Also:
  5825.                haXferDropSend, haXferReceive, haXferSend, haGetXferStatus
  5826.  
  5827.  
  5828. haWriteLogEntry
  5829.  
  5830.             Appends a time and date stamped entry to the log file for the
  5831.             currently active session.
  5832.             Syntax:
  5833.                INT haWriteLogEntry(ScriptHandle, pszPtr)
  5834.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5835.                  LPSTR pszPtr        A pointer to a string
  5836.             Arguments:
  5837.                ScriptHandle
  5838.                  The script handle returned from haInitialize.
  5839.                pszPtr
  5840.                  A pointer to the string that is to be appended to the log
  5841.                  file.
  5842.             Remarks:
  5843.                Several events are automatically entered into the log file
  5844.                by HyperACCESS. This function lets you add your own entries.
  5845.             Return Value:
  5846.                Returns 0 if successful. Otherwise, a standard API error
  5847.                code.
  5848.             See Also:
  5849.                haGetLogFileName, haSetLogFileName
  5850.  
  5851.  
  5852. haXferAddToSendList
  5853.  
  5854.             Adds a path and filename to the internal list of files queued
  5855.             for sending.
  5856.             Syntax:
  5857.                INT haXferAddToSendList(ScriptHandle, pszName)
  5858.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5859.                  LPSTR pszName       A pointer to a path and filename
  5860.             Arguments:
  5861.                ScriptHandle
  5862.                  The script handle returned from haInitialize.
  5863.                pszName
  5864.                  A pointer to an array or string containing the null
  5865.                  terminated path and filenames.
  5866.             Remarks:
  5867.                HyperACCESS maintains an internal list of files that can be
  5868.                sent to a remote system using one of the supported file
  5869.                transfer protocols. The list is empty when a session is
  5870.                opened. You can insert any number of files into this list
  5871.                using haXferAddToSendList. When you've completed adding
  5872.                files to the list, you would normally use haXferSendFromList
  5873.                to send them to the remote system using the current transfer
  5874.                protocol. The list can be examined using haGetXferSendList
  5875.                or explicitly cleared using haClearXferSendList. The list is
  5876.                also cleared after all files are sent.
  5877.                Several other functions send files from the send list
  5878.                although they are not normally used for that purpose.
  5879.                haXferSend, haXferSendBatch, and haXferSendList are self-
  5880.                contained send functions, but they also send files from the
  5881.                list if any are present.
  5882.                No checking for duplicate files or actual existence of files
  5883.                is performed. Placing duplicate names in the list results in
  5884.                multiple copies of the file being sent. Placing invalid
  5885.                filenames or the names of non-existent files in the list
  5886.                will usually cause an error during the transfer.
  5887.             Return Value:
  5888.                Returns 0 if successful. Otherwise, a standard API error
  5889.                code.
  5890.             See Also:
  5891.                haClearXferSendList, haGetXferSendList, haXferSendFromList
  5892.             Example:
  5893.             /* -----------------------------------------------------------
  5894.                          --------- */
  5895.             
  5896.             /* Send multiple files specified by the user.
  5897.                         This program segment:
  5898.                            - Uses a message box to ask if the user has
  5899.                          file(s) to send.
  5900.                            - Loops until user finished adding.
  5901.                            - Sends list of files. */
  5902.             
  5903.                         ReturnCode = haMessageBox(ScriptHandle,
  5904.                          "HyperACCESS",
  5905.                                                                 "Do you
  5906.                          want to send files" , 0 , 0, HA_MB_YN);
  5907.                         if (ReturnCode == 1)
  5908.                         {
  5909.                            while (ReturnCode == 1)
  5910.                            {           ReturnCode =
  5911.                          haMessageBox(ScriptHandle, "HyperACCESS",
  5912.                                                           "Enter a file to
  5913.                          send:" , sizeof(FName), FName, HA_MB_YN);
  5914.                                        if (ReturnCode == 1)
  5915.                                             ReturnCode =
  5916.                          haXferAddToSendList(ScriptHandle, FName);
  5917.                            }
  5918.                            ReturnCode = haXferSendFromList(ScriptHandle,
  5919.                          TRUE);
  5920.                         }
  5921.             
  5922.             /* -----------------------------------------------------------
  5923.                          --------- */
  5924.  
  5925.  
  5926. haXferDropSend
  5927.  
  5928.             This function sends files that have been placed on the
  5929.             internal dropped-files list using the current default
  5930.             protocol.
  5931.             Syntax:
  5932.                INT haXferDropSend(ScriptHandle, nFlag)
  5933.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5934.                  INT nFlag           The wait flag
  5935.             Arguments:
  5936.                ScriptHandle
  5937.                  The script handle returned from haInitialize.
  5938.                nFlag
  5939.                  If TRUE, the function waits until the transfer has
  5940.                  completed before returning. If FALSE, the function
  5941.                  returns as soon as the transfer is started.
  5942.             Remarks:
  5943.                If the user drags files and drops them on an open
  5944.                HyperACCESS session window, HyperACCESS builds an internal
  5945.                list of dropped filenames. If the File Usage dialog contains
  5946.                the name of a program to run when files are dropped, that
  5947.                program is executed. It can either examine the list of
  5948.                dropped files using haGetXferDropList, or send them to the
  5949.                remote system using this function. The list is cleared after
  5950.                all files are sent.
  5951.                Normally, nFlag should be TRUE. This causes file transfer to
  5952.                proceed to completion before the function call returns. If
  5953.                nFlag is FALSE, however, the function starts the transfer
  5954.                and returns immediately. Your program can then use
  5955.                haGetXferStatus and haWaitForXfer to monitor the transfer.
  5956.             Return Value:
  5957.                Returns 0 if successful. Otherwise, a standard API error
  5958.                code.
  5959.             See Also:
  5960.                haClearXferDropList, haGetXferDropList, haGetXferStatus,
  5961.                haWaitForXfer, haXferSend, haXferSendBatch,
  5962.                haXferSendFromList, haXferSendList
  5963.  
  5964.  
  5965. haXferReceive
  5966.  
  5967.             Starts to receive a file or group of files sent by the remote
  5968.             system.
  5969.             Syntax:
  5970.                INT haXferReceive(ScriptHandle, pszName, nFlag)
  5971.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  5972.                  LPSTR pszName       A pointer to a string
  5973.                  INT nFlag           The wait flag
  5974.             Arguments:
  5975.                ScriptHandle
  5976.                  The script handle returned from haInitialize.
  5977.                pszName
  5978.                  This parameter points to the filename or directory to
  5979.                  receive into, depending on requirements of the protocol.
  5980.                nFlag
  5981.                  If TRUE, the function waits until the transfer has
  5982.                  completed before returning. If FALSE, the function
  5983.                  returns as soon as the transfer is started.
  5984.             Remarks:
  5985.                You should call haSetXferProtocol, haSetXferDirectory, and
  5986.                haSetXferParameters, if necessary, prior to calling
  5987.                haXferReceive.
  5988.                If the filename doesn't include a directory path, the
  5989.                default directory path is used.
  5990.                Normally, nFlag should be TRUE. This causes file transfer to
  5991.                proceed to completion before the function call returns. If
  5992.                nFlag is FALSE, however, the function starts the transfer
  5993.                and returns immediately. Your program can then use
  5994.                haGetXferStatus and haWaitForXfer to monitor the transfer.
  5995.             Return Value:
  5996.                Returns 0 if successful. Otherwise, a standard API error
  5997.                code.
  5998.             See Also:
  5999.                haGetXferStatus, haSetXferDirectory, haSetXferParameters,
  6000.                haSetXferProtocol, haXferSend
  6001.             Example:
  6002.             /* -----------------------------------------------------------
  6003.                          --------- */
  6004.             
  6005.             /* Receive a specific file.
  6006.                         This program segment:
  6007.                            - Uses the default receive protocol and
  6008.                          directory.
  6009.                            - Starts to receive a particular file assuming
  6010.                          the protocol supports
  6011.                  filename transfers. The TRUE parameter indicates that
  6012.   HyperACCESS
  6013.                  shouldn't return to the function until the transfer is
  6014.   complete. */
  6015.             
  6016.                         ReturnCode = haXferReceive(ScriptHandle,
  6017.                          "MYFILE.TXT", TRUE);
  6018.             
  6019.             /* -----------------------------------------------------------
  6020.                          --------- */
  6021.  
  6022.  
  6023. haXferSend
  6024.  
  6025.             Adds a single file to the internal list of files to be
  6026.             transferred and starts to send the contents of the list to the
  6027.             remote using the current default protocol.
  6028.             Syntax:
  6029.                INT haXferSend(ScriptHandle, pszName, nFlag)
  6030.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  6031.                  LPSTR pszName       A pointer to a string
  6032.                  INT nFlag           The wait flag
  6033.             Arguments:
  6034.                ScriptHandle
  6035.                  The script handle returned from haInitialize.
  6036.                pszName
  6037.                  This parameter points to a string containing the path and
  6038.                  filename of the file that is to be sent.
  6039.                nFlag
  6040.                  If TRUE, the function waits until the transfer has
  6041.                  completed before returning. If FALSE, the function
  6042.                  returns as soon as the transfer is started.
  6043.             Remarks:
  6044.                If the filename doesn't include directory information, the
  6045.                default transfer directory is used.
  6046.                By default, the list of queued files is empty, resulting in
  6047.                one file being transferred. Calling this function clears the
  6048.                internal file list.
  6049.                Normally, nFlag should be TRUE. This causes file transfer to
  6050.                proceed to completion before the function call returns. If
  6051.                nFlag is FALSE, however, the function starts the transfer
  6052.                and returns immediately. Your program can then use
  6053.                haGetXferStatus and haWaitForXfer to monitor the transfer.
  6054.             Return Value:
  6055.                Returns 0 if successful. Otherwise, a standard API error
  6056.                code.
  6057.             See Also:
  6058.                haGetXferStatus, haSetXferDirectory, haSetXferProtocol,
  6059.                haWaitForXfer, haXferReceive, haXferSendFromList
  6060.             Example:
  6061.             /* -----------------------------------------------------------
  6062.                          --------- */
  6063.             
  6064.             /* Send a specifice file.
  6065.                         This program segment:
  6066.                            - Sends a particular file using an absolute
  6067.                          path.
  6068.                              Note double slash (\\). Required because
  6069.                          single slash is C escape
  6070.                              character.
  6071.                            - The FALSE parameter indicates that
  6072.                          HyperACCESS
  6073.                              should return to the function as soon as the
  6074.                          transfer starts.
  6075.                            - Minimizes the HyperACCESS application window.
  6076.                            - Allow up to 1 hour for transfer to complete.
  6077.                            - If timeout, display an error message. */
  6078.             
  6079.                            ReturnCode = haXferSend(ScriptHandle,
  6080.                          "C:\\MYDIR\\DOOM.ZIP", FALSE);
  6081.                            ReturnCode = haSizeHyperACCESS(ScriptHandle,
  6082.                          HA_S_MIN);
  6083.                            if (haWaitForXfer(ScriptHandle, 3600000L) ==
  6084.                          HA_ERR_TIMED_OUT)
  6085.                                        ReturnCode =
  6086.                          haMessageBox(ScriptHandle, "Transfer Error",
  6087.                          "Transfer timed out.", 0, 0, HA_MB_OK);
  6088.             
  6089.             /* -----------------------------------------------------------
  6090.                          --------- */
  6091.  
  6092.  
  6093. haXferSendBatch
  6094.  
  6095.             Adds a batch of files to the internal list of files queued to
  6096.             be transferred and sends the files on the list to the remote
  6097.             system using the default protocol.
  6098.             Syntax:
  6099.                INT haXferSendBatch(ScriptHandle, pszName, nFlag)
  6100.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  6101.                  LPSTR pszName       A pointer to a string
  6102.                  INT nFlag           The wait flag
  6103.             Arguments:
  6104.                ScriptHandle
  6105.                  The script handle returned from haInitialize.
  6106.                pszName
  6107.                  A pointer to a string that contains the name of the batch
  6108.                  file. The file is an ASCII text file that contains the
  6109.                  names of the files to be transferred. The file contains
  6110.                  one file description per line.
  6111.                nFlag
  6112.                  If TRUE, the function waits until the transfer has
  6113.                  completed before returning. If FALSE, the function
  6114.                  returns as soon as the transfer is started.
  6115.             Remarks:
  6116.                A batch file is a list of paths and filenames in a file. By
  6117.                default the internal list of files to be sent is empty.
  6118.                Calling this function clears the internal file list.
  6119.                Normally, nFlag should be TRUE. This causes file transfer to
  6120.                proceed to completion before the function call returns. If
  6121.                nFlag is FALSE, however, the function starts the transfer
  6122.                and returns immediately. Your program can then use
  6123.                haGetXferStatus and haWaitForXfer to monitor the transfer.
  6124.             Return Value:
  6125.                Returns 0 if successful. Otherwise, a standard API error
  6126.                code.
  6127.             See Also:
  6128.                haGetXferStatus, haSetXferDirectory, haSetXferParameters,
  6129.                haSetXferProtocol, haWaitForXfer, haXferSend,
  6130.                haXferSendFromList
  6131.  
  6132.  
  6133. haXferSendFromList
  6134.  
  6135.             Sends files that are on the internal list of files queued to
  6136.             be transferred using the current default protocol.
  6137.             Syntax:
  6138.                INT haXferSendFromList(ScriptHandle, nWait)
  6139.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  6140.                  INT nWait           The wait flag
  6141.             Arguments:
  6142.                ScriptHandle
  6143.                  The script handle returned from haInitialize.
  6144.                nWait
  6145.                  If TRUE, the function waits until the transfer has
  6146.                  completed before returning. If FALSE, the function
  6147.                  returns as soon as the transfer is started.
  6148.             Remarks:
  6149.                By default, the list of queued file is empty and filenames
  6150.                must be explicitly added to the list via API calls. See the
  6151.                remarks in the description of haXferAddToSendList for
  6152.                information on how to prepare the list. The internal list of
  6153.                files is cleared after this operation.
  6154.                Normally, nFlag should be TRUE. This causes file transfer to
  6155.                proceed to completion before the function call returns. If
  6156.                nFlag is FALSE, however, the function starts the transfer
  6157.                and returns immediately. Your program can then use
  6158.                haGetXferStatus and haWaitForXfer to monitor the transfer.
  6159.             Return Value:
  6160.                Returns 0 if successful. Otherwise, a standard API error
  6161.                code.
  6162.             See Also:
  6163.                haClearXferSendList, haGetXferSendList, haGetXferStatus,
  6164.                haSetXferDirectory, haSetXferParameters, haSetXferProtocol,
  6165.                haXferAddToSendList, haXferReceive, haXferSend,
  6166.                haWaitForXfer
  6167.  
  6168.  
  6169. haXferSendList
  6170.  
  6171.             Adds a list or array of filenames to the the internal list of
  6172.             files queued to be transferred. It sends the files in the list
  6173.             to the remote system using the current default protocol.
  6174.             Syntax:
  6175.                INT haXferSendList(ScriptHandle, pszPtr, nFlag)
  6176.                  SCRIPTHANDLE ScriptHandleThe program - HyperACCESS link
  6177.                  LPSTR pszPtr        A pointer to a string
  6178.                  INT nFlag           The wait flag
  6179.             Arguments:
  6180.                ScriptHandle
  6181.                  The script handle returned from haInitialize.
  6182.                pszPtr
  6183.                  A pointer to an array of string pointers. Each entry in
  6184.                  the array is a far pointer to a string containing a
  6185.                  filename. The last entry in the array must be 0.
  6186.                nFlag
  6187.                  If TRUE, the function waits until the transfer has
  6188.                  completed before returning. If FALSE, the function
  6189.                  returns as soon as the transfer is started.
  6190.             Remarks:
  6191.                This function provides an alternative to adding files
  6192.                individually to the internal file list and then using
  6193.                haXferSendFromList to send them. You can specify all the
  6194.                files to send and start the transfer with one call.
  6195.                By default, the internal list of files to be transferred is
  6196.                empty. If there are files already on the list, however, they
  6197.                will be sent along with the files specified in the array.
  6198.                Sending the files clears the internal file list.
  6199.                Normally, nFlag should be TRUE. This causes the file
  6200.                transfer to proceed to completion before the function call
  6201.                returns. If nFlag is FALSE, however, the function starts the
  6202.                transfer and returns immediately. Your program can then use
  6203.                haGetXferStatus and haWaitForXfer to monitor the transfer.
  6204.             Return Value:
  6205.                Returns 0 if successful. Otherwise, a standard API error
  6206.                code.
  6207.             See Also:
  6208.                haGetXferStatus, haSetXferDirectory, haSetXferParameters,
  6209.                haSetXferProtocol, haWaitForXfer, haXferSend
  6210.             Example:
  6211.             /* -----------------------------------------------------------
  6212.                          --------- */
  6213.             
  6214.             /* Check the first file in the list.
  6215.                         This program segment:
  6216.                            - Gets the first file in the send list (index
  6217.                          starts at 0)
  6218.                            - Uses a message box to display the filename
  6219.                          and ask if OK. */
  6220.             
  6221.             
  6222.                         ReturnCode = haGetXferSendList(ScriptHandle, 0,
  6223.                          sizeof(FName), FName);
  6224.                         ReturnCode = haMessageBox(ScriptHandle, "First
  6225.                          file to send:", FName,
  6226.                                                                 0, 0,
  6227.                          HA_MB_OK);
  6228.             
  6229.             /* -----------------------------------------------------------
  6230.                          --------- */
  6231.             
  6232.