home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / clarion / library / clacom / whatsnew.txt < prev   
Text File  |  1994-02-24  |  10KB  |  284 lines

  1.  
  2. 02/14/94
  3.  
  4.   CLACom is now compatible with Clarion Graphics modes and the
  5.   GUI.
  6.  
  7.     To demonstrate the GUI capabilities, there is a GUI version
  8.     of the sample application GTERM, called GTERMG.APP.
  9.  
  10.     Programming wise, you do not need to do anything different
  11.     as far as CLACom is concerned to utilize the Communications
  12.     routines in a GUI application.
  13.  
  14.     The GTERMG.* files contain the GUI version of the sample
  15.     application.
  16.  
  17.  
  18.   The sample applications now demonstrate how to use the Scroll
  19.   Back or Capture buffers. Capturing of data is automatic once
  20.   you tell CLACom to turn on the capture buffer. However, what
  21.   you do with this buffer is up to your application. The data
  22.   is saved to a file (the name of which you specify when initializing
  23.   the capture buffer). You must use Clarion to provide routines for
  24.   Viewing the data in this file.
  25.  
  26.   There are two functions that interface with the capture routines:
  27.  
  28.     SetCaptureFile(*CSTRING),PASCAL,RAW,NAME('SETCAPF')
  29.  
  30.       CSTRING   filename                 Name of Capture File
  31.  
  32.       This procedure tells the Capture routines what name to
  33.       give to the capture file. It returns nothing.
  34.  
  35.  
  36.     SetCapture(SHORT),SHORT,PASCAL,NAME('SETCAPB')
  37.  
  38.       SHORT     flag                      0 = Turn Buffer Off
  39.                                           1 = Turn Buffer On
  40.  
  41.     This function turns the Capture buffer On or Off. It returns
  42.     0 for no error or 1 if there is an error allocating memory or
  43.     opening the file.
  44.  
  45.     You must be sure to call SetCapture with the 'flag' parameter
  46.     set to 1 when you are finished with the capture file. Otherwise
  47.     buffer memory will remain allocated and the buffer contents
  48.     will not be flushed to disk.
  49.  
  50.  
  51.   The following is an example of using a capture buffer:
  52.  
  53.     DATA
  54.  
  55.     gotcap      BYTE                      ! true if designated a Capture File
  56.     ScrFile     CSTRING(64)               ! Name of ScrollBack File
  57.     CapFile     STRING(64)                ! Name of Capture File
  58.  
  59.     CODE
  60.  
  61.     ! set up an automatic Scroll Back Buffer, User doesn't have 
  62.     ! to do anything
  63.  
  64.     gotcap = 0                            ! if 1, use designated Capture File
  65.     ScrFile = 'GTERM$$.CAP'               ! Give Scroll File a name
  66.     Do TurnOnCapture                      ! Call routine to turn on Capture
  67.  
  68.     ...                                   ! your program code here
  69.  
  70.     ! end of procedure, close Scroll Back Buffer
  71.  
  72.     retchr = SetCapture(0)                ! Turn Capture Off
  73.  
  74.     Return                                ! Return from Clarion Procedure
  75.  
  76.     TurnOnCapture Routine                 ! Turn on Capture
  77.        SetCaptureFile(ScrFile)            ! Tell the Capture name of file
  78.        if SetCapture(1)                   ! and turn on Capture
  79.           Open(CaptureErr)                ! couldn't allocate memory
  80.           bell()                          ! make noise
  81.           Accept                          ! tell um
  82.           Close(CaptureErr)               ! close error screen
  83.        end
  84.        Exit
  85.  
  86.   
  87.   GTERM gives an excellent example of how to utilize an automatic
  88.   Scroll Back buffer and allow the user to specify a Capture
  89.   Buffer. It also shows how to allow the user to view the contents
  90.   of the Scroll Back or the Capture Buffer, clear the buffer, and
  91.   save it under a different name.
  92.  
  93.  
  94.   There is a new function that allows you to retrieve the Line
  95.   Status. It is called 'LineStat' and is prototyped as follows:
  96.  
  97.     LineStat(SHORT),BYTE,PASCAL,NAME('LINESTAT')
  98.  
  99.     The function is called passing the port number as a parameter. It
  100.     returns a BYTE containing the last Line Status on the port. The
  101.     Line Status contains the following Bit Values (or 0 if there
  102.     was no Line Status interrupt):
  103.  
  104.         Bit 1 = Overrun Error
  105.         Bit 2 = Parity Error
  106.         Bit 3 = Framing Error
  107.  
  108.  
  109. 01/27/94
  110.  
  111.   Fixed a problem with Ymodem Uploads wherein the file that was
  112.   being sent was left open.
  113.  
  114.   Fixed a problem with ASCII Downloads where if you pressed a
  115.   key while the ASCII receive was in progress, the computer would
  116.   lock up.
  117.  
  118.   There is a new global variable that is available to your application.
  119.   It is defined as:
  120.  
  121.          asciidel      SHORT,EXTERNAL,NAME('asciidel')
  122.  
  123.       where 'asciidel' is the number of clock tics to delay after sending
  124.       each line in a file.
  125.  
  126.   The delay was previously hard coded as 2 seconds. It is now 0 seconds
  127.   (no delay) so if you need a delay after sending a line of text, you
  128.   will need to set 'asciidel' to the number of clock tics prior to
  129.   calling the Download function (there are 18 tics per second).
  130.  
  131.   There is an alternate 'SendZmodem' procedure that you may call. It
  132.   is prototyped as follows:
  133.  
  134.       SendZmodem1(SHORT,*CSTRING,*CSTRING,SHORT),SHORT,RAW,NAME('_send_zmodem1')
  135.  
  136.   This alternate procedure allows you to control the file sends according
  137.   to your needs. This is especially useful if you need to send more than
  138.   1 file and the files are not all in the same directory.
  139.  
  140.     SendZmodem1(port,filename,path,flag)
  141.  
  142.     SHORT   port                          COM Port Number
  143.     CSTRING filename                      Name of File To Send
  144.     CSTRING path                          Path of File To Send
  145.     SHORT   flag                          Control Flag
  146.  
  147.     Filename is the name of the file you wish to send. This should
  148.     be a NULL (filename = '') when ending the batch.
  149.  
  150.     Path is the full path to where the file is located. It should be
  151.     in the form of 'C:\FILES', without a trailing slash.
  152.  
  153.     Flag is defined as follows:
  154.  
  155.         0 = This is the First File in the Batch
  156.       > 0 = This is the Second and Subsequent File
  157.        -1 = End the Batch (no more files to send)
  158.  
  159.     You must always End the Batch with Zmodem. If you only have
  160.     1 file to send, you would call this function twice. If you
  161.     have 3 files to send, you would call this function 4 times.
  162.  
  163.     Generally, you call this function from within a loop where the
  164.     control variable is passed as the flag parameter. After all files
  165.     are sent, you then call 'SendZmodem1' with a flag value of -1.
  166.  
  167.     The function returns 0 if the send was successful, or a 1 if
  168.     the file could not be opened or there was an error sending the
  169.     file.
  170.  
  171.     Example:
  172.  
  173.        r     SHORT
  174.        fname CSTRING(100)
  175.        fpath CSTRING(160)
  176.  
  177.        Loop r = 0 TO 3                    ! 4 files to send
  178.           fname = clip(files[r+1])        ! get file name
  179.           fpath = clip(filepath[r+1])     ! get file's path
  180.  
  181.           If SendZmodem1(port,fname,fpath,r) != 0
  182.              Break
  183.           End
  184.        End
  185.  
  186.        fname = ''
  187.        r = SendZmodem1(port,fname,fname,-1)  ! end the Batch
  188.  
  189.  
  190. 11/19/93
  191.  
  192.   You may now set the size of the Receive Buffer when using the
  193.   Direct Interface. The Receive Buffer defaults to 6144 bytes. This
  194.   has proven to be the optimal size for high speed communications when
  195.   using a file transfer protocol such as Ymodem-G. However you may
  196.   increase or decrease this size by adding the following to your
  197.   Global Data Section:
  198.  
  199.           combufsiz     USHORT,EXTERNAL,NAME('combufsiz')
  200.  
  201.     Prior to calling 'SetPort', set the size of the Receive Buffer
  202.     you desire.
  203.  
  204.     Example:
  205.  
  206.        combufsiz = 1024                   ! use 1k buffer
  207.  
  208.        if SetPort(0,0,0)                  ! Set Up COM 1
  209.           ShowError('Unable To Initialize Port')
  210.        end
  211.  
  212.  
  213.   Three new functions have been added and are prototyped as follows:
  214.  
  215.     RecvCount(SHORT),USHORT,PASCAL,NAME('RCVCOUNT')
  216.     PeekChr(SHORT,BYTE),SHORT,PASCAL,NAME('PEEKCHR')
  217.     ComGets(SHORT,*CSTRING,BYTE),SHORT,PASCAL,RAW,NAME('COMGETS')
  218.  
  219.  
  220.     RecvCount returns the number of characters in the Receive Buffer
  221.     waiting to be read.
  222.  
  223.        port    SHORT
  224.        numchrs USHORT
  225.  
  226.        port = 0                           ! use COM 1
  227.  
  228.        numchrs = RecvCount(port)          ! get # of chars in buffer
  229.  
  230.  
  231.  
  232.     PeekChr returns true (1) if a certain character is in the Receive
  233.     Buffer. If the character is not in the buffer, it returns 0.
  234.  
  235.        port SHORT
  236.  
  237.        port = 0                           ! use COM 1
  238.  
  239.        if PeekChr(port,10)                ! check for Line Feed
  240.           ! there is a Line Feed in the Buffer
  241.        end
  242.  
  243.  
  244.  
  245.     ComGets retrieves a string of characters up to, but not including
  246.     a certain character. In stores the characters in the string that
  247.     you pass as a parameter. Characters are stored until the terminator
  248.     is encountered. The terminator is read, but not stored.
  249.  
  250.     You pass the following parameters to the function:
  251.  
  252.        port       - COM Port Number
  253.        string     - a CSTRING of sufficient length
  254.        terminator - the character to look for
  255.        
  256.     The return value is either 0 or the number of characters stored in
  257.     the string. If a 0 is returned, it means the terminating character
  258.     was the first character in the Receive Buffer (in this case, the
  259.     passed string will set to a NULL string)
  260.  
  261.     Warning: This function does NOT time out. It will not return until
  262.              it encounters the terminator. Unless you know for a fact
  263.              that the terminating character is in the Receive Buffer,
  264.              you should call PeekChr first to make certain that the
  265.              terminating character is in the buffer.
  266.  
  267.              The string passed to this function must be of sufficient
  268.              length to hold all of the characters that are stored 
  269.              while looking for the terminator. It is very easy to
  270.              overwrite code or data with this function if the passed
  271.              string parameter is not large enough to hold all of the
  272.              data.
  273.  
  274.  
  275.        port     SHORT
  276.        numbytes SHORT
  277.        comstr   CSTRING(255)
  278.  
  279.        port = 0                               ! use COM 1
  280.  
  281.        if PeekChr(port,10)                    ! check for Line Feed
  282.           numbytes = ComGets(port,comstr,10)  ! get the string
  283.        end
  284.