Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Clipper > Re: Text to arr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 9 Topic 3850 of 3903
Post > Topic >>

Re: Text to array

by "Stephen Quinn" <stevejqNO@[EMAIL PROTECTED] > Feb 26, 2008 at 03:10 AM

Derek

> How to check now many lines in the files.
> each data width is 4 Char. long.
Get the filesize and divide by 6
    (your 4 character data with CRLF (CHR(13)+CHR(10), Carriage
return/Linefeed) at the end of each line.
Depending on how the file was created there maybe a Ctl+Z (CHR(26)) (EOF
indicator) at the end of the file

> How to move the pointer to next line ?
Something like below should give you an idea (untested code - I just typed
it into this message).

aData   := {}
cBuffer := space(256)
nHandle := FOpen( 'text.txt', FO_READONLY )
FReadLine( nHandle @[EMAIL PROTECTED]
 255 )
cData := trim( cBuffer )
do while ! Empty( cBuffer )
    aadd( aData, cData )
    FReadLine( nHandle @[EMAIL PROTECTED]
 255 )
    cData := trim( cBuffer )
    if cData = CHR(26) .OR. Empty(cData)
        exit
    endif
endif
FClose( nHandle )

I'll leave the error checking to you<g>.

Search on the OASIS for FBrowse, it'll show you how to browse a text file
(open/read/move thru), there are plenty of 
code samples on the OASIS that will also help you (the source for CLICK!
for example).
NANfor.lib, GrumpFish.Lib, SuperLib, etc...

-- 
CYA
Steve




 9 Posts in Topic:
Text to array
"Derek" <dal  2008-02-25 23:43:09 
Re: Text to array
"E. Fridman" &l  2008-02-25 08:25:19 
Re: Text to array
otto <ohaldi@[EMAIL PR  2008-02-25 21:18:49 
Re: Text to array
sebas22 <nospam@[EMAIL  2008-02-25 22:36:32 
Re: Text to array
"Derek Yim" <  2008-02-26 10:25:35 
Re: Text to array
"Stephen Quinn"  2008-02-26 03:10:38 
Re: Text to array
"tom knauf" <  2008-02-26 16:46:59 
Re: Text to array
Ray Marron <google@[EM  2008-02-26 06:38:44 
Re: Text to array
dlzc <dlzc1@[EMAIL PRO  2008-02-26 11:00:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 22:59:38 CDT 2008.