"local" Snippets


Referencing Variables without "g." or "l."

It is best to always specify a variable scope ("g." or "l."), but it's good to know how Miva will behave too. If you reference a variable without "g." or "l.", then Miva will look for a corresponding "l." variable. If the "l." variable doesn't exist, then it will look for the corresponding "g." variable. The order of the global or local variable Assignments does not matter.
Created: 1490132261
View "Referencing Variables without "g." or "l.""
<h1>Referencing Variables without "g." or "l."</h1> <h2>Summary</h2> <p><em>It is best to always specify a variable scope ("g." or "l."), but it's good to know how Miva will behave...</em></p> <p>If you reference a variable without "g." or "l.", then Miva will look for a corresponding "l." variable.<br>If the "l." variable doesn't exist, then it will look for the corresponding "g." variable.</p> <p>The order of the global or local variable Assignments does not matter.</p> <h2>Examples</h2> <h3>When Global Assignment Then Local Assignment</h3> <mvt:assign name="g.test_1" value="'global'" /> <mvt:assign name="l.test_1" value="'local'" /> Miva will use: <b><mvt:eval expr="test_1" /></b> <h3>Local Assignment then Global Assignment</h3> <mvt:assign name="g.test_2" value="'global'" /> <mvt:assign name="l.test_2" value="'local'" /> Miva will use: <b><mvt:eval expr="test_2" /></b> <h3>Just Global Assignment</h3> <mvt:assign name="g.test_3" value="'global'" /> Miva will use: <b><mvt:eval expr="test_3" /></b> <h3>Just Local Assignment</h3> <mvt:assign name="l.test_4" value="'local'" /> Miva will use: <b><mvt:eval expr="test_4" /></b> <h3>Just l.settings Assignment</h3> <mvt:assign name="l.settings:test_5" value="'l.settings'" /> Miva will use: <b><mvt:eval expr="test_5" /></b>
 

Referencing Variables without "g." or "l."

It is best to always specify a variable scope ("g." or "l."), but it's good to know how Miva will behave too. If you reference a variable without "g." or "l.", then Miva will look for a corresponding "l." variable. If the "l." variable doesn't exist, then it will look for the corresponding "g." variable. The order of the global or local variable Assignments does not matter.
Created: 1490132201
View "Referencing Variables without "g." or "l.""
<h1>Referencing Variables without "g." or "l."</h1> <h2>Summary</h2> <p><em>It is best to always specify a variable scope ("g." or "l."), but it's good to know how Miva will behave too.</em></p> <p>If you reference a variable without "g." or "l.", then Miva will look for a corresponding "l." variable.<br>If the "l." variable doesn't exist, then it will look for the corresponding "g." variable.</p> <p>The order of the global or local variable Assignments does not matter.</p> <h2>Examples</h2> <h3>When Global Assignment Then Local Assignment</h3> <mvt:assign name="g.test_1" value="'global'" /> <mvt:assign name="l.test_1" value="'local'" /> Miva will use: <b><mvt:eval expr="test_1" /></b> <h3>Local Assignment then Global Assignment</h3> <mvt:assign name="g.test_2" value="'global'" /> <mvt:assign name="l.test_2" value="'local'" /> Miva will use: <b><mvt:eval expr="test_2" /></b> <h3>Just Global Assignment</h3> <mvt:assign name="g.test_3" value="'global'" /> Miva will use: <b><mvt:eval expr="test_3" /></b> <h3>Just Local Assignment</h3> <mvt:assign name="l.test_4" value="'local'" /> Miva will use: <b><mvt:eval expr="test_4" /></b> <h3>Just l.settings Assignment</h3> <mvt:assign name="l.settings:test_5" value="'l.settings'" /> Miva will use: <b><mvt:eval expr="test_5" /></b>