forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

%eb and highlighting text

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
BILLDOWS



Joined: 22 Jul 2005
Posts: 86
Location: Swansea, UK

PostPosted: Tue Jul 26, 2005 4:47 am    Post subject: %eb and highlighting text Reply with quote


I use %eb to display a read-only file and use FIND_EDIT_STRING to locate the text, and highlight the line containing a user provided search string. If the string is there multiple times then on each occasion when the user activates 'Find' I simply advance to the line following the previous entry and perform the FIND_EDIT_STRING again. Works fine.

However (typically) it has been suggested that when FIND is carried out then immediately each line containing the given text should be highlighted / coloured in some way - rather than one at a time.

If I firstly scanned the whole file for the matches with the given string, stored the line numbers and then used %tc to colour lines in some way would this allow multiple lines in the file to be coloured?

Many Thanks

Bill

Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Jul 27, 2005 1:14 am    Post subject: %eb and highlighting text Reply with quote

Yes you can do this but the coding is not trivial.
You need to get an address from the edit_info array and then use CORE4 as illustrated in the following code....

WINAPP
c------------------------------------------------------
INTEGER i,edit_inf(24),winio@
COMMON edit_inf
EXTERNAL eb_cb
i=winio@('%`^40.10eb[user_colours,extended]','*',0,edit_inf,eb_cb)
END
c-------------------------------------------------------
INTEGER FUNCTION eb_cb()
INCLUDE <windows.ins>
INTEGER edit_inf(24)
COMMON edit_inf
IF(edit_inf(15).gt.0)THEN
c Make first character on the line red
core4(edit_inf(17))=RGB@(255,0,0)
c Make the last character on the line blue
core4(edit_inf(17)+4*(edit_inf(15)-1))=RGB@(0,0,255)
ENDIF
eb_cb=0
END
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group