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 


Find and Find Next

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Tue Aug 29, 2006 2:27 pm    Post subject: Find and Find Next Reply with quote

Anyone any ideas how to:

Edit Box: Enter search term,
One button called search:

OK, find in a list the search term and if the user clicks the search button again, it finds the next point and so on..


Smile

Sorry, guys it's been months since i've worked with VDS, but a client needs the app, so any help would be great.

I've bee working on: http://www.airnetwifi.com if anyone fancies a look Smile

Nathan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 169
Location: Spain

PostPosted: Tue Aug 29, 2006 4:26 pm    Post subject: Reply with quote

Hi Rubres_sw.

Try this code:

Code:

  DIALOG CREATE,Test,-1,0,414,349
  DIALOG ADD,EDIT,EDIT1,6,4,277,19,EDIT1
  DIALOG ADD,BUTTON,BUTTON1,4,286,124,24,Search
  DIALOG ADD,LIST,LIST1,28,4,405,317
  DIALOG SHOW
 
  %%searching =
  list loadtext,LIST1
"Hello world
"clicks the search button
"button Search
"click again for search next item
"test click search item list

:evloop
  wait event
  %e = @event()
  goto %e
 
:BUTTON1BUTTON
  %a = @dlgtext(EDIT1)
  if @unequal(%%searching,%a)
    %%searching = %a
    list seek,LIST1,0
  else
    %b = @next(LIST1)
  end
 
  %%find = @match(LIST1,%a)
  if @null(%%find)
    info No match in list!
  end
  goto evloop

__________________

uVeDeSe

visit: http://www.uvedese.es


Last edited by uvedese on Wed Apr 02, 2008 8:44 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Sat Sep 02, 2006 4:49 pm    Post subject: Reply with quote

:SEARCHBUTTON
%%search = @match(<listName>,@dlgtext(<EditBoxName>))
goto evloop

Whenever @match() is used, VDS will start looking from the current index position in the list. If a match is found the pointer is moved to the index position where the match is found. Therefore, unless the user changes the text in the EDIT box, VDS will start the next search from the point where the last match was found.

I might add that you would need to check if the Edit box has changed. If it has changed, then you need to use "List seek,<listName>,0" to move the pointer back to the beginning of the list before starting the search..

Hope this helps Smile
Back to top
View user's profile Send private message Send e-mail
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