



                           FTP Client Engine

                       Library for Visual Basic


                                (FCE4VB)


                           REFERENCE MANUAL



                              Version 1.2

                            August 16, 1999




                     This software is provided as-is.
              There are no warranties, expressed or implied.




                           Copyright (C) 1999
                           All rights reserved



                       MarshallSoft Computing, Inc.
                           Post Office Box 4543
                           Huntsville AL 35815


                           Voice : 256-881-4630
                             FAX : 256-880-0925
                           email : info@marshallsoft.com
                             web : www.marshallsoft.com

                               _______
                          ____|__     |                (R)
                       --+       |    +-------------------
                         |   ____|__  |  Association of
                         |  |       |_|  Shareware
                         |__|   o   |    Professionals
                       --+--+   |   +---------------------
                            |___|___|    MEMBER


      MARSHALLSOFT is a registered trademark of MarshallSoft Computing.




     FCE4VB Reference Manual                                    Page 1

                            C O N T E N T S



        Chapter                                     Page

        Table of Contents.............................2

        General Remarks...............................3

        FCE Functions.................................3

           fceAbort...................................3
           fceAttach..................................5
           fceClose...................................5
           fceConnect.................................6
           fceDelFile.................................7
           fceDelServerDir............................8
           fceDriver..................................9
           fceErrorText..............................10
           fceExtract................................11
           fceGetFile................................12
           fceGetInteger.............................13
           fceGetList................................14
           fceGetLocalDir............................15
           fceGetServerDir...........................16
           fceGetString..............................17
           fceMakeServerDir..........................18
           fcePutFile................................19
           fceRelease................................20
           fceSetInteger.............................21
           fceSetLocalDir............................23
           fceSetMode................................24
           fceSetServerDir...........................25
           fceSetString..............................26























     FCE4VB Reference Manual                                    Page 2

      General Remarks

      All functions return an integer code. Negative values are always
      errors. See Section 11.3 "FCE Error Return Code List" in the FCE
      Users Manual (FCE4VB_U.TXT). Non-negative return codes are never
      errors.

      Note that all integer variables in Win32 are declared as LONG rather
      than INTEGER. This is because INTEGERS use 2 bytes in Visual Basic,
      rather than 4 bytes used in Win32 C/C++ compilers.

      Integer variables in Win16 (VB 3.0) are declared as INTEGER. This
      manual shows the Win32 declarations, rather than the Win16
      declarations. Refer to SEE16.BAS and SEE32.BAS.

      All strings passed to FCE functions should be terminated by an Ascii
      null. For example,

            Dim X As String
            X = "Hello, world" + Chr$(0)

      FCE Functions


      +----------+--------------------------------------------------------+
      | fceAbort | Abort file fceDriver.                                  |
      +----------+--------------------------------------------------------+


        SYNTAX  Declare Function fceAbort(
                    ByVal Chan As Long)        'channel number

       REMARKS  The fceAbort function is used to abort the FCE state
                driver. This is used when calling the FCE state driver
                (fceDriver) directly and it is neccessary to abort.

                After calling fceAbort, subsequent calls to fceDriver will
                return 0 (IDLE). Thus, FCE is ready for the next command.

                This function is not required unless the state driver
                fceDriver is being called directly.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                'called when user pushes STOP button on the form.

                 Sub buttonStop_Click()
                 Dim Code As Long
                 'abort driver
                 Code = fceAbort(0)
                 End Sub

      ALSO SEE fceDriver



     FCE4VB Reference Manual                                    Page 3

      +-----------+-------------------------------------------------------+
      | fceAttach | Initializes FCE.                                      |
      +-----------+-------------------------------------------------------+


        SYNTAX  Declare Function fceAttach(
                    ByVal NbrChans As Long, 'Number of channels or threads
                    ByVal KeyCode As Long)  'Registration key code.

       REMARKS  The fceAttach function must be the first FCE call made.
                Pass the maximum number of channels or threads that will be
                in use. Use NbrChans = 1 for non-threaded applications.

                The 'Chan'parameter for subsequent calls to FCE functions
                must be in the range of 0 to NbrChans-1.

                In WIN32, up to 32 threads (numbered from 0 to 31) can be
                started, each of which can be connected to a different FTP
                server and run independently.

                When FCE is registered, you will receive a 'KeyCode' which
                matches the 'KeyCode'within the registered DLL. For the
                shareware version, the keycode is 0. See KEYCODE.BAS.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                'Initialize FCE (look in KEYCODE.BAS for FCE_KEY_CODE)
                Code = fceAttach(1, FCE_KEY_CODE)

                'call any FCE function except fceAttach and fceRelease.
                'Pass 0 as the channel number.

                'Terminate FCE
                Code = fceRelease()

      ALSO SEE fceRelease.




















     FCE4VB Reference Manual                                    Page 4

      +----------+--------------------------------------------------------+
      | fceClose | Closes connection opened by fceConnect.                |
      +----------+--------------------------------------------------------+


        SYNTAX  Declare Function fceClose(
                    ByVal Chan As Long)        'channel number

       REMARKS  The fceClose function closes the connection to the FTP
                server opened with fceConnect. After closing, another
                connection on channel 'Chan' may be opened with fceConnect.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                ' Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                If Code < 0 Then
                  PRINT "Cannot attach FCE"
                  Exit Function
                End If
                ' Connect to FTP server
                Code = fceConnect(0,"ftp.hiwaay.net","ftp","you@isp.com")

                '...List, delete, upload, and download files.

                'close connection.
                Code = fceClose(0)
                'release FCE
                Code = fceRelease()

      ALSO SEE fceConnect.

























     FCE4VB Reference Manual                                    Page 5

      +------------+------------------------------------------------------+
      | fceConnect | Connects to a FTP server.                            |
      +------------+------------------------------------------------------+


        SYNTAX  Declare Function fceConnect(
                    ByVal Chan As Long,    'Channel number.
                    ByVal Server As String,'Server name or dotted IP addr
                    ByVal User As String,  'Users account or "anonymous"
                    ByVal Pass As String)  'Password for above

       REMARKS  The fceConnect function connects to the FTP server
                'Server'and logs on as 'User'with password 'Pass'.

                FTP servers that allow anonymous access will accept "ftp"
                or "anonymous" for the user name and your email address for
                the password.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                'Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                'Connect to FTP server
                Code = fceConnect(0,"ftp.hiwaay.net","ftp","you@isp.com")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If

                '...List, delete, upload, and download files.

                'close connection.
                Code = fceClose(0)
                'release FCE
                Code = fceRelease()


      ALSO SEE fceClose.


















     FCE4VB Reference Manual                                    Page 6

      +------------+------------------------------------------------------+
      | fceDelFile | Deletes file from the FTP server.                    |
      +------------+------------------------------------------------------+


        SYNTAX  Declare Function fceDelFile(
                    ByVal Chan As Long,       'channel number
                    ByVal FileName As String) 'Name of file to delete

       REMARKS  The fceDelFile function is used to delete the file
                'FileName'from the FTP server.

                The delete may fail if either you don't have the necessary
                permission (as is typical when you connect as an anonymous
                user) or the file itself is marked as read-only.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                'Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                If Code < 0 Then
                  PRINT "Cannot attach FCE"
                  Exit Function
                End If
                'Connect to FTP server
                Code = fceConnect(0,"ftp.yourisp.com","user","password")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If
                'delete file
                Code = fceDelFile(0,"PRODUCTS.TXT")
                If Code >= 0 Then
                  PRINT "File deleted"
                Else
                  Call DisplayError(Code)
                  Exit Function
                End If
                'close connection.
                Code = fceClose(0)
                'release FCE
                Code = fceRelease()

      ALSO SEE fcePutFile and fceDelServerDir












     FCE4VB Reference Manual                                    Page 7

      +-----------------+-------------------------------------------------+
      | fceDelServerDir | Deletes the server directory.                   |
      +-----------------+-------------------------------------------------+


        SYNTAX  Declare Function fceDelServerDir(
                    ByVal Chan As Long,       'channel number
                    ByVal DirName As String)  'Name of directory to delete

       REMARKS  The fceDelServerFile function is used to delete the server
                directory 'DirName'from the FTP server.

                The delete may fail if you don't have the necessary
                permission, as is typical when you connect as an anonymous
                user.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                'Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                If Code < 0 Then
                  PRINT "Cannot attach FCE"
                  Exit Function
                End If
                'Connect to FTP server
                Code = fceConnect(0,"ftp.yourisp.com","user","password")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If
                'delete server directory MYSTUFF.DIR
                Code = fceDelServerDir(0,"MYSTUFF.DIR")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If
                'close connection.
                Code = fceClose(0)
                'release FCE
                Code = fceRelease()

      ALSO SEE fceDelFile














     FCE4VB Reference Manual                                    Page 8

      +-----------+-------------------------------------------------------+
      | fceDriver | Executes the next state in the FCE state engine.      |
      +-----------+-------------------------------------------------------+


        SYNTAX  Declare Function fceDriver(
                      ByVal Chan As Long)           'Channel

       REMARKS  The fceDriver function executes the next state in the FCE
                state engine.

                This function is only used when FCE_AUTO_CALL_DRIVER is set
                to 0.

                Refer to Section 4.0, "Theory of Operation" in the FCE
                Users Manual (FCE4VB_U.TXT) for more details.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                'Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                'Connect to FTP server
                Code = fceConnect(0,"ftp.hiwaay.net","ftp","you@isp.com")
                'turn AUTO CALL off.
                Code = fceSetInteger(0,FCE_SET_AUTO_CALL_DRIVER, 0)
                'ask for file
                Code = fceGetFile(0,"PRODUCTS.TXT")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If
                'call the driver until it returns 0
                While fceDriver(0) <> 0
                  'print dot for each call to driver
                  PRINT (".")
                Wend
                'turn AUTO CALL back on
                Code = fceSetInteger(0,FCE_SET_AUTO_CALL_DRIVER, 1)
                'close connection.
                Code = fceClose(0)
                'release FCE
                Code = fceRelease()

      ALSO SEE "Theory of Operation" in Users Manual (FCE4VB_U.TXT).












     FCE4VB Reference Manual                                    Page 9

      +--------------+----------------------------------------------------+
      | fceErrorText | Formats an error message.                          |
      +--------------+----------------------------------------------------+


        SYNTAX  Declare Function fceErrorText(
                    ByVal Chan As Long,     'channel number
                    ByVal Code As Long,     'Error code
                    ByVal Buffer As String, 'location to put error message
                    ByVal BufLen As Long)   'size of above

       REMARKS  The fceErrorText function formats the error message for
                error 'Code' in 'Buffer'.

                Call this function when an error (a negative value) is
                returned from a FCE function so that the error message can
                be displayed or logged.

       RETURNS  The number of characters copied to 'Buffer'.

       EXAMPLE

                Dim Buffer As String * 100

                Code = fceConnect(...)
                If Code < 0 Then
                  'display error message
                  N = fceErrorText(0,Code,Buffer,100)
                  If N > 0 then
                    PRINT "ERROR " + Left$(Buffer,N)
                  End If
                End If

      ALSO SEE
























     FCE4VB Reference Manual                                    Page 10

      +------------+------------------------------------------------------+
      | fceExtract | Extracts strings from FTP formatted file list.       |
      +------------+------------------------------------------------------+


        SYNTAX  Declare Function fceExtract(
                    ByVal Buffer As String,   'buffer returned by fceGetList.
                    ByVal LineNbr As String,  'line number [1,2,...] wanted.
                    ByVal FieldNbr As String, 'field number [1,2,...] wanted.
                    ByVal BufPtr As String,   'Resultant buffer.
                    ByVal BufLen As Long)     'Size of above.

       REMARKS  The fceExtract function extracts fields from FTP formatted
                file lists for line 'LineNbr' and field 'FieldNbr'. The
                extracted substring is copied into 'BufPtr'. Use 'FieldNbr'
                0 in order to copy the entire line rather than a field.

                A typical line in a full FTP directory listing may look
                like the following. Note that there are 9 fields.

                -rw-r--r-- 1 345 15 100424 Feb 8 16:26 fce4c10b.zip

                Note that in the line above, field 5 is the file length.

                The fceExtract function is typically called after calling
                fceGetList.

       RETURNS The number of characters copied to 'BufPtr'.

       EXAMPLE

                Dim Line As Long
                Dim Code As Long
                Dim LineBuf As String * 100

                ' ask for full list
                Code = fceGetList(0,FCE_FULL_LIST,DataBuffer,MAX_BUF)
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If
                ' get each field for line 8
                Line = 8
                For I = 1 To 9
                  Code = fceExtract(DataBuffer,Line,I,LineBuf, 100)
                  PRINT "FIELD " & Str$(I) & " [" & LineBuf & "]"
                  End If
                Next I

      ALSO SEE fceGetList








     FCE4VB Reference Manual                                    Page 11

      +------------+------------------------------------------------------+
      | fceGetFile | Gets (downloads) file from FTP server.               |
      +------------+------------------------------------------------------+


        SYNTAX  Declare Function fceGetFile(
                    ByVal Chan As Long,        ' channel number
                    ByVal FileName As String)  ' Name of file to download

       REMARKS  The fceGetFile function is used to download the file
                'FileName' from the FTP server.

                Note that ASCII transfer mode is normally the default. Call
                fceSetMode(Chan,ASC("B")) to set the transfer mode to
                binary for non ASCII files.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                ' Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                If Code < 0 Then
                  PRINT "Cannot attach FCE"
                  Exit Function
                End If
                ' Connect to FTP server
                Code = fceConnect(0,"ftp.hiwaay.net","ftp","you@isp.com")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If
                ' download file
                Code = fceGetFile(0,"PRODUCTS.TXT")
                If Code >= 0 Then
                  PRINT "File downloaded"
                End If
                ' close connection.
                Code = fceClose(0)
                ' release FCE
                Code = fceRelease()


      ALSO SEE fcePutFile














     FCE4VB Reference Manual                                    Page 12

      +---------------+---------------------------------------------------+
      | fceGetInteger | Returns numeric parameter.                        |
      +---------------+---------------------------------------------------+


        SYNTAX  ULONG fceGetInteger(
                    ByVal Chan As Long,        ' channel number
                    ByVal ParamName As Long)  ' Parameter name


       REMARKS  The fceGetInteger function returns the value of the
                specified parameter 'ParamName'.

                Note that the return type is unsigned long.

                FCE_GET_VERSION : Returns FCE version.
                FCE_GET_BUILD : Returns FCE build number.
                FCE_GET_SOCK_ERROR : Returns last socket error code.
                FCE_GET_SOCKET : Returns control socket number.
                FCE_GET_COUNTER : Returns # times FCE driver was called.
                FCE_GET_RESPONSE : Returns last FTP response.
                FCE_GET_FILE_BYTES_RCVD : Returns # file bytes received.
                FCE_GET_TOTAL_BYTES_RCVD : Returns total bytes received.
                FCE_GET_FILE_BYTES_SENT : Returns # file bytes sent.
                FCE_GET_TOTAL_BYTES_SENT : Returns total file bytes sent.
                FCE_GET_CONNECT_STATUS : Returns 1 if connected.

       RETURNS  Value of parameter requested.

       EXAMPLE

                ' display FCE version number.

                Dim Version As Integer
                Dim S1, S2 As String

                Version = fceGetInteger(0, FCE_GET_VERSION)

                S1 = Hex$(Version)
                S2 = Mid$(S2, 1, 1) + "." + Mid$(S2, 2, 1) + "."
                     + Mid$(S2, 3, 1)
                Print "FCE4VB version " + S2

      ALSO SEE fceGetString














     FCE4VB Reference Manual                                    Page 13

      +------------+------------------------------------------------------+
      | fceGetList | Gets file list from FTP server.                      |
      +------------+------------------------------------------------------+


        SYNTAX  Declare Function fceGetList(
                    ByVal Chan As Long,        ' channel number
                    ByVal Flag As Long,        ' FULL or NAME list flag.
                    ByVal Buffer As String,    ' List buffer.
                    ByVal BufLen As Long)      ' size of 'Buffer'

       REMARKS  The fceGetList function downloads the directory list from
                the FTP server.

                If 'FCE_FULL_LIST' is passed for 'Flag', a full directory
                listing is returned in 'Buffer'. Note that the exact format
                of the list depends on the particular FTP server.

                If 'FCE_NAME_LIST' is passed for 'Flag', a listing is
                returned consisting of file names only. Note that some FTP
                servers do not support the name list function.

                If 'FCE_FULL_LIST_FILE' is passed for 'Flag', the filename
                to list is taken from 'Buffer'. If the file exists, a
                listing of this file is returned.

                If 'FCE_NAME_FULL_LIST_FILE' is passed for 'Flag', the
                filename to list is taken from 'Buffer'. If the file
                exists, a the name of this file is returned. Be sure to
                check the return code length.

                File lists consist of a zero terminated list of file
                entries, each of which is terminated by a carriage return,
                line feed pair. Also check the return code, which contains
                the length of the characters placed in 'Buffer'.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.
               >= 0 : Number of characters copied to 'Buffer'.

       EXAMPLE

                Dim Buffer As String * 5000
                ...
                ' get file name list
                Code = fceGetList(0,FCE_LIST_NAME,Buffer,5000)
                If Code > 0 Then
                  PRINT Left$(Buffer, Code)
                Else
                  PRINT "Not found."
                End If

      ALSO SEE  fceExtract.






     FCE4VB Reference Manual                                    Page 14

      +----------------+--------------------------------------------------+
      | fceGetLocalDir | Returns the local upload/download directory.     |
      +----------------+--------------------------------------------------+


        SYNTAX  Declare Function fceGetLocalDir(
                    ByVal Chan As Long,        ' channel number
                    ByVal Buffer As String,    ' string buffer
                    ByVal BufLen As Long)      ' size of 'Buffer'

       REMARKS  The fceGetLocalDir function returns the local
                upload/download directory.

                The local upload/download directory is the directory used
                for all uploads and downloads. The default is the current
                directory (".").

                Both relative and absolute directories may be specified.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.
               >= 0 : The number of characters copied.

       EXAMPLE

               ' Set local upload/download directory.

               Code = fceSetLocalDir(0,"DOWNLOADS\TEXT")

      ALSO SEE fceSetLocalDir





























     FCE4VB Reference Manual                                    Page 15

      +-----------------+-------------------------------------------------+
      | fceGetServerDir | Returns the FTP server directory.               |
      +-----------------+-------------------------------------------------+


        SYNTAX  Declare Function fceGetServerDir(
                    ByVal Chan As Long,        ' channel number
                    ByVal Buffer As String,    ' string buffer
                    ByVal BufLen As Long)      ' size of 'Buffer'

       REMARKS  The fceGetServerDir function returns the FTP server
                directory.

                Note that most all FTP servers will restrict clients as to
                which directories on the server that can be accessed.

                The default is the current logged directory on the FTP
                server.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.
               >= 0 : The number of characters copied.

       EXAMPLE

               Dim Buffer As String * 65

               ' copy directory string to 'Buffer'
               Code = fceGetServerDir(0, Buffer, 65)
               PRINT "Server directory is " + Left$(Buffer,Code)

      ALSO SEE  fceSetServerDir



























     FCE4VB Reference Manual                                    Page 16

      +------------------+------------------------------------------------+
      | fceMakeServerDir | Creates server directory.                      |
      +------------------+------------------------------------------------+


        SYNTAX  Declare Function fceMakeServerDir(
                    ByVal Chan As Long,       ' channel number
                    ByVal DirName As String)  ' Name of directory to make

       REMARKS  The fceMakeServerFile function is used to make (create)
                server directory 'DirName' on the FTP server.

                The make may fail if you don't have the necessary
                permission, as is typical when you connect as an anonymous
                user.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                ' Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                If Code < 0 Then
                  PRINT "Cannot attach FCE"
                  Exit Function
                End If
                ' Connect to FTP server
                Code = fceConnect(0,"ftp.yourisp.com", "user", "password")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If
                ' create new directory
                Code = fceMakeServerDir(0,"MYSTUFF.DIR")
                ' close connection.
                Code = fceClose(0)
                ' release FCE
                Code = fceRelease()

      ALSO SEE fceDelServerDir


















     FCE4VB Reference Manual                                    Page 17

      +--------------+----------------------------------------------------+
      | fceGetString | Returns string parameter.                          |
      +--------------+----------------------------------------------------+


        SYNTAX  Declare Function fceGetString(
                    ByVal Chan As Long,        ' channel number
                    ByVal ParamName As String, ' parameter name
                    ByVal Buffer As String,    ' string buffer
                    ByVal BufLen As String)    ' size of 'Buffer'

       REMARKS  The fceGetString function returns the string parameter
                'ParamName'.

                FCE_GET_REGISTRATION : Returns registration string.
                FCE_GET_LAST_RESPONSE : Returns last FTP response.
                FCE_GET_SERVER_IP : Returns IP address of FTP server.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.
               >= 0 : Number of characters copied to 'Buffer'.

       EXAMPLE

               Dim Buffer As String * 50


               ' display registration string within the DLL
               Code = fceGetString(0,FCE_GET_REGISTRATION,Buffer,50)
               PRINT "Registration = " + Left$(Buffer, Code)

               ' display server IP address in dotted format.
               Code = fceGetString(0,FCE_GET_SERVER_IP,Buffer,20)
               PRINT "Server IP address = " + Left$(Buffer, Code)

      ALSO SEE fceGetInteger























     FCE4VB Reference Manual                                    Page 18

      +------------+------------------------------------------------------+
      | fcePutFile | Uploads file to FTP server.                          |
      +------------+------------------------------------------------------+


        SYNTAX  Declare Function fcePutFile(
                    ByVal Chan As Long,       ' channel number
                    ByVal FileName As String) ' name of file to upload

       REMARKS  The fcePutFile function uploads the file 'FileName' to the
                FTP server.

                The file 'FileName' to be uploaded must be in the local
                upload/download directory.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                ' Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                If Code < 0 Then
                  PRINT "Cannot attach FCE"
                  Exit Function
                End If
                ' Connect to FTP server
                Code =
                fceConnect(0,"ftp.hiwaay.net","ftp","you@isp.com")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If
                ' upload file
                Code = fcePutFile(0,"COMMENTS.TXT")
                If Code >= 0 Then
                  PRINT "File uploaded"
                End If
                ' close connection.
                Code  = fceClose(0)
                ' release FCE
                Code = fceRelease()

      ALSO SEE fceGetFile.















     FCE4VB Reference Manual                                    Page 19

      +------------+------------------------------------------------------+
      | fceRelease | Releases FCE.                                        |
      +------------+------------------------------------------------------+


        SYNTAX  Declare Function fceRelease()

       REMARKS  The fceRelease function releases the FCE system. This
                should be the very last function called.

                fceClose should be called for all channels before calling
                fceRelease.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                ' Initialize FCE
                Code = fceAttach(1, FCE_KEY_CODE)

                ' call FCE functions except fceAttach and fceRelease.

                ' Terminate FCE
                Code = fceRelease()

      ALSO SEE fceAttach.
































     FCE4VB Reference Manual                                    Page 20

      +---------------+---------------------------------------------------+
      | fceSetInteger | Sets numeric parameter.                           |
      +---------------+---------------------------------------------------+


        SYNTAX  Declare Function fceSetInteger(
                    ByVal Chan As Long,        ' channel number
                    ByVal ParamName As Long,   ' parameter name
                    ByVal ParamValue As Long)  ' parameter value

       REMARKS  The fceSetInteger function sets the numeric parameter
                'ParamName' to the value 'ParamValue'.

                        Parameter Name      Default

                FCE_SET_MIN_RESPONSE_WAIT : 0
                FCE_SET_MAX_RESPONSE_WAIT : 10000
                     FCE_SET_CONNECT_WAIT : 60000
                    FCE_SET_MIN_LINE_WAIT : 0
                    FCE_SET_MAX_LINE_WAIT : 20000
                 FCE_SET_AUTO_CALL_DRIVER : 1
                       FCE_SET_SLEEP_TIME : 20 (WIN32 only)
                         FCE_SET_FTP_PORT : 21
                     FCE_SET_CLOSE_LINGER : 50 (WIN32) or 500 (WIN16)
                    FCE_SET_WRITE_BUFSIZE : 512 (WIN16) or 1024 (WIN32)
                          FCE_SET_PASSIVE : 0

                FCE_SET_MIN_RESPONSE_WAIT is the delay before looking for
                the server's response.

                FCE_SET_MAX_RESPONSE_WAIT is the time after which a
                "time-out" error occurs if the server has not responded.

                FCE_SET_MIN_LINE_WAIT is the delay before checking if the
                server is ready to accept the next line of input.

                FCE_SET_MAX_LINE_WAIT is the time after which a "time-out"
                error is declared if the server has not responded.

                FCE_SET_CONNECT_WAIT is the maximum time allowed to
                complete a connection to the SMTP server.

















     FCE4VB Reference Manual                                    Page 21

                FCE_SET_SLEEP_TIME is the sleep time (in milliseconds) when
                waiting for socket I/O to complete. Usefull in
                multi-threaded environments.

                FCE_SET_FTP_PORT is the port number to use when connecting
                to the FTP server. The default is the well-known port
                number 21.

                FCE_SET_CLOSE_LINGER is the "linger" time after an upload
                is completed before closing the data socket. Setting this
                value too small (at least in WIN16) causes the data socket
                to be closed before the last block of data is transmitted.

                FCE_SET_WRITE_BUFSIZE is the transmit block size. The
                maximum value is 4096 for WIN16 and 8192 for WIN32.

                FCE_SET_PASSIVE sets passive mode on (1) and off (0).

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                ' disable the automatic calling of the state driver.
                Code = fceSetInteger(0, FCE_SET_AUTO_CALL_DRIVER, 0)

                ' set the write buffer size to 2048.
                Code = fceSetInteger(0, FCE_SET_WRITE_BUFSIZE, 2048)

                ' set the WIN32 sleep time to 100 mS.
                Code = fceSetInteger(0, FCE_SET_SLEEP_TIME, 100)

      ALSO SEE fceSetString


























     FCE4VB Reference Manual                                    Page 22

      +----------------+--------------------------------------------------+
      | fceSetLocalDir | Sets the local upload/download directory.        |
      +----------------+--------------------------------------------------+


        SYNTAX  Declare Function fceSetLocalDir(
                    ByVal Chan As Long,        ' channel number
                    ByVal DirName As String)   ' local directory path

       REMARKS  The fceSetLocalDir function sets the local computer upload
                and download directories. The upload and download
                directory is the directory used by FCE for all uploads and
                downloads.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                ' specify the local upload/download directory.

                Code = fceSetLocalDir(0, "C:\TEMP")

                ' all upload and download requests will now use directory
                ' C:\TEMP.

      ALSO SEE fceGetLocalDir
































     FCE4VB Reference Manual                                    Page 23

      +------------+------------------------------------------------------+
      | fceSetMode | Sets FTP transfer mode.                              |
      +------------+------------------------------------------------------+


        SYNTAX  Declare Function fceSetMode(
                    ByVal Chan As Long,   ' channel number
                    ByVal Mode As Long)   ' transfer mode ('A' or 'B')

       REMARKS  The fceSetMode function sets the FTP transfer mode. Pass
                ASC("A") to specify ASCII mode and ASC("B") to specify
                binary mode.

                Since the FTP default is usually ASCII, it is good practice
                to always specify the transfer mode before the first call
                to fceGetFile or fcePutFile.

                If unsure of the transfer mode, choose binary.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                ' set ASCII mode
                Code = fceSetMode(0, ASC("A"))

                ' set binary mode
                Code = fceSetMode(0, ASC("B"))

      ALSO SEE fceGetFile and fcePutFile.




























     FCE4VB Reference Manual                                    Page 24

      +-----------------+-------------------------------------------------+
      | fceSetServerDir | Sets the FTP directory.                         |
      +-----------------+-------------------------------------------------+


        SYNTAX  Declare Function fceSetServerDir(
                    ByVal Chan As Long,        ' channel number
                    ByVal DirName As String)   ' directory name

       REMARKS  The fceSetServerDir sets the FTP directory to 'DirName'
                which is used for subsequent FCE calls.

                Note that UNIX FTP servers use forward slashes for
                directories while Windows FTP servers use backward
                slashes.


       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

               'set server directory to "pub/other"
               Code = fceSetServer(0, "pub/other")
               If Code < 0 Then
                 '...handle error...
               End If
               ' server directory requested is accepted

      ALSO SEE





























     FCE4VB Reference Manual                                    Page 25

      +--------------+----------------------------------------------------+
      | fceSetString | Sets string parameter.                             |
      +--------------+----------------------------------------------------+


        SYNTAX  Declare Function fceSetString(
                    ByVal Chan As Long,        ' channel number
                    ByVal ParamName As Long,   ' parameter name
                    ByVal ParamPtr As String)  ' parameter string

       REMARKS  The fceSetString function sets the string parameter
                'ParamName' to 'ParamPtr'.

                FCE_SET_LOG_FILE is used to specify the log file name. Log
                files can be quite large, so use only when necessary.

                FCE_WRITE_TO_LOG is used to write a string (message) to
                log file.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

               ' open LOG file
               Code = fceSetString(0, FCE_SET_LOG_FILE, "program.log")

               ' write "hello" to LOG file.
               Code = fceSetString(0, FCE_WRITE_TO_LOG, "Hello")

      ALSO SEE fceSetInteger




























     FCE4VB Reference Manual                                    Page 26

