Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Clipper Tools One Guide - <b>introduction</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
INTRODUCTION

  This chapter contains extremely efficient string handling functions.
  High speed is guaranteed, as all function have been exclusively written
  in Assembler.  We have also provided an example for every possible
  exceptional variant.  The following is an explanation of a few ground
  rules pertaining to these functions.

  As in the case of Clipper, the maximum length of a string may be 65520
  characters and may contain CHR(0) characters.  There are also some functions
  that will return a CHR(0).

        ADDASCI()
        CHARADD()
        CHARAND()
        CHARNOT()
        CHARXOR()
        COMPLEMENT()

  Warning:
  Clipper Summer '87 has the ability to process strings that contain CHR(0).
  Problems may arise when such strings are to be placed in a database field
  via the REPLACE command, as Clipper will remove all trailing CHR(0)
  characters.

  Passing values by reference
  Clipper Summer '87 has the ability to pass character string arguments by
  reference to a user-defined function.  This means that a pointer to the
  original string is passed, and therefore an internal copy will not be made.
  The original will be changed when the function makes changes to such an
  argument.  However, this will only concern user-defined functions, not
  Clipper functions.  Some Clipper Tools One functions allow passing by
  reference and will behave differently.  Such functions, or the corresponding
  arguments, will be designated "reference sensitive" and are labeled with
  [@].

  Passing arguments by reference has advantages and disadvantages.  The most
  important advantage is the reduction in the memory requirement.  Runtime
  errors, resulting from insufficient memory available for string manipula-
  tion can, in this way, be avoided.

  It is frequently desirable for the original sting to be changed.  The
  copy passed by value will be changed by the function, which then must
  be assigned back to the original:

        var = "Hello"
        var = MYFUNC(var)

  This method will result in excessive storage space and time, particularly
  for very long strings:

        The reference method:

        var = "Hello"
        MYFUNC(@var)

  It does not make any sense to transfer arguments to functions by reference
  in most Clipper Tools One functions.  However, in some cases, it does make
  a difference when the argument has been transferred in this manner.  The
  functions will change the transferred string directly.  Memory space will
  be saved and the functions will operate faster.  Note the "@" qualifier
  for reference sensitive.

  It is not possible to transfer arguments to functions where the length
  of the string has been changed.  A summary of the functions for which the
  length changes, or can change depending on the application, follows:

        ADDASCI()
        ATREPL()
        CHARONE()
        CHARONLY()
        CHARREM()
        POSDEL()
        POSINS()
        POSREPL()



Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson