HB_IsHash

HB_IsHash()

Tests if the value returned by an expression is a Hash.

Syntax

      HB_IsHash( <expression> ) --> lIsHash

Arguments

<expression> This is an expression of any data type

Return

.T. (true) if the value returned by <expression> is of data type Hash, otherwise .F. (false) is returned.

Description

HB_IsHash() is used to test if a variable contains a hash value or if the result of an expression is of data type Hash. The function can be used as a replacement for the expression: Valtype(<expression>)==”H”.

Seealso

HB_IsArray(), HB_IsBlock(), HB_IsByRef(), HB_IsDate(), HB_IsLogical(), HB_IsMemo(), HB_IsNIL(), HB_IsNull(), HB_IsNumeric(), HB_IsObject(), HB_IsPointer(), HB_IsString(), Type(), Valtype()

HB_IsDateTime

HB_IsDateTime()

Tests if the value returned by an expression is a DateTime value

Syntax

      HB_IsDateTime( <expression> ) --> lIsDateTime

Arguments

<expression> an expression of any data type

Return

.T. (true) if the value returned by <expression> is a DateTime value, otherwise .F. (false) is returned.

Description

HB_IsDateTime() is used to test if a variable contains a DateTime value or if the result of an expression is a DateTime value. The function is the only way to distinguish a DateTime value from a Date value, since Valtype(<expression>) yields “D” for both, Date and DateTime.

Seealso

HB_IsArray(), HB_IsBlock(), HB_IsByRef(), HB_IsDate(), HB_IsHash(), HB_IsLogical(), HB_IsMemo(), HB_IsNIL(), HB_IsNull(), HB_IsNumeric(), HB_IsObject(), HB_IsPointer(), HB_IsString(), Type(), Valtype()

HB_IsDate

HB_IsDate()

Tests if the value returned by an expression is a Date.

Syntax

      HB_IsDate( <expression> ) --> lIsDate

Arguments

<expression> an expression of any data type

Return

.T. (true) if the value returned by <expression> is of data type Date, otherwise .F. (false) is returned.

Description

HB_IsDate() is used to test if a variable contains a date value or if the result of an expression is of data type Date. The function can be used as a replacement for the expression: Valtype(<expression>)==”D”.

Seealso

HB_IsArray(), HB_IsBlock(), HB_IsByRef(), HB_IsDateTime(), HB_IsHash(), HB_IsLogical(), HB_IsMemo(), HB_IsNIL(), HB_IsNull(), HB_IsNumeric(), HB_IsObject(), HB_IsPointer(), HB_IsString(), Type(), Valtype()

HB_IsByRef

HB_IsByRef

Tests if a parameter is passed by reference.

Syntax

      HB_IsByRef( @<variable> ) --> lIsByReference

Arguments

@<variable> <variable> is the symbolic name of any parameter passed to a function, method or procedure

Return

.T. (true) if the variable <variable> is passed by reference, otherwise .F. (false) is returned.

Description

Function HB_IsByRef() is used to test if a variable is passed by reference to a function, method or procedure. This requires to pass <variable> by reference to HB_IsByRef(). If <variable> is not passed by reference to HB_IsByRef(), a runtime error is raised.

See also

HB_IsArray(), HB_IsBlock(), HB_IsDate(), HB_IsHash(), HB_IsLogical(), HB_IsMemo(), HB_IsNIL(), HB_IsNull(), HB_IsNumeric(), HB_IsObject(), HB_IsPointer(), HB_IsString(), Type(), Valtype()

HB_IsArray

HB_IsArray()

Tests if the value returned by an expression is an array.

Syntax

      HB_IsArray( <expression> ) --> lIsArray

Arguments

<expression> This is an expression of any data type

Return

.T. if the value of <expression> is an array, otherwise .F. (false)

Description

Function HB_IsArray() is used to test if a variable contains an array or if the result of an expression is of data type Array.

The function can be used as a replacement for the expression: Valtype(<expression>)==”A”.

Seealso

HB_IsBlock(), HB_IsByRef(), HB_IsDate(), HB_IsHash(), HB_IsLogical(), HB_IsMemo(), HB_IsNIL(), HB_IsNull(), HB_IsNumeric(), HB_IsObject(), HB_IsPointer(), HB_IsString(), Type(), Valtype()

REQUEST

REQUEST

Declare a module request list

Syntax

      REQUEST <name1> [,<nameN>]

Arguments

<idModule list> is the list of modules that will be linked into the current executable (.EXE) file.

Description

REQUEST is a declaration statement that defines a list of module identifiers to the linker. Like all other declaration statements, a REQUEST statement must be specified before any executable statements in either the program file, or a procedure or user-defined function definition.

During the compilation of Clipper source code, all explicit references to procedures and user-defined functions are made to the linker. In some instances, within a source file, there may be no references made to procedure or user-defined function names until runtime. REQUEST resolves this situation by forcing the named procedures or user-defined functions to be linked even if they are not explicitly referenced in the source file. This is important in several instances:

. Procedures, user-defined functions, or formats referenced with macro expressions or variables

. Procedures and user-defined functions used in REPORT and LABEL FORMs and not referenced in the source code

. User-defined functions used in index keys and not referenced in the source code

. ACHOICE(), DBEDIT(), or MEMOEDIT() user functions

. Initialization procedures declared with the INIT PROCEDURE statement

. Exit procedures declared with the EXIT PROCEDURE statement

To group common REQUESTs together, place them in a header file and then include (#include) the header file into each program file (.prg) that might indirectly use them.

Examples

      .  This example shows a typical header file consisting of common
         REQUESTs for REPORT FORMs:
      // Request.ch

      REQUEST HARDCR
      REQUEST TONE
      REQUEST MEMOTRAN
      REQUEST STRTRAN

      OR :

      REQUEST HARDCR, TONE, MEMOTRAN, STRTRAN

Seealso

ACHOICE(), ANNOUNCE, DBEDIT(), EXIT, PROCEDURE; EXTERNAL*

ISPRINTER

ISPRINTER()

Determine whether LPT1 is ready

Syntax

      ISPRINTER() --> lReady

Returns

ISPRINTER() returns true (.T.) if LPT1 is ready; otherwise, it returns false (.F.).

Description

ISPRINTER() is a printer function that determines whether the parallel port (LPT1) is online and ready to print. ISPRINTER() is hardware-dependent and, therefore, only works on IBM BIOS compatible systems.

You can check ISPRINTER() to make sure the printer is ready before you begin a print operation; however, if an error occurs during the print operation, a runtime error is generated.

Examples

      .  This example tests the parallel port for readiness with up to
      25 retries.  If the parallel port is ready, the printer operation
      begins:

      LOCAL nCount := 0, nTimes := 25, lReady
      //
      DO WHILE nCount++ <= nTimes .AND. !(lReady := ;
            ISPRINTER())
      ENDDO
      //
      IF lReady
         REPORT FORM Sales TO PRINTER
      ELSE
         ? "Printer not ready..."
         BREAK
      ENDIF

Seealso

SET DEVICE, SET PRINTER

IsDefColor

IsDefColor()

Checks if the default color is set.

Syntax

      IsDefColor() --> lIsDefaultColor

Return

The function returns .T. (true) when the default color string is set with SetColor(), otherwise .F. (false) is returned. The default color string is “W/N, N/W, N/N, N/N, N/W”.

Seealso

IsColor(), SetColor()

ISCOLOR

ISCOLOR()

Determine if the current computer has color capability

Syntax

      ISCOLOR() | ISCOLOUR() --> lBoolean

Returns

ISCOLOR() returns true (.T.) if there is a color graphics card installed; otherwise, it returns false (.F.).

Description

ISCOLOR() is a screen function that allows you to make decisions about the type of screen attributes to assign (color or monochrome). Note that some monochrome adapters with graphics capability return true (.T.).

Examples

      .  This example installs color attribute variables at runtime:

      IF ISCOLOR()
         cBox  = "BG+/B, W/N"
         cSays = "BG/B, W/N"
         cGets = "W/N, N/W"
      ELSE
         cBox  = "W+"
         cSays = "W/N, N+/W"
         cGets = "W/N, N/W"
      ENDIF
      .
      . <statements>
      .
      SETCOLOR(cSays)

Seealso

SETCOLOR()