|
xekon Apprentice
Joined: 11 Oct 2007 Posts: 154
|
Posted: Thu Oct 25, 2007 9:44 pm
Please help me with a simple prompt macro, i cant figure out what is wrong |
I have an ifind alias which connects to an equipment database and then returns matches.
The ifind alias is for Aardwolf mud and is available here: http://www.conradshome.com/iwuvzmud/
If I enter the following into the commandline it works perfectly fine and returns all matches that have the string Endless within the item name
ifind name LIKE "%Endless%"
Here is what I was trying to do: (this one appears to set the variable correctly but the variable does not return the "" marks it simply uses them to dictate that the contents are a string)
#prompt iditem {what would you like to ID?}
iditem=~"%@iditem%"
ifind name LIKE @iditem
I also tried:
#prompt iditem {what would you like to ID?}
ifind name LIKE ~"%@iditem%" |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Oct 25, 2007 10:28 pm |
Change this line in the ifind alias
Code: |
#VARIABLE rs @conn.Execute("SELECT * FROM iwuvaard.equipment WHERE %-1 ORDER BY equip_id ASC") |
to this
Code: |
#IF (%numparam=0) {
#VARIABLE rs @conn.Execute(%concat("SELECT * FROM iwuvaard.equipment WHERE name LIKE '",@iditem,"' ORDER BY equip_id ASC"))
} {
#VARIABLE rs @conn.Execute("SELECT * FROM iwuvaard.equipment WHERE %-1 ORDER BY equip_id ASC")
} |
Change you macro to this
Code: |
#PROMPT iditem {What item name do you wish to search}
ifind |
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|