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_poke()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 V_POKE()
 Write character data into a character type VLF
-------------------------------------------------------------------------------

 Syntax

    V_POKE(  <cPointer>,
             <cData>,
             [<nOffset>] )

 Arguments

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

    <cData> is a character string to be written into the data pointed
    to by <cPointer>.  If the length of <cData> is greater than
    V_LEN(<cPointer>) - <nOffset>, the data will be trucated.

    <nOffset> is the offset within the data pointed to by <cPointer>
    at which to begin writing <cData>.  If not specified, <nOffset>
    defaults to 1.

 Returns

    None.

 Description

    V_POKE() is used when you want to overwrite some or all of a
    character type VLF.  V_POKE() is different than V_STUFF() in that
    it does not change or return <cPointer>.  Instead, V_POKE()
    modifies the data directly on the disk at its present location.

    V_POKE() is different than V_REPLACE() in that it cannot extend
    the length of the data pointed to by <cPointer> nor can it release
    any space associated with <cPointer>.

 Notes

  . V_POKE() is most useful when you know that the new data is the
    same length (or a subset) of the old data.

 Examples

    // Open a DBF and a related DBV file.
    USE Main.dbf
    V_USE( "Main.dbv" )

    // Replace can store any length data.
    APPEND BLANK
    REPLACE vlf_fld WITH V_REPLACE( "ABCDEFGH", vlf_fld )

    // Poke some data into the file.
    V_POKE( vlf_fld, "test", 3 )
    ? V_RETRIEVE( vlf_fld )// Result: ABtestGH

    // Try to write past the end of the fields current length.
    V_POKE( vlf_fld, "You cannot do much harm", 3 )
    ? V_RETRIEVE( vlf_fld )// Result: ABYou ca

See Also: V_REPLACE() V_STUFF()

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