Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FlexFile Reference Guide - <b>v_type()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 V_TYPE()
 Return the type of data stored in a VLF
-------------------------------------------------------------------------------

 Syntax

    V_TYPE(  <cPointer>,
             <nArea> | <cAlias> )   ->   cType

 Arguments

    <cPointer> is a six byte pointer-field (FlexFile's version of a
    memo-field).

    <nArea> or <cAlias> refers to the number or name of the target DBV
    work area. If not specified, the current DBV work area is assumed.

 Returns

    V_TYPE() returns the type of the data that is pointed to by
    <cPointer>. The possible types and their one character pneumonic
    are detailed in the table under the V_REPLACE() function.

 Description

    V_TYPE() is similar to Clipper's TYPE() function. There are,
    however, more "types" of data that can be stored to a VLF than in
    a Clipper memory variable. For example, Clipper see's a Proclip
    window handle as a numeric. Clipper's TYPE("pw_handle") function
    would return a 'N'. However, if you save the Proclip window to a
    VLF (See V_REPLACE()), the V_TYPE() function will return a 'P'.


 Examples

    // Setup seven variables of differing types.
    LOCAL num_var   ,;
          chr_var   ,;
          date_var  ,;
          log_var   ,;
          arr_var   ,;
          obj_var   ,;
          ffa_var   ,;
          pcw_var

    num_var = 5
    chr_var = "This is a test"
    date_var= DATE()
    log_var = (.T.)
    arr_var = { "Cindy", "Gail", "Edith" }
    obj_var = TBROWSENEW( 5, 5, 20, 50 )
    ffa_var = A_DECLARE( 'S', 5, 5 )// FlexFile double type
    pcw_var = WNDCREATE( 5, 10 ) // Proclip window.

    // Open a DBF file and its associated DBV file
    USE dbf_file
    V_USE( "dbv_file" )

    // Replace the VLF with five different data types.
    APPEND BLANK
    REPLACE vlf WITH V_REPLACE( num_var, vlf )
    ? V_TYPE( vlf )              // Result: 'N'

    REPLACE vlf WITH V_REPLACE( chr_var, vlf )
    ? V_TYPE( vlf )              // Result: 'C'

    REPLACE vlf WITH V_REPLACE( date_var, vlf )
    ? V_TYPE( vlf )              // Result: 'D'

    REPLACE vlf WITH V_REPLACE( log_var, vlf )
    ? V_TYPE( vlf )              // Result: 'L'

    REPLACE vlf WITH V_REPLACE( arr_var, vlf )
    ? V_TYPE( vlf )              // Result: 'A'

    REPLACE vlf WITH V_REPLACE( obj_var, vlf )
    ? V_TYPE( vlf )              // Result: 'O'

    // Note: You must declare the type for a V_REPLACE()
    //    of a flexfile strongly typed array.
    REPLACE vlf WITH V_REPLACE( ffa_var, vlf, , 'F' )
    ? V_TYPE( vlf )              // Result: 'F'

    // Note: You must declare the type for a V_REPLACE()
    //       of a Proclip window handle.
    REPLACE vlf WITH V_REPLACE( pcw_var, vlf, , 'P' )
    ? V_TYPE( vlf )              // Result: 'P'

See Also: V_REPLACE() V_RETRIEVE() V_LEN()

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