Freadline starter question

Startbeitrag von dappel am 03.06.2009 00:10

i am using the express version of windev
i am verry new with coding
what i wanne achieve create a prg who can store product names and product information, and cordinates.the idee behind it is when i wane look for a certain product i type it in a search field i get the 3 closest matches select 1 of them and product name + info are shown + location on a map.

so the idee
create a .txt file to store that information
///////////////////////////////////////////////////////////////////////////////////////
/// 1 /product name/product discription/ 20.2/30.1 /// 2/product name/product discription/ 30.1/11.3
// 3 ///
////////////////////////////////////////////////////////////////////////////////////
1 and 2 , 3 represent line numbers
20.2/30.1 represent cordinates
i tried to adept exampel to try to read a line of txt buth when i lounch it
it reads more then 1 line of text and i only want 1 line of text to be read and then try make the machiene select the info thats behind product info,description

so far i have this

nRTF01EXPRESS is int // txt field//
sRTF02content is string
sSlineEXPRESS is string
nRTF01EXPRESS = fOpen(CompleteDir(fExeDir())+"\rabit.rtf.",foReadWrite)
sSlineEXPRESS = fReadLine(nRTF01EXPRESS)
// Browse the file to the end
WHILE NOT sSlineEXPRESS~=EOT

// memorize the line read
IF sRTF02content ~="" THEN
sRTF02content = sSlineEXPRESS
ELSE
sRTF02content = sRTF02content + CR + sSlineEXPRESS
END


// Read next line
sSlineEXPRESS = fReadLine(nRTF01EXPRESS)




END

// give the info to the user
Info("File read succeeded, the file content is: ",sRTF02content)

so how can i make it display 1 line? and then only the things i find usefull
what commands can i use best ?

also some good free site for learning to code with windev woot be nice

Antworten:

Hello Dappel,

See ExtractString and Postion.

The following statements:
Quote
IF sRTF02content ~="" THEN
sRTF02content = sSlineEXPRESS
ELSE
sRTF02content = sRTF02content + CR + sSlineEXPRESS
END



can be written in one line:
sRTF02content+=[CR]+sSlineEXPRESS

HTH.

von Louis Verbraak - am 03.06.2009 07:55
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.