In the following code, g.onhand could be blank or a number. I'm running this on the latest Miva version.
g.OnHand: (&mvte:global:onhand;) <br />
<mvt:assign name="g.isnumber" value="isdigit(g.onhand)" />
g.IsNumber: (&mvte:global:isnumber;)
<mvt:if expr="g.onhand EQ NULL">
...
<mvt:else>
...
</mvt:if>
If g.onhand is blank, g.isnumber is 1, and my if statement evaluates as true.
If g.onhand is 0, g.isnumber is 1, and my if statement evaluates as true.
If g.onhand is greater than 0, g.isnumber is 1, and my if statement evaluates as false.
Is 0 considered NULL? I thought blank is NULL and 0 is something real. I've even tested this with <mvt:if expr="g.onhand EQ ''"> in place of NULL.
Also, what's going on with the isdigit() function returning 1 if the variable is blank?
g.OnHand: (&mvte:global:onhand;) <br />
<mvt:assign name="g.isnumber" value="isdigit(g.onhand)" />
g.IsNumber: (&mvte:global:isnumber;)
<mvt:if expr="g.onhand EQ NULL">
...
<mvt:else>
...
</mvt:if>
If g.onhand is blank, g.isnumber is 1, and my if statement evaluates as true.
If g.onhand is 0, g.isnumber is 1, and my if statement evaluates as true.
If g.onhand is greater than 0, g.isnumber is 1, and my if statement evaluates as false.
Is 0 considered NULL? I thought blank is NULL and 0 is something real. I've even tested this with <mvt:if expr="g.onhand EQ ''"> in place of NULL.
Also, what's going on with the isdigit() function returning 1 if the variable is blank?
Comment