Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

ScirptCards Black Check for &Variable

1697803740
Essen
Pro
Marketplace Creator
Is there a way to do a conditional for string variables that are set as blank? Is it technically blank if I hit enter and move on after the pipe, or is there another state that it would be in? --?"[&name]" -eq ""| comes back as false, so I was curious.
So a workaround for checking if a string variable is empty is to use something like: --?"X[&name]" -eq "X" It's what I use and also I think I've seen Kurt J's examples also use something similar.
1697891587
Essen
Pro
Marketplace Creator
Excellent, thank you!  That worked.
1697942616
Essen
Pro
Marketplace Creator
This blank check doesn't seem to work with the false step. --?"X[&ShipDesc]" -eq "X"||[--+ | [br] --+Pirate Ship|[&ShipDesc]--]| That there comes up blank, it doesn't run the false printing when ShipDesc has
Code block if/else has a different synation than what you are using. That above would look something like this: --?"X[&ShipDesc]" -eq "X"|[ --+ | [br] --]|[ --+Pirate Ship|[&ShipDesc] --]| The `--]|[` is the else syntax for a code block.