forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Search and replace for an edit box.

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Fri Oct 28, 2005 2:22 am    Post subject: Search and replace for an edit box. Reply with quote

Anyone have some code to share that is a search and replace for an edit box? Like the search and replace for notepad or any other text editor for that matter. I am finishing up my HTML editor and I have a find and find next, but I would really like to have a replace/replace all function as well and I am haveing a bit of trouble with it.

Thanks a lot.

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Oct 28, 2005 10:31 am    Post subject: Reply with quote

chris,

not sure if i understand your querry but would using string.dll do the trick for you?

it's very easy to use and it can easily do REPLACE for you

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Fri Oct 28, 2005 2:25 pm    Post subject: Reply with quote

I do have string dll, but I want a real time replace like windows notepad. See attached image.


temp.JPG
 Description:
 Filesize:  24.12 KB
 Viewed:  1242 Time(s)

temp.JPG



_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Fri Oct 28, 2005 2:37 pm    Post subject: Reply with quote

Hi Chris,

Here's a 'Find' snippett. Should be able to easily add 'Replace' to it.

Code:

  REM   %%line is the current line number or the line number where the caret is
  %%fndTxt = @input(Enter search text,%%fndTxt)
  REM Char index is the zero based position from the beginning of the string
  REM to the current pos of the caret.
  REM %%charIndex = @richedit(charIndex,%%ed1)
  if @not(@null(%%fndTxt))
    list create,1
    list assign,1,@dlgtext(Ed2)
    list seek,1,%%line
    %%text = @substr(@text(7),%%charIndex,@len(@text(7)))
    %M = @match(1,%%fndTxt)
    %%nLine = @index(1)
    %P = @pred(@pos(%%fndTxt,%%text))
    REM Change the following to use the corresponding @sendmsg()
    REM edit control messages.
    REM richedit setsel,%%ed1,%P,@sum(%P,@len(%%fndTxt))
    REM richedit scrollCaret,%%ed1
    list close,1
  end


Hope this helps, as it is all I can locate at the moment. Smile

Looking over this code, I'm not sure where the reference to string list 7
comes from, as I cannot find the list being used within the program at all.
From the looks of it though, you should be able to change the string list 7
to a 1.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Oct 30, 2005 10:27 pm    Post subject: Reply with quote

Mac once made a Notepad example which could search within an editbox by using the @sendmsg function, if you can find that and just send a keystroke to the edit control once some text is selected, you should be able to create your own Notepad-like search and replace... Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sun Oct 30, 2005 11:47 pm    Post subject: Reply with quote

saves you looking for it Smile

serge



dialog creator.dsc
 Description:

Download
 Filename:  dialog creator.dsc
 Filesize:  2.09 KB
 Downloaded:  1543 Time(s)


_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
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
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group