Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CC.LIB - ClipCode CLIPPER S'87 Library - <b>str2rec() replace all fields in a dbf record from a string variable</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 STR2REC()   Replace all fields in a DBF record from a string variable

 Syntax....: STR2REC( str, fname, ftype, fwdth, fdec [,amemolen] )
 Parameters: <expC>: str      = the string to parse
             <arrC>: fname    = field name
             <arrC>: ftype    = field type
             <arrN>: fwdth    = field width
             <arrN>: fdec     = field decimals
 [optional]  <arrN>: amemolen = array of memo field lengths

 Returns...: <expN>: ptr
 Cautions..: 1. USE/SELECT DBF before calling STR2REC()
             2. locate/append the record to replace before calling STR2REC()
             3. assumes 6 digit date string
             4. assumes implied decimal in string
             5. calls COMMIT before returning
 CC Calls..: DATE2STR() to convert "901225" to <expD> = 12/25/90
 Alias.....: none

 Example...: flds= FCOUNT()
             PRIVATE fname[flds], ftype[flds], fwdth[flds], fdec[flds]
             AFIELDS( fname, ftype, fwdth, fdec )
             STR2REC( "abcdefg123", fname, ftype, fwdth, fdec )

 Comments..: This function is very useful in data driven programming.
             If your data can be parsed into a string, you can import
             that data into a DBF file using this function.

See Also:

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