CT_GETINPUT

 GETINPUT()
 Keyboard input function similar to a GET field
------------------------------------------------------------------------------
 Syntax

     GETINPUT(<cDefault>,[<nRow>],[<nColumn>],[<lSAY>],
        [<cPrompt>]) --> cInput

 Arguments

     <cDefault>  Designates the content and length of the input field.

     <nRow>  Designates the row in which the input occurs.  The default
     is the current cursor position.

     <nColumn>  Designates the column in which the input occurs.  The
     default is the current cursor position.

     <lSAY>  When you specify .T. and close GETINPUT(), the actual data
     input is displayed with the standard color attribute.

     <cPrompt>  Designates text to display in front of the input field at
     the selected coordinates.  The default is no prompt text.

 Returns

     GETINPUT() returns the input string.

 Description

     If you call this function, a simple input field is made available.  All
     control keys are interpreted exactly as in a Clipper GET mask.  The
     length and default for the string are specified in the <cDefault>
     parameter.  This allows you to portray a normal input field with VAR=
     SPACE(length).  The input field starts at the current cursor position or
     at the designated row and column.  Similar to @ ... SAY...GET,  you can
     also display text just before the input text.  The field starting
     position is moved accordingly.

     In the Clipper SET COLOR TO command, the first color you designate
     stands for screen output; the second for input fields. GETINPUT() uses
     these color designators exactly like Clipper.  If you designate the
     <lSAY> parameter as .T., you can determine (as with a SAY), whether to
     redisplay the data in its amended form at the point of input.  After
     data input is complete, the data displayed on the screen is the same as
     the values returned by the function.  This is useful when an input
     breaks off due to an ESC.  For example, the data is "the quick brown
     fox" and you change it to "the slow brown fox".  If <lSAY> is .T. and
     you press escape, the original data (the quick brown fox) is restored.
     The affected area also contains the default color attribute.

 Notes

     .  GETINPUT() uses the Clipper console input internal routines
        and supports the INS display in SCOREBOARD.  In addition, the SET
        ESCAPE, SET BELL, SET INTENSITY, SET DELIMITERS, and SET CONFIRM
        switches are acknowledged.

     .  Key traps may occur within GETINPUT() when the cursor position
        within a field is saved.  GETINPUT() is then called recursively, as
        long as sufficient stack memory is available.

 Examples

     .  Input at the current cursor position:

        cVar := SPACE(20)           // 20 position input field
        cVar := GETINPUT(cVar)      // Retain input attribute

     .  Input a 10 space field, row 10, column 20:

        cVar := GETINPUT(SPACE(10), 10, 20)

     .  After input is finished, the actual data input is redisplayed
        on the screen.  This area contains the standard color attribute.  The
        input is moved by the text preceding the input field:

        SET CONFIRM ON              //  Close with RETURN
        cVAR := "Default text"
        GETINPUT(cVar, 10, 20, .T., "Please input: ")

See Also: GETSECRET()



CT_GETFLDVAR

 GETFLDVAR()
 Determines the name of a GET field
------------------------------------------------------------------------------
 Syntax

     GETFLDVAR([<nField>]) --> cField

 Argument

     <nField>  Designates for which number of the GET field to determine
     the name of the accompanying variable.  The default is the currently
     active field.

 Returns

     GETFLDVAR() returns the name for the first position of the currently
     active or specified field.  If there is an invalid parameter, a value of
     -1 is returned.

 Description

     GET FIELD VARIABLE
     This function determines the name of an input field.  If the <nField>
     parameter is not specified, the function returns the name for the
     currently active field.  With an invalid field number or if there is on
     active field, a value of -1 is returned

 Examples

     .  Display the name of the variable associated with the second
        posted GET:

        @ 10, 10 GET VAR1
        @ 10, 20 GET VAR2
        @ 10, 30 GET VAR3

        ? GETFLDVAR(2)               //  "VAR2"

     .  Display the name for the active field:

        READ                         // Assuming field 1 is active
        ? GETFLDVAR()                // "VAR1"

     .  Within a UDF or KEYTRAP procedure:

        ? GETFLDVAR()                // "VAR1"

See Also: GETFLDROW() CURRENTGET() COUNTGETS()

 

CT_GETFLDROW

 GETFLDROW()
 Determines the row of a GET field on the screen
------------------------------------------------------------------------------
 Syntax

     GETFLDROW([<nField>]) --> nRow

 Argument

     <nField>  Designates the number of the GET field for which the
     screen is determined.  The default is the currently active field.

 Returns

     GETFLDROW() returns the screen row for the first position of the
     currently active or specified field.  If there is an invalid parameter a
     value of -1 is returned.

 Description

     GET FIELD ROW
     This function determines the first row of an input field.  If the
     <nField> parameter is not specified, the function returns the row for
     the currently active field.  When <nField> is an invalid field number or
     if there are no active GET fields, a value of -1 is returned.

 Examples

     .  Display the row for the second posted GET:

        @ 10, 10 GET....
        @ 11, 20 GET....
        @ 12, 30 GET.....

        ? GETFLDROW(2)            // Result: 11
        READ                      // Assuming field 1 is active
        ? GETFLDROW()             // Result: 10

See Also: GETFLDCOL() CURRENTGET() COUNTGETS()

 

CT_GETFLDCOL

 GETFLDCOL()
 Determines the screen column of a GET field
------------------------------------------------------------------------------
 Syntax

     GETFLDCOL([<nField>]) --> nColumn

 Argument

     <nField>  Designates the number of the GET field for which the
     screen column is determined.  The default is the currently active field.

 Returns

     GETFLDCOL() returns the screen column for the first position of the
     currently active or the specified field.  If there is an invalid
     parameter, a value of -1 is returned.

 Description

     GET FIELD COLUMN
     This function determines the first column of an input field.  If the
     <nField> parameter is not specified, the function returns the column for
     the currently active field.  With an invalid field number or in a
     situation where there is no active field, a value of -1 is returned.

 Examples

     .  Display the screen column for the second posted GET:

        @ 10, 10 GET....
        @ 10, 20 GET....
        @ 10, 30 GET.....

        ? GETFLDCOL(2)            // Result: 20

     .  Display the column for the currently active GET field:

        READ                      // Assuming field 1 is active
        Within a UDF or KEYTRAP procedure:
        ? GETFLDCOL()             // Result: 10

See Also: GETFLDROW() CURRENTGET() COUNTGETS()

 

CT_CURRENTGET

 CURRENTGET()
 Determines the number of the currently active GET field
------------------------------------------------------------------------------
 Syntax

     CURRENTGET() --> nField

 Returns

     CURRENTGET() returns the number of the currently active GET field.

 Description

     CURRENTGET() determines the number of the currently active GET fields.
     This information is useful in functions called through VALID.

 Example

     Pass the number of the active GET fields as a parameter:

     @@ XX,YY GET field  VALID MYFUNC(CURRENTGET())

See Also: COUNTGETS() GETFLDROW() GETFLDCOL()



CT_COUNTGETS

 COUNTGETS()
 Determines the number of posted GET fields
------------------------------------------------------------------------------
 Syntax

     COUNTGETS() --> nFields

 Returns

     COUNTGETS() returns the number of currently posted fields within a READ.

 Description

     COUNTGETS() determines how many GET fields are currently open in a VALID
     UDF or within a KEYTRAP procedure.  Posted means the GET fields have
     been recently defined before with @ ...GET ...

 Examples

     .  Display the number of GET fields that are currently posted
        from within a valid UDF:

           @ 10, 10 GET Field1
           @ 10, 20 GET Field2 VALID MYFUNC()
           @ 10, 30 GET Field3
        READ
        RETURN

     .  Returns COUNTGETS() within the UDF:

        FUNCTION MYFUNC
           ? COUNTGETS()          // Result: 3
           RETURN(.T.)

See Also: CURRENTGET()

 

CT_TAN

 TAN()
 Computes the tangent of a radian value
------------------------------------------------------------------------------
 Syntax

     TAN(<nArc>) --> nTangent

 Argument

     <nArc>  Designates the radian value to determine as a tangent.

 Returns

     TAN() returns the tangent for the <nArc> specified value.

 Description

     TAN() determines the tangent of a value specified in radians.

 Note

     .  If you want to represent the value in degrees, convert it with
        the DTOR() function.

 Example

     Some tangent calculations:

     ? STR(TAN(0), 18, 15)            //  1.000000000000000
     ? STR(TAN(PI() /4), 18, 15)      //  1.000000000000000
     ? STR(TAN(PI() /9), 18, 15)      //  0.363970234266202

See Also: SIN() COS() COT() DTOR()

 

CT_SIN

 SIN()
 Computes the sine of a radian value
------------------------------------------------------------------------------
 Syntax

     SIN(<nArc>) --> nSine

 Argument

     <nArc>  Designates the radian value to determine as a sine.

 Returns

     SIN() returns the sine for the <nArc> specified value.

 Description

     SIN() determines the sine of a a specified radian value.

 Example

     Show some sine calculations:

     ? STR(SIN(PI() /4), 18, 15)         // 0.707106781186548
     ? STR(SIN(PI() /2), 18, 15)         // 1.000000000000000
     ? STR(SIN(PI() *99.5), 18, 15)      //-1.000000000000000
     ? STR(SIN(PI() /9), 18, 15)         // 0.342020143325669

See Also: COS() TAN() COT() DTOR()

 

CT_SIGN

 SIGN()
 Determines the mathematical sign of a number
------------------------------------------------------------------------------
 Syntax

     SIGN(<nValue>) --> nSign

 Argument

     <nValue>  Designates the number to determine as a mathematical sign.

 Returns

     SIGN() returns 1, 0, or -1, based on whether the number passed as a
     parameter is positive, null, or negative.

 Description

     This function simplifies mathematical expressions.  If constructions or
     functions become unnecessary.  SIGN() returns three different values, in
     accordance with the specified parameter:

        1        positive numbers
        0        the number 0
       -1        negative numbers

 Examples

     .  Show a positive number:

        ? SIGN(48335)      // Result: 1

     .  Show a negative number:

        ? SIGN(-258)       // Result: -1

 

CT_SETPREC

 SETPREC()
 Sets the precision level for trigonometric functions
------------------------------------------------------------------------------
 Syntax

     SETPREC(<nPrecision>) --> cNull

 Argument

     <nPrecision>  Designates the number of places for computational
     precision in the range of 1 to 16.  The default value is 16.

 Returns

     SETPREC() always returns a null string.

 Description

     SET PRECISION
     
     Clipper Tools works with the default precision set at 16 places to
     the right of the decimal for trigonometric functions.  If you do not
     want this precision level, or you want a faster execution speed, reduce
     the number of places accordingly.  The following functions are affected:

     SIN()  COS()  TAN()  COT()  ASIN()  ACOS()  ATAN()  ATN2()

 Example

     Set a precision level of 10 places:

     SETPREC(10)         // Always returns a null string

See Also: GETPREC() SIN() COS() TAN() COT() ASIN() ACOS()