trying to right a IF ELSE statement
all i find stats it should read
IF(condition, true action, false action)
this does not work at all even if i leave the false off
i am able to get it to work with an just a true with an alternate syntax i found
IF(condition):true action
but can not have a false this way
any help would be appreciated.
1.7 syintax change?
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: 1.7 syintax change?
It would help if you provide your code you have for context. The usually way to do an [if:] statement is this
The code block is usually for multiple statements. You can leave of the false statement in the first example, but in the second example you should put an empty code block like };{}] at the end.
Code: Select all
[H, if(condition): "true"; "false"]
<!-- or -->
[H, if(condition), code: {
[H: "true"]
};{
[H: "false"]
}]
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: 1.7 syintax change?
i think you're referring to the Wiki: if() (function) while AM here gives an example of the [if:] (option). And indeed the 'function' version requires both true and false to work, the option does not although as AM says in case of code blocks do declare the false option but leave it empty
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS