[1.3b56 FeatReq] getState() return empty if state undefined

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
User avatar
biodude
Dragon
Posts: 444
Joined: Sun Jun 15, 2008 2:40 pm
Location: Montréal, QC

[1.3b56 FeatReq] getState() return empty if state undefined

Post by biodude »

Would it be possible for Wiki: getState() to return an empty string ("") if the state name passed as an argument is not defined in the campaign?
I was just trying out different coding approaches and getState() currently just spits out errors if the state is undefined, unlike getProperty(), which returns an empty string if the property is not defined on the macro (thus avoiding endless value prompts and making it easier to catch such errors).
Currently, there is no difference between getting a token's state using:
state.name
or
getState( "name" )

They both throw errors and interrupt macro execution if the state "name" is not defined in the campaign. :(
"The trouble with communicating is believing you have achieved it"
[ d20 StatBlock Importer ] [ Batch Edit Macros ] [ Canned Speech UI ] [ Lib: Math ]

Post Reply

Return to “MapTool”