For Programmers: Free Programming Magazines  


Home > Archive > Clipper > February 2008 > Nanfor query









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Nanfor query
Charles Foot

2008-02-10, 6:55 pm

Hi ppls,
I can't get NG to run on my XP notebook, so I'm asking here instead.
I seem to recall that in the Nanfor file functions, there is a
s/search function. I thought it was FT_FS( string ), but it's not.
Can anybody elucidate?
Basically, I want to open a text file and search it for a specific string.
Cheers
Chaz
N:dlzc D:aol T:com \(dlzc\)

2008-02-10, 6:55 pm


"Charles Foot" <chaz@equinet.co.nz> wrote in message
news:1202678539.797819@ftpsrv1...
> Hi ppls,
> I can't get NG to run on my XP notebook, so I'm asking here
> instead.
> I seem to recall that in the Nanfor file functions, there is a
> s/search function. I thought it was FT_FS( string ), but
> it's not.
> Can anybody elucidate?


Did you check The Oasis?
http://www.the-oasis.net/ftpmaster....nt=ftputils.htm
.... down to ts.zip (requires CTIII)
.... down to gsr184g.zip
http://www.the-oasis.net/ftpmaster....nt=ftpgenrl.htm
.... down to binary.zip
.... down to scbfnd.zip
.... down to srchtxt.zip

David A. Smith


Klas Engwall

2008-02-10, 9:56 pm

Chaz,

>I can't get NG to run on my XP notebook, so I'm asking here instead.


Download the excellent Windows-based NG replacement WEG from
http://www.davep.org/norton-guides/ and you will be back in business.

>I seem to recall that in the Nanfor file functions, there is a
>s/search function. I thought it was FT_FS( string ), but it's not.
>Can anybody elucidate?
>Basically, I want to open a text file and search it for a specific string.


There is a whole group of functions for reading and writing text files
where each line is considered to be a record. Things like FT_Fuse(),
FT_Frecno(), FT_Fgoto(), FT_Freadln(), FT_Fskip() etc but no
FT_Fs(). You would have to do something like this (adapted from the
NG) and inspect what FT_Freadln() returns:

FT_FUSE( "text.c" )
DO WHILE ! FT_FEOF()
cRecord := FT_FREADLN()
// Check cRecord for the string you are looking for
FT_FSKIP()
ENDDO

Regards,
Klas

-------
klas dot engwall at engwall dot com

http://www.engwall.com/clipper/

The LFN Library for Clipper
The LanMan Library for Clipper
The NFPAT1A Timeslice release patch for the Nanforum Toolkit
AUGE_OHR

2008-02-11, 6:55 pm

hi,

> Basically, I want to open a text file and search it for a specific string.


if you "Text File" ist < 64KB :

cText := MEMOREAD("myTEXT.TXT")
IF UPPER(mySearch) $ UPPER(cText)

greetings by OHR
Jimmy


Charles Foot

2008-02-11, 6:55 pm

Klas Engwall wrote:
> Chaz,
>
>
> Download the excellent Windows-based NG replacement WEG from
> http://www.davep.org/norton-guides/ and you will be back in business.
>
>
> There is a whole group of functions for reading and writing text files
> where each line is considered to be a record. Things like FT_Fuse(),
> FT_Frecno(), FT_Fgoto(), FT_Freadln(), FT_Fskip() etc but no
> FT_Fs(). You would have to do something like this (adapted from the
> NG) and inspect what FT_Freadln() returns:
>
> FT_FUSE( "text.c" )
> DO WHILE ! FT_FEOF()
> cRecord := FT_FREADLN()
> // Check cRecord for the string you are looking for
> FT_FSKIP()
> ENDDO
>
> Regards,
> Klas
>
> -------
> klas dot engwall at engwall dot com
>
> http://www.engwall.com/clipper/
>
> The LFN Library for Clipper
> The LanMan Library for Clipper
> The NFPAT1A Timeslice release patch for the Nanforum Toolkit

Hi Klas
thanks for the link to WEG... now installed. As you say, there is no
FT_FS function.... I'll just have to do it the long way. Cheers
Charles Foot

2008-02-11, 6:55 pm

AUGE_OHR wrote:
> hi,
>
>
> if you "Text File" ist < 64KB :
>
> cText := MEMOREAD("myTEXT.TXT")
> IF UPPER(mySearch) $ UPPER(cText)
>
> greetings by OHR
> Jimmy
>
>

Thanks for the suggestion Jimmy. Unfortunately, some of the files I need
to process are well in excess of 64kb.
I was hoping to input a string and find out on which line of the
document it occurs, but there is no s function available, so it looks
like I'll have to do it the way Klas has suggested. Cheers
Stephen Quinn

2008-02-11, 6:55 pm

Charles

> Basically, I want to open a text file and search it for a specific string.


FT_Browse() is what you want.

--
CYA
Steve


sebas22

2008-02-11, 6:55 pm

On Mon, 11 Feb 2008 21:40:46 GMT, "Stephen Quinn"
<stevejqNO@SPbigpond.AMnet.au> wrote:


See in the NG the exemple for ft_readln(), you can easily adapt it for
your need.[color=darkred]
>
>FT_Browse() is what you want.


Steve, I don't see this function in nanfor.lib, where it is ?

--
Regards,
Sebas
sebas22

2008-02-11, 6:55 pm

On Mon, 11 Feb 2008 23:20:55 +0000, sebas22 <nospam@x.invalid> wrote:

>
>See in the NG the exemple for ft_readln(), you can easily adapt it for
>your need.


I was meaning ft:freadln(), of course.

You have also in GT_FLocate() in GT_lib that does what you want :

GT_FLocate(<nFileHandle>,<cString>,[<lCaseSensitive>],;
[<nStartPos>]) --> nLocation

--
Regards,
Sebas
Stephen Quinn

2008-02-11, 6:55 pm

Charles/Sebas

> Steve, I don't see this function in nanfor.lib, where it is ?


Sorry - it's FBrowse(), not part of the NANFor library

http://www.the-oasis.net/files/general/fbrowse.zip

--
CYA
Steve


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com