| View previous topic :: View next topic |
| Author |
Message |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Mon Feb 14, 2005 6:33 pm Post subject: match and equal question |
|
|
hello
i don't know if this can be done what i'am trying to do is:
i have a list that hold path of programs...now as you know the dir name will chnage i just what the exe name to be checked and if it match do whatever
| Code: |
%j = @item(1,@index(Combo1))
|
now if i do a info %j it does show the full path of the program so how can i get match or equall to check to see if whatever.exe is in the path if not then do something else? i have played with match and equal but problem is it compares the WHOLE path not just the exe...
thanks _________________ Have a nice day  |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Mon Feb 14, 2005 9:16 pm Post subject: |
|
|
Hey Tim,
@match seems to work for me... Check this code out:
| Code: |
Title Matchtest
DIALOG CREATE,Matchtest,-1,0,240,306
DIALOG ADD,LIST,LIST1,41,30,180,193,,MULTI,CLICK
DIALOG ADD,BUTTON,test,261,35,,,test
DIALOG ADD,BUTTON,quit,262,144,64,24,quit
DIALOG SHOW
:Evloop
wait event
goto @event()
:testBUTTON
%a = @dirdlg(Select dir,c:\)
list clear,list1
list filelist,list1,%a
goto evloop
:LIST1CLICK
%b = @item(list1)
Info %b selected
rem this removes the path from %b
%c = @strdel(%b,1,@len(@path(%b)))
info %c is what we will search for...
list seek,list1,0
wait 2
info set index to 0 - @item(list1)
wait 2
%d = @match(list1,%c)
%e = @item(list1)
info %e selected... again
goto evloop
:quitBUTTON
:Close
exit
|
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Mon Feb 14, 2005 9:51 pm Post subject: |
|
|
humm my is a combo list tho... here is more explame of it
| Code: |
DIALOG ADD,COMBO,Combo1,18,9,279,21,
|
| Code: |
LIST CREATE, 1
Rem
LIST ADD, Combo1, "Please Select.................>"
LIST ADD, 1, ""
LIST ADD, Combo1, "-----------------------------------------------------------------------------------------------"
LIST ADD, 1, %%var0\bad.exe
Rem
LIST ADD, Combo1, %%button1
lIST ADD, 1, %%path1
|
the %%button1 is the title that is display in the combo list and %%path1 is the program full path...all this info is stored in a ini file...
thanks _________________ Have a nice day  |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Mon Feb 14, 2005 10:34 pm Post subject: |
|
|
Still don't quite understand your issue... Perhap if you showed me more of your code... It seems to work with a combo list also...
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Feb 14, 2005 11:09 pm Post subject: |
|
|
Hi Tim,
The list commands also work for the ComboBox.
To compare only file names with just @equal():
| Code: |
%lbItem = @name(@item(ListBox1)).@ext(@item(ListBox1))
%%cbItem = @name(@item(ComboBox1)).@ext(@item(ComboBox1))
if @equal(%%lbItem, %%cbItem)
rem Then delete the matching item from which ever list you want.
rem As noted above, 'List Delete,...' will only remove the currently
rem selected item.
end
|
You can also use @match() with the above variables to see if one item
from one list is in the other. _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Mon Feb 14, 2005 11:30 pm Post subject: |
|
|
ok what i;am trying to do is
have it look for test.exe make sure that is in the path before it runs it if not then don't run it...
here is the code ( its to big to post it all but this is the part i'am talking about
| Code: |
DIALOG ADD,COMBO,Combo1,18,9,279,21,,,LIST,CLICK,BigText
|
| Code: |
LIST CREATE, 1
LIST ADD, Combo1, "Please Select.................>"
LIST ADD, 1, ""
LIST ADD, Combo1, "----------------------------------------------------------------------------------------------"
LIST ADD, 1, %%var0\bad.exe
LIST ADD, Combo1, %%button1
lIST ADD, 1, %%path1
|
| Code: |
:Combo1CLICK
if @equal(@index(Combo1),0)
goto EVLOOP
end
shell open, @item(1,@index(Combo1))
goto EVLOOP
|
now under combo1click i want it to check to see if test.exe is in the path if so then run the shell open if not do whatever...the %%button1 and %path1 are in a ini file which the program reads from... i hope i explain this better.. _________________ Have a nice day  |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Mon Feb 14, 2005 11:33 pm Post subject: |
|
|
so the var info would be something like this:
%%button1 = My program
%%path1 = c:\whatever\whatever\test.exe _________________ Have a nice day  |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Feb 15, 2005 12:19 am Post subject: |
|
|
ahhhhh i think i'am on something now
@name()
ok let me play with this
thanks all _________________ Have a nice day  |
|
| 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
|
|