| View previous topic :: View next topic |
| Author |
Message |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Tue Aug 29, 2006 2:27 pm Post subject: Find and Find Next |
|
|
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..
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
Nathan |
|
| Back to top |
|
 |
uvedese Contributor


Joined: 21 Jan 2006 Posts: 169 Location: Spain
|
Posted: Tue Aug 29, 2006 4:26 pm Post subject: |
|
|
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 |
|
 |
Aslan Valued Contributor


Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Sat Sep 02, 2006 4:49 pm Post subject: |
|
|
: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  |
|
| Back to top |
|
 |
|
|
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
|
|