mapquery
Syntax: %mapquery(SQLstring)
Executes the SQL query string (WHERE clause) and returns a string list of room ID numbers for the matching rooms. Spaces in the argument may be stripped if they aren't quoted.
Example:
#SHOW %mapquery("[Name] LIKE '%road%'") displays a string list like 3|45|56|67 with the Room ID of each room that has "road" somewhere in the room name. The % character is the SQL wildcard character for Access databases.
#VAR Path %mapquery("[Name] LIKE '%road%'")
#FORALL @Path {#SHOW %roomname(%i)} Loop through the matching records and display the name of each room in the result.
#SHOW %mapquery("Zoneid='7' AND Name='The West Road'") The spaces around the AND keyword would be stripped if this string wasn't quoted. Use the
%concat function to create more complex strings:
#SHOW %mapquery(%concat("Zoneid=",%zonenum," AND Name='The West Road'"))