dappel
How to manipulate a string June 07, 2009 05:30PM |
Ola
Re: How to manipulate a string June 07, 2009 06:30PM |
Fabrice Harari
Re: How to manipulate a string June 07, 2009 07:23PM |
dappel
Re: How to manipulate a string June 07, 2009 08:45PM |
64 bytes arent gonne do itQuote
Hi
I'm not sure what you are trying to achieve here, but just in case, you should perhaps look at iniread and iniwrite in the help...
If what you have to read write is less than 64 KB, than it's a much easier solution
Best regards
Quote
Hi dappel //Not tested, but should go something like this:
//First you read the line into a variable like WholeLine
//WholeLine holds the whole line that you have read
//Then you check where the ">" is situated in the line
// -- I assume here that there is only one ">" in the line...
Endpos is int = position(WholeLine,">",1,FromEnd) - 1
//Then you can check for the length of the tag name
NetLength is int = Endpos - 3 //3 is the length of "Tag"
//use 4 if there is a space as in your question, like "Tag "
//ControlString will hold the control tag name only
ControlString is string = middle(WholeLine,4,NetLength)
//Use 5 in lieu of 4 as starting position, if there is the space...
//Maybe there are easier ways, but I always do things the hard way:-)
//regards
//Ola
WholeLine,ControlString are strings Endpos,NetLength,nIdFil are int // Open the file nIdFil = fOpen("D:\peter\stop.txt", foReadWrite) // WholeLine = fReadLine(nIdFil) Endpos = Position(WholeLine,">",1,FromEnd) - 1 NetLength = Endpos - 3 //3 is the length of "Tag" ControlString = Middle(WholeLine,4,NetLength) ControlString =EDT_Edit1source loadit from exstern text file
dappel
Re: How to manipulate a string June 07, 2009 09:00PM |