About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 Register to post in forums, or Log in to your existing account
 

 Related 
Contents
AutoMapper
  #CONFIGURE
  #DESCRIBE
  #DOOR
  #FIND
  #LOCATION
  #LOOK
  #MAKEROOM
  #MAPQUERY
  #MERGE
  #MOVE
  #NODIR
  #NOMAP
  #OK
  #PORTAL
  #QUEUE
  #RECALL
  #TAG
  #TELEPORT
  #TRACK
  #UNPORTAL
  #WITHLOC
  %destroom
  %inwalk
  %lastdir
  %look
  %maplocked
  %mapquery
  %parsemode
  %portal
  %portalenabled
  %roommode
  %walkactive
  %walkconfirm
  %walkmode
  %walkroom
  Automapper
Function Reference
  %abs
  %additem
  %addkey
  %alarm
  %alias
  %ansi
  %array
  %arrget
  %arrhigh
  %arrset
  %ascii
  %average
  %begins
  %bitand
  %bitnot
  %bitor
  %bitset
  %bitshift
  %bittest
  %bitxor
  %btncol
  %btnenable
  %btnimage
  %case
  %char
  %charcomment
  %charnotes
  %class
  %clip
  %color
  %colorname
  %colorsyntax
  %comactive
  %comcreate
  %comget
  %comset
  %concat
  %copy
  %count
  %countlist
  %crtonl
  %db
  %dbget
  %dbitems
  %dbkey
  %dbkeys
  %dblist
  %dbmax
  %dbmin
  %dbvalues
  %dde
  %ddeclose
  %ddemacro
  %ddeopen
  %ddepoke
  %defined
  %delete
  %delitem
  %delkey
  %delnitem
  %destroom
  %dice
  %diceavg
  %dicedev
  %dicemax
  %dicemin
  %doorname
  %dups
  %ends
  %eval
  %exec
  %exp
  %expand
  %expanddb
  %expandlist
  %filesize
  %find
  %float
  %format
  %getglobal
  %grep
  %gsl
  %handle
  %hexcolor
  %hexnum
  %hexstr
  %htmldecode
  %htmlencode
  %iconstate
  %if
  %insert
  %int
  %inwalk
  %isfloat
  %iskey
  %ismember
  %isnumber
  %isvalue
  %item
  %json
  %lastdir
  %left
  %leftback
  %len
  %line
  %list
  %literal
  %look
  %lower
  %mapfilter
  %maplocked
  %mapquery
  %mapvnum
  %match
  %max
  %mcp
  %min
  %mod
  %mss
  %nextdir
  %nltocr
  %norm
  %null
  %number
  %numbuttons
  %numitems
  %numkeys
  %numparam
  %numrec
  %numrooms
  %numwords
  %numzones
  %packages
  %param
  %params
  %parsemode
  %parsenumbers
  %pat
  %pathcompress
  %pathexpand
  %pathfrom
  %pathreverse
  %pick
  %pop
  %portal
  %portalenabled
  %pos
  %pref
  %priority
  %prompt
  %proper
  %push
  %query
  %quote
  %random
  %read
  %ref
  %regex
  %remove
  %repeat
  %replace
  %replaceitem
  %reversedir
  %rgb
  %right
  %rightback
  %roomcol
  %roomcom
  %roomcontents
  %roomcost
  %roomdesc
  %roomexit
  %roomflags
  %roomid
  %roomint
  %roomkey
  %roomkind
  %roomlink
  %roomload
  %roommode
  %roomname
  %roomnote
  %roomnum
  %roomportal
  %roomvnum
  %roomzone
  %round
  %section
  %setglobal
  %sort
  %sql
  %sqldb
  %sqrt
  %state
  %stdev
  %string
  %stripansi
  %stripq
  %subchar
  %subregex
  %sum
  %switch
  %threadid
  %threadname
  %time
  %trigger
  %trim
  %trimleft
  %trimright
  %upper
  %url
  %vartype
  %viewrec
  %walk
  %walkactive
  %walkconfirm
  %walkmode
  %walkroom
  %window
  %word
  %write
  %yesno
  %zonename
  %zonenum
  %zonevnum
Related Links:
  Room Numbers
  %mapvnum
  %numrooms
  %roomvnum
  Automapper
%mapfilter [[cmud_%mapfilter]] 
mapfilter

Syntax: %mapfilter(SQLstring)

Sets or returns the current filter used for manipulating rooms via scripting commands. Normally, all rooms in the entire map are available for scripting. So, %numrooms() will return the total number of rooms on the map. By using %mapfilter, you can limit the rooms that are used in the scripting. Filter is an ADO database filter expression. This is like a normal arithmetic expression and is used to test various database table fields. For example, Name is the room name, Desc is the room description, ZoneID is the zone number, etc.

You cannot mix "and" and "or" statements in a single filter. To clear the current filter and return to using all rooms in scripts, use a null string for the filter.

Example:

#CALL %mapfilter(%concat("ZoneID = ",%zonenum()))
#LOOP %numrooms {#SHOW %roomname(%mapvnum(%i))}
#CALL %mapfilter("")


The firstline sets the filter. Any database field can be filtered, and simple AND and OR combinations can be added (although AND and OR cannot be mixed in the same filter). Here, the current zone is fetched via the %zonenum function and appended to the "Zone ID = " string. Now, the second statement only performs the loop with the rooms that match the filter. The last line clears the filter so that all rooms are accessible again.

#ECHO %mapfilter
Displays the currently set filter string.
Viewer Comments [0 - Post your comments]

Jump to:  

© 2009 Zugg Software. Hosted by Wolfpaw.net