[Gambas-user] analyse an text-streams or strings

Charlie karl.reinl at ...9...
Fri Jan 24 21:14:15 CET 2003


Jochen Georges schrieb:

>hello gambanauts,
>
>i want to play with words :-)
>
>so i have to analyze text-streams and/or strings.
>
>111
>how can i read [single characters] [single words] from an opened 
>textfile?
>
? for read in or after file.read / line input  (see below)

>222
>how can i divide a string into [single characters] [single words] ?
>  
>
You have to take the read in String, and treat him with left/right/mid/ 
split

for words see 'split'   

for chars a for-next/each with mid (String,start,length) to use
   
    for nI = 1 to len(string)
        myChar=mid (String,nI,1)
    next

another way is after open to navigate with 'seek' in the file

>333
>is there a function alike LINE INPUT - like CHAR INPUT
>  
>
don't know,
but classic reads are a LOF (end of line) or EOF (end of file).
And once a line or file in the buffer, you can treat it without phisical 
action on a media.

>thanks for any hint
>
>beste gruesse
>jochen
>  
>







More information about the User mailing list