Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

colouring lines in a text file in an edit box. 1

Status
Not open for further replies.

coldan

Programmer
Oct 19, 2008
98
AU
In my app I write an ini file with a [Filter] section and I have a View Ini form already setup.

At one point in the program I want to offer the user a chance to view the ini file BUT with only a specific section of the entries shown.

Can I

1 Colour the specific entries ( lines) somehow? or

2 Extract just the [Filter] section entries to a new file somehow?

Thanks

Coldan
 
The second option would be much easier.

One way to extract the desired entries would be to use STREXTRACT(). For example:

Code:
; Contents of INI file
[first]
x = y
p = q
[filter]
a = 1
b = 2
[last]
....

------------------------

* Code to extract [filter] section
lcINI = FILETOSTR("MyFile.INI")
lcFilter = STREXTRACT(lcIni, "[filter]", "[")

* Then go ahead and display the contents 
* of lcFilter

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thanks Mike,

Saved me some 20 lines of code I had tried with fopen() <sigh>


Coldan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top