CSetRef()

CSetRef()

Determine return value of reference sensitive CT3 string functions

Syntax

      CSetRef( [<lNewSwitch>] ) -> lOldSwitch

Arguments

[<lNewSwitch>] .T. -> suppress return value .F. -> do not suppress return value

Returns

lOldSwitch old (if lNewSwitch is a logical value) or current state of the switch

Description

Within the CT3 functions, the following functions do not change the length of a string passed as parameter while transforming this string:

ADDASCII() BLANK() CHARADD() CHARAND() CHARMIRR() CHARNOT() CHAROR() CHARRELREP() CHARREPL() CHARSORT() CHARSWAP() CHARXOR() CRYPT() JUSTLEFT() JUSTRIGHT() POSCHAR() POSREPL() RANGEREPL() REPLALL() REPLLEFT() REPLRIGHT() TOKENLOWER() TOKENUPPER() WORDREPL() WORDSWAP()

Thus, these functions allow to pass the string by reference [@] to the function so that it may not be necessary to return the transformed string. By calling CSetRef (.T.), the above mentioned functions return the value .F. instead of the transformed string if the string is passed by reference to the function. The switch is turned off (.F.) by default.

Compliance

This function is fully CT3 compatible.

Platforms

All

Files

Source is ctstr.c, library is ct3.

Seealso

ADDASCII(), BLANK(), CHARADD(), CHARAND(), CHARMIRR(), CHARNOT(), CHAROR(), CHARRELREP(), CHARREPL(), CHARSORT(), CHARSWAP(), CHARXOR(), CRYPT(), JUSTLEFT(), JUSTRIGHT(), POSCHAR(), POSREPL(), RANGEREPL(), REPLALL(), REPLLEFT(), REPLRIGHT(), TOKENLOWER(), TOKENUPPER(), WORDREPL(), WORDSWAP()

SP_ISBLANKREC

ISBLANKREC()

  Short:
  ------
  ISBLANKREC() Determines if a record is blank

  Returns:
  --------
  <lIsblank> => is the record blank

  Syntax:
  -------
  ISBLANKREC()

  Description:
  ------------
  Returns True if the record is all blanks

  Examples:
  ---------
   LOCATE for ISBLANKREC()

   if found()
     // re-use
   else
     APPEND BLANK
   endif

  Source:
  -------
  S_BLANK.PRG

 

CT_BLANK

 BLANK()
 Creates a blank value for each data type
------------------------------------------------------------------------------
 Syntax

     BLANK([<expValue>], [<lMode>]) --> xBlank

 Arguments

     <expValue>[@]  Designates any valid expression; the type is not
     important.

     <lMode>  Designates whether or not the length of the <expValue> is
     to change in the event that <expValue> is a string.  If .T. is
     designated, the length is retained.  The default value is Change Length
     (.F.).

 Returns

     BLANK() returns a blank value with the same data type as the <expValue>
     parameter.

 Description

     BLANK() clears desired data fields with the variables.  BLANK() returns
     the following results:

     Table 13-1: Data Type Blank Values
     ------------------------------------------------------------------------
     Argument            Returned Value
     ------------------------------------------------------------------------
     Character string    Null string or blank string
     Numeric             Value of 0
     Logical             .F.
     Date                A blank date
     ------------------------------------------------------------------------

     The default for <lMode> is .F. and produces a null string when a
     character string is input.  However, if this parameter is designated as
     .T.., the string length is not changed.

 Notes

     .  SET DATE has no affect on how BLANK() handles a date.  The
        blank date display is created in the format you select.

     .  You can suppress the value this function returns by
        manipulating strings through CSETREF() implementation.  To save room
        in the working memory, designate <lMode> as .T..

 Example

     Display blank values for data-type values:

     SET DATE AMERICAN
     ? BLANK(DATE())          // "  /  /  "
     ? BLANK()                // .F.
     ? BLANK(.T.)             // .F.
     ? BLANK(99)              //  0
     ? BLANK("abc")           // ""
     ? BLANK("11:59:59")      // ""
     ? BLANK("abc", .T.)      // "  " Blank string

See Also: CSETREF()



Tools – Miscellaneous Functions

Introduction Miscellaneous Functions
ALLOFREE()*  Determines the maximum memory size allocation
BLANK()      Creates a blank value for each data type
COMPLEMENT() Forms the complement value of a data type
DATATYPE()*  Determines the data type of a variable or UDF
GETTIC()     Determines the number of timer ticks
KBDDISABLE() Locks/unlocks the keyboard
KBDEMULATE() Inserts characters into BIOS keyboard buffer to emulate input
KBDSPEED()   Sets keyboard auto repeat speed
KBDSTAT()    Tests for key shift state status, such as Ctrl and Shift
KBDTYPE()    Determines the type of keyboard in use
KEYSEC()     Triggers a key trap after a time delay
KEYTIME()    Triggers a key trap at a specific clock time
MILLISEC()   Time delay in milliseconds
NUL()        Converts the value returned by a function into a null string
SCANKEY()    Queries scan code of keyboard input
SETTIC()     Increases number of time ticks
SHOWKEY()    Continuously displays the INSERT and LOCK status
SOUND()      Creates tones (melodies) by designating frequency and duration
SPEED()      A comparison value used to determine the processor speed
STACKFREE()  Determines the remaining stack space
TOOLVER()    Queries the version number of the Clipper Tools in use
XTOC()       Converts an expression of any data type into a string