"OR" Snippets


Basket #151788

Created: 1531948698
View "Basket #151788"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #151786

Created: 1531948678
View "Basket #151786"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'nanas'" /> <mvt:assign name="l.settings:list[4]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #151784

Created: 1531948519
View "Basket #151784"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'nanas'" /> <mvt:assign name="l.settings:list[4]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', 3)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #151782

Created: 1531948508
View "Basket #151782"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'nanas'" /> <mvt:assign name="l.settings:list[4]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -3)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #151780

Created: 1531948498
View "Basket #151780"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'nanas'" /> <mvt:assign name="l.settings:list[4]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -2)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #151778

Created: 1531948470
View "Basket #151778"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'nanas'" /> <mvt:assign name="l.settings:list[4]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', 0)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #151776

Created: 1531948452
View "Basket #151776"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'nanas'" /> <mvt:assign name="l.settings:list[4]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', 1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #151774

Created: 1531948439
View "Basket #151774"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'nanas'" /> <mvt:assign name="l.settings:list[4]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -2)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #151772

Created: 1531948407
View "Basket #151772"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'nanas'" /> <mvt:assign name="l.settings:list[4]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #149972

Created: 1531331374
View "Basket #149972"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 
View "Basket #149835"
<h1>miva_array_delete() within mvt:foreach</h1> <mvt:assign name="l.settings:example:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[3]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[4]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[5]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[6]" value="'Cereal'" /> <h4>Before:</h4> <mvt:foreach iterator="item" array="example:list"> <mvt:if expr="l.settings:item EQ 'Milk'"> <mvt:assign name="l.result" value="miva_array_delete( l.settings:example:list, l.POS1, 1 )" /> </mvt:if> </mvt:foreach> <h4>After:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 
View "Basket #149833"
<h1>miva_array_delete() within mvt:foreach</h1> <mvt:assign name="l.settings:example:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[3]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[4]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[5]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[6]" value="'Cereal'" /> <h4>Before:</h4> <mvt:eval expr="glosub(miva_array_serialize(l.settings:example), ',', '<br>')" /> <mvt:foreach iterator="item" array="example:list"> <mvt:if expr="l.settings:item EQ 'Milk'"> <mvt:assign name="l.result" value="miva_array_delete( l.settings:example:list, l.POS1, 1 )" /> </mvt:if> </mvt:foreach> <h4>After:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 
View "Basket #149831"
<h1>miva_array_delete() within mvt:foreach</h1> <mvt:assign name="l.settings:example:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[3]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[4]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[5]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[6]" value="'Cereal'" /> <h4>Before:</h4> <mvt:eval expr="miva_array_serialize(l.settings:example)" /> <mvt:foreach iterator="item" array="example:list"> <mvt:if expr="l.settings:item EQ 'Milk'"> <mvt:assign name="l.result" value="miva_array_delete( l.settings:example:list, l.POS1, 1 )" /> </mvt:if> </mvt:foreach> <h4>After:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 
View "Basket #149829"
<h1>miva_array_delete() within mvt:foreach</h1> <mvt:assign name="l.settings:example:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[3]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[4]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[5]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[6]" value="'Cereal'" /> <h4>Before:</h4> <mvt:eval expr="decodeattribute(miva_array_serialize(l.settings:example))" /> <mvt:foreach iterator="item" array="example:list"> <mvt:if expr="l.settings:item EQ 'Milk'"> <mvt:assign name="l.result" value="miva_array_delete( l.settings:example:list, l.POS1, 1 )" /> </mvt:if> </mvt:foreach> <h4>After:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 
View "Basket #149801"
<h1>miva_array_delete() within mvt:foreach</h1> <mvt:assign name="l.settings:example:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[3]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[4]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[5]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[6]" value="'Cereal'" /> <h4>Before:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" /> <mvt:foreach iterator="item" array="example:list"> <mvt:if expr="l.settings:item EQ 'Milk'"> <mvt:assign name="l.result" value="miva_array_delete( l.settings:example:list, l.POS1, 1 )" /> </mvt:if> </mvt:foreach> <h4>After:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 
View "Basket #149799"
<h1>miva_array_delete() within mvt:foreach</h1> <mvt:assign name="l.settings:example:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[3]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[4]" value="'Cereal'" /> <h4>Before:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" /> <mvt:foreach iterator="item" array="example:list"> <mvt:if expr="l.settings:item EQ 'Milk'"> <mvt:assign name="l.result" value="miva_array_delete( l.settings:example:list, l.POS1, 1 )" /> </mvt:if> </mvt:foreach> <h4>After:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 

Basket #136641

Created: 1528214078
View "Basket #136641"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', 1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107036

Created: 1522948161
View "Basket #107036"
<mvt:assign name="l.settings:list[1]" value="'2a'" /> <mvt:assign name="l.settings:list[2]" value="'2b'" /> <mvt:assign name="l.settings:list[3]" value="'2c'" /> <mvt:assign name="l.settings:list[4]" value="'1c'" /> <mvt:assign name="l.settings:list[5]" value="'1b'" /> <mvt:assign name="l.settings:list[6]" value="'1a'" /> <mvt:assign name="l.settings:list[7]" value="'3c'" /> <mvt:assign name="l.settings:list[8]" value="'3b'" /> <mvt:assign name="l.settings:list[9]" value="'3a'" /> <mvt:assign name="l.settings:list[10]" value="'3b'" /> <mvt:assign name="l.settings:list[11]" value="'3a'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107033

Created: 1522948065
View "Basket #107033"
<mvt:assign name="l.settings:list[1]" value="'1a'" /> <mvt:assign name="l.settings:list[2]" value="'1b'" /> <mvt:assign name="l.settings:list[3]" value="'1c'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107031

Created: 1522948044
View "Basket #107031"
<mvt:assign name="l.settings:list[1]" value="'10'" /> <mvt:assign name="l.settings:list[2]" value="'20'" /> <mvt:assign name="l.settings:list[3]" value="'30'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107029

Created: 1522948028
View "Basket #107029"
<mvt:assign name="l.settings:list[1]" value="'1'" /> <mvt:assign name="l.settings:list[2]" value="'2'" /> <mvt:assign name="l.settings:list[3]" value="'3'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107027

Created: 1522948020
View "Basket #107027"
<mvt:assign name="l.settings:list[1]" value="'1' /> <mvt:assign name="l.settings:list[2]" value="'2'" /> <mvt:assign name="l.settings:list[3]" value="'3'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107025

Created: 1522948013
View "Basket #107025"
<mvt:assign name="l.settings:list[1]" value="'1' /> <mvt:assign name="l.settings:list[2]" value="'2'" /> <mvt:assign name="l.settings:list[3]" value="'3'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107023

Created: 1522947997
View "Basket #107023"
<mvt:assign name="l.settings:list[1]" value="'a'" /> <mvt:assign name="l.settings:list[2]" value="'b'" /> <mvt:assign name="l.settings:list[3]" value="'c'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107020

Created: 1522947941
View "Basket #107020"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107018

Created: 1522947751
View "Basket #107018"
<mvt:assign name="l.settings:list[1]" value="'capples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'acarrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107016

Created: 1522947734
View "Basket #107016"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107014

Created: 1522947702
View "Basket #107014"
<mvt:assign name="l.settings:list[1]" value="'3apples'" /> <mvt:assign name="l.settings:list[2]" value="'2bananas'" /> <mvt:assign name="l.settings:list[3]" value="'1carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107012

Created: 1522947673
View "Basket #107012"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #107010

Created: 1522947668
View "Basket #107010"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #106842

Created: 1522858179
View "Basket #106842"
<mvt:assign name="l.settings:list[1]" value="1" /> <mvt:assign name="l.settings:list[2]" value="2" /> <mvt:assign name="l.settings:list[3]" value="3" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

US and CA Phone formatting

 phone  format  mvdo
Add dashes to US phone numbers
Created: 1520626854
View "US and CA Phone formatting"
<mvt:assign name="l.settings:order:ship_phone" value="'6197798349'" /> <mvt:do file="g.Module_Library_Utilities" name="l.settings:clean:ship_phone" value="AlphaNumericOnly( l.settings:order:ship_phone )" /> <mvt:if expr="len_var( l.settings:clean:ship_phone ) EQ 10"> <mvt:assign name="l.settings:clean:ship_phone" value="substring_var( l.settings:clean:ship_phone, 1, 3 ) $ '-' $ substring_var( l.settings:clean:ship_phone, 4, 3 ) $ '-' $ substring_var( l.settings:clean:ship_phone, 7, 4 )" /> <mvt:else> <mvt:assign name="l.settings:clean:ship_phone" value="substring_var( l.settings:clean:ship_phone, 1, 1 ) $ '-' $ substring_var( l.settings:clean:ship_phone, 2, 3 ) $ '-' $ substring_var( l.settings:clean:ship_phone, 5, 3 ) $ '-' $ substring_var( l.settings:clean:ship_phone, 8, 4 )" /> </mvt:if> <mvt:eval expr="l.settings:order:ship_phone" /> <hr> <mvt:eval expr="l.settings:clean:ship_phone" />
 

Basket #68419

Created: 1510073364
View "Basket #68419"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #57209

Simply changes any order_Status that is "Pending" to "In Progress"
Created: 1504214967
View "Basket #57209"
<mvt:assign name="l.settings:scrubme" value="'I am a really long and boring sentance.'"/> <mvt:assign name="g.return_value" value="substring( l.settings:scrubme, 0, 10 )" /> &mvt:global:return_value;
 

Basket #51757

Created: 1502233163
View "Basket #51757"
<mvt:assign name="l.settings:list[1]:name" value="'1apples'" /> <mvt:assign name="l.settings:list[1]:val" value="'v1'" /> <mvt:assign name="l.settings:list[2]:name" value="'2bananas'" /> <mvt:assign name="l.settings:list[2]:val" value="'v2'" /> <mvt:assign name="l.settings:list[3]:name" value="'3carrots'" /> <mvt:assign name="l.settings:list[3]:val" value="'v3'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item:name; + &mvt:item:val;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, ':name', 1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item:name;<br> </mvt:foreach>
 

Basket #52340

Created: 1501171214
View "Basket #52340"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', 1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #52331

Created: 1501002842
View "Basket #52331"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', 0)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Updating order array order_status from Pending to In Progress

Simply changes any order_Status that is "Pending" to "In Progress"
Created: 1498090111
View "Updating order array order_status from Pending to In Progress"
<mvt:comment> | | By http://www.scotsscripts.com | </mvt:comment> <mvt:assign name="l.settings:order[1]:id" value="'1'" /> <mvt:assign name="l.settings:order[1]:order_status" value="'In Progress'" /> <mvt:assign name="l.settings:order[2]:id" value="'2'" /> <mvt:assign name="l.settings:order[2]:order_status" value="'In Progress'" /> <mvt:assign name="l.settings:order[3]:id" value="'3'" /> <mvt:assign name="l.settings:order[3]:order_status" value="'Pending'" /> <mvt:assign name="l.settings:order[4]:id" value="'4'" /> <mvt:assign name="l.settings:order[4]:order_status" value="'In Progress'" /> <p><b>Original:</b></p> <mvt:foreach iterator="item" array="order"> id: &mvt:item:id; status: &mvt:item:order_status;<br> </mvt:foreach> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:order)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:order[l.counter]" /> <mvt:if expr="tolower(l.struct:order_status) EQ 'pending'"> <mvt:assign name="l.struct:order_status" value="'In Progress'" /> </mvt:if> <mvt:assign name="l.success" value="miva_array_insert( l.settings:temp_array, l.struct, -1 )" /> </mvt:while> <mvt:assign name="l.settings:order" value="l.settings:temp_array" /> <p><b>Updated:</b></p> <mvt:foreach iterator="item" array="order"> id: &mvt:item:id; status: &mvt:item:order_status;<br> </mvt:foreach>
 
View "miva_array_delete() within mvt:foreach"
<h1>miva_array_delete() within mvt:foreach</h1> <mvt:assign name="l.settings:example:list[1]" value="'Bananas'" /> <mvt:assign name="l.settings:example:list[2]" value="'Milk'" /> <mvt:assign name="l.settings:example:list[3]" value="'Bread'" /> <mvt:assign name="l.settings:example:list[4]" value="'Cereal'" /> <h4>Before:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" /> <mvt:foreach iterator="item" array="example:list"> <mvt:if expr="l.settings:item EQ 'Milk'"> <mvt:assign name="l.result" value="miva_array_delete( l.settings:example:list, l.POS1, 1 )" /> </mvt:if> </mvt:foreach> <h4>After:</h4> <mvt:eval expr="decodeattribute(glosub(miva_array_serialize(l.settings:example), ',', '<br>'))" />
 

Basket #47914

Created: 1497900663
View "Basket #47914"
<div class="column whole cart-contents"> <div class="row all-hidden medium-all-shown basket-header-row"> <div class="column one-eighth">Order #</div> <div class="column one-eighth">Order Date</div> <div class="column one-eighth align-right">Order Total</div> <div class="column one-fourth">Order Status</div> <div class="column three-eighths">Shipments</div> </div> <mvt:foreach iterator="order" array="orders"> <mvt:assign name="l.settings:list[1]" value="'Order #'" /> <mvt:assign name="l.settings:list[2]" value="'Order Date'" /> <mvt:assign name="l.settings:list[3]" value="'Shipment'" /> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <div class="row basket-product-row"> <div class="column half medium-one-eighth"><strong class="medium-all-hidden">Order # </strong>&mvt:order:id;</div> <div class="column half medium-one-eighth"><strong class="medium-all-hidden">Date: </strong>&mvt:order:date_formatted;-1</div> <div class="column half medium-one-eighth medium-align-right"><strong class="medium-all-hidden">Total: </strong>&mvt:order:formatted_total;</div> <div class="column half medium-one-fourth"><strong class="medium-all-hidden">Status: </strong>&mvt:order:order_status;</div> <div class="column three-fourths medium-one-fourth"> <strong class="medium-all-hidden">Shipments: </strong> <mvt:foreach iterator="shipment" array="order:shipments"> &mvt:shipment:tracklink;<br /> </mvt:foreach> </div> <div class="column one-fourth medium-one-eighth align-center"><a href="&mvt:global:secure_sessionurl;Screen=ORDS&amp;Store_Code=&mvta:global:Store_Code;&amp;SortBy=&mvta:global:SortBy;&amp;Offset=&mvta:global:Offset;&amp;Order_ID=&mvt:order:id;&amp;Order_BillEmail=&mvte:global:Order_BillEmail;&amp;Order_BillZip=&mvte:global:Order_BillZip;" class="button button-mini bg-gray charcoal uppercase">View</a></div> </div> </mvt:foreach> </div> <mvt:if expr="(g.Offset OR g.NextOffset) AND (l.settings:orderhistory_list:per_page NE 0)"> <mvt:if expr="g.Offset EQ 0"> <div class="column half">&nbsp;</div> <mvt:else> <form method="post" action="&mvt:global:secure_sessionurl;" class="column half"> <input type="hidden" name="Screen" value="&mvte:global:Screen;" /> <input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;" /> <input type="hidden" name="SortBy" value="&mvte:global:SortBy;" /> <input type="hidden" name="Order_BillEmail" value="&mvte:global:Order_BillEmail;" /> <input type="hidden" name="Order_BillZip" value="&mvte:global:Order_BillZip;" /> <input type="hidden" name="Offset" value="&mvte:global:PrevOffset;" /> <mvt:item name="buttons" param="Previous" /> </form> </mvt:if> <mvt:if expr="g.NextOffset EQ 0"> <div class="column half">&nbsp;</div> <mvt:else> <form method="post" action="&mvt:global:secure_sessionurl;" class="column half align-right"> <input type="hidden" name="Screen" value="&mvte:global:Screen;" /> <input type="hidden" name="Store_Code" value="&mvte:global:Store_Code;" /> <input type="hidden" name="SortBy" value="&mvte:global:SortBy;" /> <input type="hidden" name="Order_BillEmail" value="&mvte:global:Order_BillEmail;" /> <input type="hidden" name="Order_BillZip" value="&mvte:global:Order_BillZip;" /> <input type="hidden" name="Offset" value="&mvte:global:NextOffset;" /> <mvt:item name="buttons" param="Next" /> </form> </mvt:if> </mvt:if>
 
View "Basket #47367"
<mvt:assign name="g.cc_num_dirty" value="'44a44-5555/3333A1111-adasdsadasdas!'" /> <mvt:while expr="l.character_counter LT len(g.cc_num_dirty)"> <mvt:assign name="l.character_counter" value="l.character_counter + 1" /> <mvt:assign name="l.character" value="substring_var( g.cc_num_dirty, l.character_counter, 1 )"/> <mvt:if expr="isdigit(l.character)"> <mvt:if expr="l.digit_counter GT 0 AND l.digit_counter MOD 4 EQ 0"> <mvt:assign name="g.cc_num_clean" value="g.cc_num_clean $ '-'" /> </mvt:if> <mvt:assign name="g.cc_num_clean" value="g.cc_num_clean $ l.character" /> <mvt:assign name="l.digit_counter" value="l.digit_counter + 1" /> </mvt:if> </mvt:while> abc &mvte:global:cc_num_clean;
 
View "Miva Template Language New Array and Sort Example"
<mvt:comment> | | By http://www.scotsscripts.com | </mvt:comment> <mvt:assign name="l.settings:list[1]:name" value="'apples'" /> <mvt:assign name="l.settings:list[1]:kind" value="'mac'" /> <mvt:assign name="l.settings:list[1]:color" value="'a'" /> <mvt:assign name="l.settings:list[2]:name" value="'bananas'" /> <mvt:assign name="l.settings:list[2]:kind" value="'South American'" /> <mvt:assign name="l.settings:list[2]:color" value="'C'" /> <mvt:assign name="l.settings:list[3]:name" value="'orange'" /> <mvt:assign name="l.settings:list[3]:kind" value="'Florida'" /> <mvt:assign name="l.settings:list[3]:color" value="'b'" /> <mvt:assign name="l.settings:list[4]:name" value="'orange'" /> <mvt:assign name="l.settings:list[4]:kind" value="'Michigan'" /> <mvt:assign name="l.settings:list[4]:color" value="'d'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> <hr/> </mvt:foreach> <mvt:comment> | | while loop to create new array and add colorsort field | </mvt:comment> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:list)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:list[l.counter]" /> <mvt:assign name="l.struct:colorsort" value="toupper(l.struct:color)" /> <mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" /> </mvt:while> <mvt:comment> | |copy new array to original, sort, and display new list | </mvt:comment> <mvt:assign name="l.settings:list" value="l.settings:newlist" /> <mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:list,':colorsort', 1)" /> <h2>After Sort</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> colorSort: &mvt:item:colorSort; <hr/> </mvt:foreach>
 

Miva Template Language New Array and Sort Example

Use Miva Template language to sort an existing array by inserting sort keys into the array structure. This is done by creating a new temporary structure with the sort key (colorsort), and then add it to a new array using miva_array_insert(..). When the loop is done, the new temporary array is then copied back into the original array. In miva_array_insert(...) we use -1 for the array index to force it to add the structure to the next array element. Since we are creating a new array, it will be populated from index 1 to the end. We do it this way because there is no other way to add to array structures in the miva template language. Using brackets when trying to add to existing array structures does not work in the miva template language. http://www.scotsscripts.com
Created: 1496961839
View "Miva Template Language New Array and Sort Example"
<mvt:comment>Example by http://www.scotsscripts.com</mvt:comment> <mvt:assign name="l.settings:list[1]:name" value="'apples'" /> <mvt:assign name="l.settings:list[1]:kind" value="'mac'" /> <mvt:assign name="l.settings:list[1]:color" value="'a'" /> <mvt:assign name="l.settings:list[2]:name" value="'bananas'" /> <mvt:assign name="l.settings:list[2]:kind" value="'South American'" /> <mvt:assign name="l.settings:list[2]:color" value="'C'" /> <mvt:assign name="l.settings:list[3]:name" value="'orange'" /> <mvt:assign name="l.settings:list[3]:kind" value="'Florida'" /> <mvt:assign name="l.settings:list[3]:color" value="'b'" /> <mvt:assign name="l.settings:list[4]:name" value="'orange'" /> <mvt:assign name="l.settings:list[4]:kind" value="'Michigan'" /> <mvt:assign name="l.settings:list[4]:color" value="'d'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> <hr/> </mvt:foreach> <mvt:comment>While loop To Create New Array</mvt:comment> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:list)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:list[l.counter]" /> <mvt:assign name="l.struct:colorsort" value="toupper(l.struct:color)" /> <mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" /> </mvt:while> <mvt:comment>copy new array to original array</mvt:comment> <mvt:assign name="l.settings:list" value="l.settings:newlist" /> <mvt:comment>sort original array</mvt:comment> <mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:list,':colorsort', 1)" /> <h2>After Sort</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> colorSort: &mvt:item:colorSort; <hr/> </mvt:foreach>
 

Miva Template Language New Array and Sort Example

Use Miva Template language to sort an existing array by inserting sort keys into the array structure. This is done by creating a new temporary structure with the sort key (colorsort), and then add it to a new array using miva_array_insert(..). When the loop is done, the new temporary array is then copied back into the original array. In miva_array_insert(...) we use -1 for the array index to force it to add the structure to the next array element. Since we are creating a new array, it will be populated from index 1 to the end. We do it this way because there is no other way to add to array structures in the miva template language. Using brackets when trying to add to existing array structures does not work in the miva template language. http://www.scotsscripts.com
Created: 1496961811
View "Miva Template Language New Array and Sort Example"
TEST<br><br> <mvt:assign name="l.settings:list[1]:name" value="'apples'" /> <mvt:assign name="l.settings:list[1]:kind" value="'mac'" /> <mvt:assign name="l.settings:list[1]:color" value="'a'" /> <mvt:assign name="l.settings:list[2]:name" value="'bananas'" /> <mvt:assign name="l.settings:list[2]:kind" value="'South American'" /> <mvt:assign name="l.settings:list[2]:color" value="'C'" /> <mvt:assign name="l.settings:list[3]:name" value="'orange'" /> <mvt:assign name="l.settings:list[3]:kind" value="'Florida'" /> <mvt:assign name="l.settings:list[3]:color" value="'b'" /> <mvt:assign name="l.settings:list[4]:name" value="'orange'" /> <mvt:assign name="l.settings:list[4]:kind" value="'Michigan'" /> <mvt:assign name="l.settings:list[4]:color" value="'d'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> <hr/> </mvt:foreach> <mvt:comment>While loop To Create New Array</mvt:comment> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:list)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:list[l.counter]" /> <mvt:assign name="l.struct:colorsort" value="toupper(l.struct:color)" /> <mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" /> </mvt:while> <mvt:comment>copy new array to original array</mvt:comment> <mvt:assign name="l.settings:list" value="l.settings:newlist" /> <mvt:comment>sort original array</mvt:comment> <mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:list,':colorsort', 1)" /> <h2>After Sort</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> colorSort: &mvt:item:colorSort; <hr/> </mvt:foreach>
 

Miva Template Language New Array and Sort Example

Use Miva Template language to sort an existing array by inserting sort keys into the array structure. This is done by creating a new temporary structure with the sort key (colorsort), and then add it to a new array using miva_array_insert(..). When the loop is done, the new temporary array is then copied back into the original array. In miva_array_insert(...) we use -1 for the array index to force it to add the structure to the next array element. Since we are creating a new array, it will be populated from index 1 to the end. We do it this way because there is no other way to add to array structures in the miva template language. Using brackets when trying to add to existing array structures does not work in the miva template language. http://www.scotsscripts.com
Created: 1496961745
View "Miva Template Language New Array and Sort Example"
TEST<br><br> <mvt:assign name="l.settings:list[1]:name" value="'apples'" /> <mvt:assign name="l.settings:list[1]:kind" value="'mac'" /> <mvt:assign name="l.settings:list[1]:color" value="'a'" /> <mvt:assign name="l.settings:list[2]:name" value="'bananas'" /> <mvt:assign name="l.settings:list[2]:kind" value="'South American'" /> <mvt:assign name="l.settings:list[2]:color" value="'C'" /> <mvt:assign name="l.settings:list[3]:name" value="'orange'" /> <mvt:assign name="l.settings:list[3]:kind" value="'Florida'" /> <mvt:assign name="l.settings:list[3]:color" value="'b'" /> <mvt:assign name="l.settings:list[4]:name" value="'orange'" /> <mvt:assign name="l.settings:list[4]:kind" value="'Michigan'" /> <mvt:assign name="l.settings:list[4]:color" value="'d'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> <hr/> </mvt:foreach> <h3>While loop To Create New Array</h3> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:list)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:list[l.counter]" /> <mvt:assign name="l.struct:colorsort" value="toupper(l.struct:color)" /> <mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" /> </mvt:while> <mvt:assign name="l.settings:list" value="l.settings:newlist" /> <mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:list,':colorsort', 1)" /> <h2>After Sort</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> colorSort: &mvt:item:colorSort; <hr/> </mvt:foreach>
 
View "Miva Template Language New Array and Sort Example"
TEST<br><br> <mvt:assign name="l.settings:list[1]:name" value="'apples'" /> <mvt:assign name="l.settings:list[1]:kind" value="'mac'" /> <mvt:assign name="l.settings:list[1]:color" value="'a'" /> <mvt:assign name="l.settings:list[2]:name" value="'bananas'" /> <mvt:assign name="l.settings:list[2]:kind" value="'South American'" /> <mvt:assign name="l.settings:list[2]:color" value="'C'" /> <mvt:assign name="l.settings:list[3]:name" value="'orange'" /> <mvt:assign name="l.settings:list[3]:kind" value="'Florida'" /> <mvt:assign name="l.settings:list[3]:color" value="'b'" /> <mvt:assign name="l.settings:list[4]:name" value="'orange'" /> <mvt:assign name="l.settings:list[4]:kind" value="'Michigan'" /> <mvt:assign name="l.settings:list[4]:color" value="'d'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> <hr/> </mvt:foreach> <h3>While loop To Create New Array</h3> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:list)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:list[l.counter]" /> <mvt:assign name="l.struct:colorsort" value="toupper(l.struct:color)" /> <mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" /> </mvt:while> <mvt:assign name="l.settings:list" value="l.settings:newlist" /> <mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:list,':colorsort', 1)" /> <h2>After Sort</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> colorSort: &mvt:item:colorSort; <hr/> </mvt:foreach>
 

Basket #46929

Usage of QuickSortArray
Created: 1496956311
View "Basket #46929"
<mvt:comment> | | By http://www.scotsscripts.com | </mvt:comment> <mvt:assign name="l.settings:order[1]:id" value="'1'" /> <mvt:assign name="l.settings:order[1]:order_status" value="'In Progress'" /> <mvt:assign name="l.settings:order[2]:id" value="'2'" /> <mvt:assign name="l.settings:order[2]:order_status" value="'In Progress'" /> <mvt:assign name="l.settings:order[3]:id" value="'3'" /> <mvt:assign name="l.settings:order[3]:order_status" value="'Pending'" /> <mvt:assign name="l.settings:order[4]:id" value="'4'" /> <mvt:assign name="l.settings:order[4]:order_status" value="'In Progress'" /> <p><b>Original:</b></p> <mvt:foreach iterator="item" array="order"> id: &mvt:item:id; status: &mvt:item:order_status;<br> </mvt:foreach> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:order)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:order[l.counter]" /> <mvt:if expr="tolower(l.struct:order_status) EQ 'pending'"> <mvt:assign name="l.struct:order_status" value="'In Progress'" /> </mvt:if> <mvt:assign name="l.success" value="miva_array_insert( l.settings:temp_array, l.struct, -1 )" /> </mvt:while> <mvt:assign name="l.settings:order" value="l.settings:temp_array" /> <p><b>Updated:</b></p> <mvt:foreach iterator="item" array="order"> id: &mvt:item:id; status: &mvt:item:order_status;<br> </mvt:foreach>
 

Basket #46923

Usage of QuickSortArray
Created: 1496950718
View "Basket #46923"
<mvt:comment> | | By http://www.scotsscripts.com | </mvt:comment> <mvt:assign name="l.settings:list[1]:name" value="'apples'" /> <mvt:assign name="l.settings:list[1]:kind" value="'mac'" /> <mvt:assign name="l.settings:list[1]:color" value="'a'" /> <mvt:assign name="l.settings:list[2]:name" value="'bananas'" /> <mvt:assign name="l.settings:list[2]:kind" value="'South American'" /> <mvt:assign name="l.settings:list[2]:color" value="'C'" /> <mvt:assign name="l.settings:list[3]:name" value="'orange'" /> <mvt:assign name="l.settings:list[3]:kind" value="'Florida'" /> <mvt:assign name="l.settings:list[3]:color" value="'b'" /> <mvt:assign name="l.settings:list[4]:name" value="'orange'" /> <mvt:assign name="l.settings:list[4]:kind" value="'Michigan'" /> <mvt:assign name="l.settings:list[4]:color" value="'d'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> <hr/> </mvt:foreach> <mvt:comment> | | while loop to create new array and add colorsort field | </mvt:comment> <mvt:assign name="l.elements" value="miva_array_elements(l.settings:list)" /> <mvt:while expr="l.counter LT l.elements"> <mvt:assign name="l.counter" value="l.counter + 1" /> <mvt:assign name="l.struct" value="l.settings:list[l.counter]" /> <mvt:assign name="l.struct:colorsort" value="toupper(l.struct:color)" /> <mvt:assign name="l.success" value="miva_array_insert( l.settings:newlist, l.struct, -1 )" /> </mvt:while> <mvt:comment> | |copy new array to original, sort, and display new list | </mvt:comment> <mvt:assign name="l.settings:list" value="l.settings:newlist" /> <mvt:do file="g.module_library_utilities" name="l.success" value="QuickSortArray(l.settings:list,':colorsort', -1)" /> <h2>After Sort</h2> <mvt:foreach iterator="item" array="list"> name: &mvt:item:name;<br> kind: &mvt:item:kind;<br> color: &mvt:item:color;<br> colorSort: &mvt:item:colorSort; <hr/> </mvt:foreach>
 
View "MOD examples"
<h2>MivaScript MOD</h2> <p>MivaScript has a built in Modulus operator: <code>MOD</code></p> <mvt:assign name="l.settings:mod" value="1 MOD 3" /> <code>1 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="2 MOD 3" /> <code>2 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="3 MOD 3" /> <code>3 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="4 MOD 3" /> <code>4 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="5 MOD 3" /> <code>5 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="6 MOD 3" /> <code>6 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="7 MOD 3" /> <code>7 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="8 MOD 3" /> <code>8 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="9 MOD 3" /> <code>9 MOD 3</code> = &mvte:mod;<br/><br/> <mvt:assign name="l.settings:mod" value="1 MOD 4" /> <code>1 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="2 MOD 4" /> <code>2 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="3 MOD 4" /> <code>3 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="4 MOD 4" /> <code>4 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="5 MOD 4" /> <code>5 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="6 MOD 4" /> <code>6 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="7 MOD 4" /> <code>7 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="8 MOD 4" /> <code>8 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="9 MOD 4" /> <code>9 MOD 4</code> = &mvte:mod;<br/><br/>
 
View "MOD examples"
<h2>MivaScript MOD</h2> <p>MivaScript has a built in Modulus opperator: <code>MOD</code></p> <mvt:assign name="l.settings:mod" value="1 MOD 3" /> <code>1 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="2 MOD 3" /> <code>2 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="3 MOD 3" /> <code>3 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="4 MOD 3" /> <code>4 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="5 MOD 3" /> <code>5 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="6 MOD 3" /> <code>6 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="7 MOD 3" /> <code>7 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="8 MOD 3" /> <code>8 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="9 MOD 3" /> <code>9 MOD 3</code> = &mvte:mod;<br/><br/> <mvt:assign name="l.settings:mod" value="1 MOD 4" /> <code>1 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="2 MOD 4" /> <code>2 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="3 MOD 4" /> <code>3 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="4 MOD 4" /> <code>4 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="5 MOD 4" /> <code>5 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="6 MOD 4" /> <code>6 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="7 MOD 4" /> <code>7 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="8 MOD 4" /> <code>8 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="9 MOD 4" /> <code>9 MOD 4</code> = &mvte:mod;<br/><br/>
 
View "MOD examples"
<h2>MivaScript MOD</h2> <p>MivaScript has a built in Modulus opperator: <code>MOD</code></p> <mvt:assign name="l.settings:mod" value="1 MOD 3" /> <code>1 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="2 MOD 3" /> <code>2 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="3 MOD 3" /> <code>3 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="4 MOD 3" /> <code>4 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="5 MOD 3" /> <code>5 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="6 MOD 3" /> <code>6 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="7 MOD 3" /> <code>7 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="8 MOD 3" /> <code>8 MOD 3</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="9 MOD 3" /> <code>9 MOD 3</code> = &mvte:mod;<br/><br/> <mvt:assign name="l.settings:mod" value="1 MOD 4" /> <code>1 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="2 MOD 4" /> <code>2 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="3 MOD 4" /> <code>3 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="4 MOD 4" /> <code>4 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="5 MOD 4" /> <code>5 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="6 MOD 4" /> <code>6 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="7 MOD 4" /> <code>7 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="8 MOD 4" /> <code>8 MOD 4</code> = &mvte:mod;<br/> <mvt:assign name="l.settings:mod" value="9 MOD 4" /> <code>9 MOD 4</code> = &mvte:mod;<br/><br/>
 
View "Basket #45052"
<mvt:if expr="slice CIN the whole pie; slice plus all the other slices"> true <mvt:else> false </mvt:if>
 
View "Basket #40110"
<mvt:assign name="g.string" value="'three,three,three,four,four'" /> <mvt:do file="g.Module_Library_Utilities" name="l.success" value="SplitString( g.string, ',', l.settings:array )" /> <!-- @@ &mvt:global:MvDO_Error; --> <h3>Continue</h3> <mvt:foreach iterator="item" array="array"> <mvt:if expr="l.settings:item EQ 'three'"> test-three</br> <mvt:foreachcontinue /> </mvt:if> &mvt:item;</br> <mvt:if expr="l.settings:item EQ 'four'"> test-four</br> &mvt:item;</br> <mvt:foreachcontinue /> </mvt:if> </mvt:foreach> <h3>Stop</h3> <mvt:foreach iterator="item" array="array"> <mvt:if expr="l.settings:item EQ 'three'"> <mvt:foreachstop /> </mvt:if> &mvt:item;</br> </mvt:foreach>
 

Basket #36954

Created: 1490113529
View "Basket #36954"
<mvt:assign name="l.settings:days[1]" value="'Sunday'" /> <mvt:assign name="l.settings:days[2]" value="'Monday'" /> <mvt:assign name="l.settings:days[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:days[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:days[5]" value="'Thursday'" /> <mvt:assign name="l.settings:days[6]" value="'Friday'" /> <mvt:assign name="l.settings:days[7]" value="'Saturday'" /> <mvt:assign name="l.settings:meals[1]" value="'Breakfast'" /> <mvt:assign name="l.settings:meals[2]" value="'Lunch'" /> <mvt:assign name="l.settings:meals[3]" value="'Dinner'" /> <ul> <mvt:foreach iterator="day" array="days"> <li> <h2>&mvt:day;</h2> <div> l.pos1=<mvt:eval expr="g.pos1" /><br> l.count1=<mvt:eval expr="g.count1" /> </div> <ul> <mvt:foreach iterator="meal" array="meals"> <li> <h4>&mvt:meal;</h4> <div> l.pos2=<mvt:eval expr="l.pos2" /><br> l.count2=<mvt:eval expr="l.count2" /> </div> </li> </mvt:foreach> </ul> </li> </mvt:foreach> </ul>
 
View "mvt:foreach has l.posN & l.countN"
<mvt:assign name="l.settings:days[1]" value="'Sunday'" /> <mvt:assign name="l.settings:days[2]" value="'Monday'" /> <mvt:assign name="l.settings:days[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:days[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:days[5]" value="'Thursday'" /> <mvt:assign name="l.settings:days[6]" value="'Friday'" /> <mvt:assign name="l.settings:days[7]" value="'Saturday'" /> <mvt:assign name="l.settings:meals[1]" value="'Breakfast'" /> <mvt:assign name="l.settings:meals[2]" value="'Lunch'" /> <mvt:assign name="l.settings:meals[3]" value="'Dinner'" /> <ul> <mvt:foreach iterator="day" array="days"> <li> <h2>&mvt:day;</h2> <div> l.pos1=<mvt:eval expr="l.pos1" /><br> l.count1=<mvt:eval expr="l.count1" /> </div> <ul> <mvt:foreach iterator="meal" array="meals"> <li> <h4>&mvt:meal;</h4> <div> l.pos2=<mvt:eval expr="l.pos2" /><br> l.count2=<mvt:eval expr="l.count2" /> </div> </li> </mvt:foreach> </ul> </li> </mvt:foreach> </ul>
 
View "mvt:foreach has l.pos1 & l.count"
<mvt:assign name="l.settings:days[1]" value="'Sunday'" /> <mvt:assign name="l.settings:days[2]" value="'Monday'" /> <mvt:assign name="l.settings:days[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:days[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:days[5]" value="'Thursday'" /> <mvt:assign name="l.settings:days[6]" value="'Friday'" /> <mvt:assign name="l.settings:days[7]" value="'Saturday'" /> <mvt:assign name="l.settings:meals[1]" value="'Breakfast'" /> <mvt:assign name="l.settings:meals[2]" value="'Lunch'" /> <mvt:assign name="l.settings:meals[3]" value="'Dinner'" /> <ul> <mvt:foreach iterator="day" array="days"> <li> <h2>&mvt:day;</h2> <div> l.pos1=<mvt:eval expr="l.pos1" /><br> l.count1=<mvt:eval expr="l.count1" /> </div> <ul> <mvt:foreach iterator="meal" array="meals"> <li> <h4>&mvt:meal;</h4> <div> l.pos2=<mvt:eval expr="l.pos2" /><br> l.count2=<mvt:eval expr="l.count2" /> </div> </li> </mvt:foreach> </ul> </li> </mvt:foreach> </ul>
 
View "mvt:foreach has l.pos1 & l.count"
<mvt:assign name="l.settings:days[1]" value="'Sunday'" /> <mvt:assign name="l.settings:days[2]" value="'Monday'" /> <mvt:assign name="l.settings:days[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:days[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:days[5]" value="'Thursday'" /> <mvt:assign name="l.settings:days[6]" value="'Friday'" /> <mvt:assign name="l.settings:days[7]" value="'Saturday'" /> <mvt:assign name="l.settings:meals[1]" value="'Breakfast'" /> <mvt:assign name="l.settings:meals[2]" value="'Lunch'" /> <mvt:assign name="l.settings:meals[3]" value="'Dinner'" /> <ul> <mvt:foreach iterator="day" array="days"> <li> <h2>&mvt:day;</h2> <p> l.pos1=<mvt:eval expr="l.pos1" /><br> l.count1=<mvt:eval expr="l.count1" /><br> </p> <ul> <mvt:foreach iterator="meal" array="meals"> <li> <h4>&mvt:meal;</h4> <p> l.pos2=<mvt:eval expr="l.pos2" /><br> l.count2=<mvt:eval expr="l.count2" /><br> </p> </li> </mvt:foreach> </ul> </li> </mvt:foreach> </ul>
 

Basket #32556

Created: 1486502850
View "Basket #32556"
<mvt:assign name="l.settings:shippingmethods[1]:price" value="71.38"/> <mvt:assign name="l.settings:shippingmethods[2]:price" value="17.37"/> <mvt:assign name="l.settings:shippingmethods[3]:price" value="18.42"/> <mvt:assign name="l.settings:shippingmethods[4]:price" value="71.39"/> <mvt:assign name="l.settings:shippingmethods[1]:cost" value="1"/> <mvt:assign name="l.settings:shippingmethods[3]:cost" value="2"/> <mvt:assign name="l.settings:shippingmethods[4]:cost" value="3"/> <mvt:assign name="l.settings:shippingmethods[2]:cost" value="4"/> <h2>Before</h2> <mvt:foreach iterator="item" array="shippingmethods"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:shippingmethods, ':cost', 1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="shippingmethods"> &mvt:item;<br> </mvt:foreach> <mvt:assign name="l.settings:test1" value="':price'"/> <mvt:assign name="g.return_value" value="miva_array_sort( l.settings:shippingmethods,'',l.settings:test1)" /> <Br /> <Br /> <Br /> <mvt:foreach iterator="item" array="shippingmethods"> &mvt:item;<br> </mvt:foreach>
 

Basket #28862

Created: 1480959480
View "Basket #28862"
<mvt:assign name="l.settings:list[3]" value="'apples'" /> <mvt:assign name="l.settings:list[1]" value="'bananas'" /> <mvt:assign name="l.settings:list[2]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', 1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #27719

Created: 1478806093
View "Basket #27719"
<mvt:assign name="g.foo" value="'bar'" /> &mvte:global:foo;<mvt:eval expr="2 + 2" /><mvt:while expr="g.counter LT 10"> <mvt:assign name="g.counter" value="g.counter + 1" /> &mvte:global:counter;<br> </mvt:while>
 

Basket #27695

Created: 1478733584
View "Basket #27695"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', 1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 
View "Estimate Order Shipping Date"
<mvt:comment> Account for Daylight Savings time </mvt:comment> <mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <hr> <mvt:comment> Assign a Days-of-the-week text array for later </mvt:comment> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <mvt:comment> Prepare days to simulate & test senarios </mvt:comment> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:comment> Loop over each senario and test the estimation logic </mvt:comment> <mvt:foreach iterator="senario" array="senarios"> <mvt:comment> Assign some date-time variables that make it easier to read, write, and compare dates when we apply the estimation logic </mvt:comment> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2>Senario: &mvt:senario:descrip;<small>&mvt:senario:date:formatted;</small></h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:hour LT 10"> <mvt:comment> Estimation Logic: Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b>, and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:hour GE 10"> <mvt:comment> Estimation Logic: Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today, and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Estimation Logic: Ship Monday </mvt:comment> <h3>Order today, and it should ship on Monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will <b>ship the same day</b></li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will <b>ship the next day</b></li> <li>All other others (Thursday after 10am to Monday before 10 am) will be <b>shipped on Monday</b>.</li> </ul> </small> </p> <br><hr><br> </mvt:foreach> <mvt:comment> Just a Debugging Helper </mvt:comment> <mvt:comment> <mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" /> </mvt:comment>
 
View "Estimate Order Shipping Date"
<mvt:comment> Account for Daylight Savings time </mvt:comment> <mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <hr> <mvt:comment> Assign a Days-of-the-week text array for later </mvt:comment> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <mvt:comment> Prepare days to simulate & test senarios </mvt:comment> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:comment> Loop over each senario and test the estimation logic </mvt:comment> <mvt:foreach iterator="senario" array="senarios"> <mvt:comment> Assign some date-time variables that make it easier to read, write, and compare dates when we apply the estimation logic </mvt:comment> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:24hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:24hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2 style='color: gray'> Senario #<mvt:eval expr="POS1"/>: &mvt:senario:descrip; <small>&mvt:senario:date:formatted;</small> </h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:24hour LT 10"> <mvt:comment> Estimation Logic: Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b>, and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:24hour GE 10"> <mvt:comment> Estimation Logic: Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today, and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Estimation Logic: Ship Monday </mvt:comment> <h3>Order today, and it should ship on Monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will ship the same day.</li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will ship the next day.</li> <li>All other others (Thursday after 10am to Monday before 10 am) will be shipped on Monday.</li> </ul> </small> </p> <br><br><hr><br><br> </mvt:foreach> <mvt:comment> Just a Debugging Helper </mvt:comment> <mvt:comment><mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" /></mvt:comment>
 
View "Estimate Order Shipping Date"
<mvt:comment> Account for Daylight Savings time </mvt:comment> <mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <hr> <mvt:comment> Assign a Days-of-the-week text array for later </mvt:comment> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <mvt:comment> Prepare days to simulate & test senarios </mvt:comment> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:comment> Loop over each senario and test the estimation logic </mvt:comment> <mvt:foreach iterator="senario" array="senarios"> <mvt:comment> Assign some date-time variables that make it easier to read, write, and compare dates when we apply the estimation logic </mvt:comment> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:24hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:24hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2 style='color: gray'> Senario #<mvt:eval expr="POS1"/>: &mvt:senario:descrip; <small>&mvt:senario:date:formatted;</small> </h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:24hour LT 10"> <mvt:comment> Estimation Logic: Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b>, and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:24hour GE 10"> <mvt:comment> Estimation Logic: Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today, and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Estimation Logic: Ship Monday </mvt:comment> <h3>Order today, and it should ship on Monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will ship the same day.</li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will ship the next day.</li> <li>All other others (Thursday after 10am to Monday before 10 am) will be shipped on Monday.</li> </ul> </small> </p> <br><br><hr><br><br> </mvt:foreach> <mvt:comment> Just a Debugging Helper </mvt:comment> <mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" />
 
View "Estimate Order Shipping Date"
<mvt:comment> Account for Daylight Savings time </mvt:comment> <mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <hr> <mvt:comment> Assign a Days-of-the-week text array for later </mvt:comment> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <mvt:comment> Prepare days to simulate & test senarios </mvt:comment> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:comment> Loop over each senario and test the estimation logic </mvt:comment> <mvt:foreach iterator="senario" array="senarios"> <mvt:comment> Assign some date-time variables that make it easier to read, write, and compare dates when we apply the estimation logic </mvt:comment> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:24hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:24hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2 style='color: gray'> Senario #<mvt:eval expr="POS1"/>: &mvt:senario:descrip; <small>&mvt:senario:date:formatted;</small> </h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:24hour LT 10"> <mvt:comment> Estimation Logic: Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b>, and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:24hour GE 10"> <mvt:comment> Estimation Logic: Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today, and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Estimation Logic: Ship Monday </mvt:comment> <h3>Order today, and it should ship on Monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will <b>ship the same day</b></li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will <b>ship the next day</b></li> <li>All other others (Thursday after 10am to Monday before 10 am) will be <b>shipped on Monday</b>.</li> </ul> </small> </p> <br><hr><br> </mvt:foreach> <mvt:comment> Just a Debugging Helper </mvt:comment> <mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" />
 
View "Estimate Order Shipping Date"
<mvt:if expr="s.tm_isdst"> <mvt:assign name="g.Timezone_Offset" value="'-5'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CDT'" /> <mvt:else> <mvt:assign name="g.Timezone_Offset" value="'-6'" /> <mvt:assign name="g.Timezone_Abbreviation" value="'CST'" /> </mvt:if> <mvt:if expr="s.tm_isdst"> <p>Daylight savings time <b>IS</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> <mvt:else> <p>Daylight savings time is <b>NOT</b> in effect. Timezone Offset: &mvte:global:Timezone_Offset;</p> </mvt:if> <mvt:assign name="l.settings:daysofweek[1]" value="'Sunday'" /> <mvt:assign name="l.settings:daysofweek[2]" value="'Monday'" /> <mvt:assign name="l.settings:daysofweek[3]" value="'Tuesday'" /> <mvt:assign name="l.settings:daysofweek[4]" value="'Wednesday'" /> <mvt:assign name="l.settings:daysofweek[5]" value="'Thursday'" /> <mvt:assign name="l.settings:daysofweek[6]" value="'Friday'" /> <mvt:assign name="l.settings:daysofweek[7]" value="'Saturday'" /> <hr> <mvt:assign name="l.settings:senarios[1]:descrip" value="'Monday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[1]:timestamp" value="1470657660" /> <mvt:assign name="l.settings:senarios[2]:descrip" value="'Monday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[2]:timestamp" value="1470693660" /> <mvt:assign name="l.settings:senarios[3]:descrip" value="'Tuesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[3]:timestamp" value="1470744060" /> <mvt:assign name="l.settings:senarios[4]:descrip" value="'Tuesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[4]:timestamp" value="1470780060" /> <mvt:assign name="l.settings:senarios[5]:descrip" value="'Wednesday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[5]:timestamp" value="1470830460" /> <mvt:assign name="l.settings:senarios[6]:descrip" value="'Wednesday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[6]:timestamp" value="1470866460" /> <mvt:assign name="l.settings:senarios[7]:descrip" value="'Thursday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[7]:timestamp" value="1470916860" /> <mvt:assign name="l.settings:senarios[8]:descrip" value="'Thursday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[8]:timestamp" value="1470952860" /> <mvt:assign name="l.settings:senarios[9]:descrip" value="'Friday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[9]:timestamp" value="1471003260" /> <mvt:assign name="l.settings:senarios[10]:descrip" value="'Friday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[10]:timestamp" value="1471039260" /> <mvt:assign name="l.settings:senarios[11]:descrip" value="'Saturday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[11]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[12]:descrip" value="'Saturday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[12]:timestamp" value="1471125660" /> <mvt:assign name="l.settings:senarios[13]:descrip" value="'Sunday - before 10am CT'" /> <mvt:assign name="l.settings:senarios[13]:timestamp" value="1471089660" /> <mvt:assign name="l.settings:senarios[14]:descrip" value="'Sunday - after 10am CT'" /> <mvt:assign name="l.settings:senarios[14]:timestamp" value="1471125660" /> <mvt:foreach iterator="senario" array="senarios"> <mvt:assign name="l.settings:senario:date:year" value="time_t_year( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:month" value="padl(time_t_month( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:day" value="padl(time_t_dayofmonth( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:dayofweek" value="time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )" /> <mvt:assign name="l.settings:senario:date:dayofweek_formatted" value="l.settings:daysofweek[time_t_dayofweek( l.settings:senario:timestamp, g.Timezone_Offset )]" /> <mvt:assign name="l.settings:senario:date:24hour" value="padl(time_t_hour( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:min" value="padl(time_t_min( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:sec" value="padl(time_t_sec( l.settings:senario:timestamp, g.Timezone_Offset ), 2, 0)" /> <mvt:assign name="l.settings:senario:date:formatted" value="l.settings:senario:date:year $ '-' $ l.settings:senario:date:month $ '-' $ l.settings:senario:date:day $ ' ' $ l.settings:senario:date:24hour $ ':' $ l.settings:senario:date:min $ ':' $ l.settings:senario:date:sec $ ' ' $ g.Timezone_Offset" /> <h2 style="color: gray;">Senario #<mvt:eval expr="POS1"/>: &mvt:senario:descrip; <small>&mvt:senario:date:formatted;</small></h2> <mvt:if expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday, Thursday' AND l.settings:senario:date:24hour LT 10"> <mvt:comment> Ship Today </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="10 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship today.</h3> <mvt:elseif expr="l.settings:senario:date:dayofweek_formatted CIN 'Monday, Tuesday, Wednesday' AND l.settings:senario:date:24hour GE 10"> <mvt:comment> | Ship Tomorrow </mvt:comment> <mvt:assign name="l.settings:senario:cutoff:hours" value="34 - l.settings:senario:date:24hour" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="60 - l.settings:senario:date:min" /> <mvt:if expr="l.settings:senario:cutoff:minutes EQ 60"> <mvt:assign name="l.settings:senario:cutoff:hours" value="l.settings:senario:cutoff:hours + 1" /> <mvt:assign name="l.settings:senario:cutoff:minutes" value="0" /> </mvt:if> <mvt:comment><h3>Order within <b>&mvt:senario:cutoff:hours; hours &mvt:senario:cutoff:minutes; minutes</b> and it should ship tomorrow.</h3></mvt:comment> <h3>Order today and it should ship tomorrow.</h3> <mvt:else> <mvt:comment> Ship Monday </mvt:comment> <h3>Order today and it should ship monday.</h3> </mvt:if> <p> <small> <ul> <li>From Monday to Thursday, orders placed <i>before</i> 10am will <b>ship the same day</b></li> <li>From Monday to Wednesday, orders placed <i>after</i> 10am will <b>ship the next day</b></li> <li>All other others (Thursday after 10am to Monday before 10 am) will be <b>shipped on Monday</b>.</li> </ul> </small> </p> <br><hr><br> </mvt:foreach> <mvt:eval expr="glosub(miva_array_serialize(l.settings:senarios), ',', '<br>')" />
 

Basket #19784

Created: 1469229294
View "Basket #19784"
<mvt:assign name="l.settings:list[1]" value="'bananas'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <mvt:assign name="l.settings:list[4]" value="'bananas'" /> <mvt:assign name="l.settings:list[5]" value="'carrots'" /> <mvt:assign name="l.settings:list[6]" value="'bananas'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 

Basket #18999

Created: 1467387891
View "Basket #18999"
<mvt:assign name="g.api_key" value="'http://www.shoppopdisplays.com/mm5/5.00/modules/component/mailchimp.mvc?action=subscribe&api_key=BF1AexYORDY3VA12AQBRaS0CVw1zE0N8Xwk2Q303Qk5uTAUISg==&id=6805f1ce57&email_address=test@aol.com&merge_vars[FNAME]=&merge_vars[LNAME]=&output=json'" /> <mvt:assign name="g.api_key" value="gettoken(g.api_key, '&', 2)" /><br> &mvt:global:api_key; <mvt:assign name="g.api_key" value="gettoken(g.api_key, 'api', 2)" /><br> &mvt:global:api_key;
 
View "Basket #15478"
<mvt:assign name="g.string" value="'one,two,three,four,five'" /> <mvt:do file="g.Module_Library_Utilities" name="l.success" value="SplitString( g.string, ',', l.settings:array )" /> <!-- @@ &mvt:global:MvDO_Error; --> <h3>Continue</h3> <mvt:foreach iterator="item" array="array"> <mvt:if expr="l.settings:item EQ 'three'"> <mvt:foreachcontinue /> </mvt:if> &mvt:item;</br> </mvt:foreach> <h3>Stop</h3> <mvt:foreach iterator="item" array="array"> <mvt:if expr="l.settings:item EQ 'three'"> <mvt:foreachstop /> </mvt:if> &mvt:item;</br> </mvt:foreach>
 
View "Basket #15348"
<mvt:assign name="g.string" value="miva_array_deserialize('one,two,three,four,five')" /> <h3>Continue</h3> <mvt:foreach iterator="item" array="global:string"> <mvt:if expr="l.settings:item EQ 'three'"> <mvt:foreachcontinue /> </mvt:if> &mvt:item;</br> </mvt:foreach> <h3>Stop</h3> <mvt:foreach iterator="item" array="global:string"> <mvt:if expr="l.settings:item EQ 'three'"> <mvt:foreachstop /> </mvt:if> &mvt:item;</br> </mvt:foreach>
 
View "foreachcontinue and foreachstop"
<mvt:assign name="g.string" value="'one,two,three,four,five'" /> <mvt:do file="g.Module_Library_Utilities" name="l.success" value="SplitString( g.string, ',', l.settings:array )" /> <!-- @@ &mvt:global:MvDO_Error; --> <h3>Continue</h3> <mvt:foreach iterator="item" array="array"> <mvt:if expr="l.settings:item EQ 'three'"> <mvt:foreachcontinue /> </mvt:if> &mvt:item;</br> </mvt:foreach> <h3>Stop</h3> <mvt:foreach iterator="item" array="array"> <mvt:if expr="l.settings:item EQ 'three'"> <mvt:foreachstop /> </mvt:if> &mvt:item;</br> </mvt:foreach>
 

MivaScript Operators

 mivascript  operators  NOT  ROUND  CRYPT  MOD  POW  math  string  IN  CIN  EIN  ECIN  EQ  LT  LE  GT  GE  ISNULL  AND  OR
Created: 1456865839
View "MivaScript Operators"
<h1>MivaScript Operator Examples</h1> <h2><a href="http://www.mivascript.com/topic/operators.html">Documentation</a></h2> <h2><a href="http://snippets.miva.com/id/1456864554/latest">snippets.miva.com Examples</a></h2> <h2><code>NOT</code></h2> NOT 0: <mvt:eval expr="NOT 0" /><br> NOT 1: <mvt:eval expr="NOT 1" /><br> NOT '': <mvt:eval expr="NOT ''" /><br> NOT 'foobar': <mvt:eval expr="NOT 'foobar'" /><br> <h2><code>ROUND</code></h2> <mvt:assign name="g.PI" value="3.14159265359" /> g.PI: &mvte:global:PI;<br> g.PI ROUND 0: <mvt:eval expr="g.PI ROUND 0" /><br> g.PI ROUND 1: <mvt:eval expr="g.PI ROUND 1" /><br> g.PI ROUND 2: <mvt:eval expr="g.PI ROUND 2" /><br> g.PI ROUND 3: <mvt:eval expr="g.PI ROUND 3" /><br> <h2><code>CRYPT</code></h2> <mvt:assign name="g.password" value="'open-sesame'" /> g.password: &mvte:global:password;<br> g.password CRYPT 'key': <mvt:eval expr="g.password CRYPT 'key'" /><br> g.password CRYPT 'other-key': <mvt:eval expr="g.password CRYPT 'other-key'" /><br> <h2><code>MOD</code></h2> 3 MOD 3: <mvt:eval expr="3 MOD 3"/><br> 4 MOD 3: <mvt:eval expr="4 MOD 3"/><br> 5 MOD 3: <mvt:eval expr="5 MOD 3"/><br> 6 MOD 3: <mvt:eval expr="6 MOD 3"/><br> 7 MOD 3: <mvt:eval expr="7 MOD 3"/><br> 8 MOD 3: <mvt:eval expr="8 MOD 3"/><br> 9 MOD 3: <mvt:eval expr="9 MOD 3"/><br> <h2><code>POW</code></h2> 2 POW 1: <mvt:eval expr="2 POW 1"/><br> 2 POW 2: <mvt:eval expr="2 POW 2"/><br> 2 POW 0: <mvt:eval expr="2 POW 0"/><br> 2 POW 3: <mvt:eval expr="2 POW 3"/><br> 2 POW 4: <mvt:eval expr="2 POW 4"/><br> <h2><code>+-*/</code> <small>Math Operators</small></h2> 3 + 3: <mvt:eval expr="3 + 3"/><br> 3 - 3: <mvt:eval expr="3 - 3"/><br> 3 * 3: <mvt:eval expr="3 * 3"/><br> 3 / 3: <mvt:eval expr="3 / 3"/><br> <h2><code>$</code> <small>String Concatination</small></h2> 'foo' $ 'bar': <mvt:eval expr="'foo' $ 'bar'"/><br> <mvt:assign name="g.name" value="'John'" /> 'Hello ' $ g.name: <mvt:eval expr="'Hello ' $ g.name"/><br> <h2><code>IN</code> <small>First String Position (Case Sensitive)</small></h2> 'apple' IN 'Banana': <mvt:eval expr="'apple' IN 'Banana'"/><br> 'ba' IN 'Banana': <mvt:eval expr="'ba' IN 'Banana'"/><br> 'Ba' IN 'Banana': <mvt:eval expr="'Ba' IN 'Banana'"/><br> 'an' IN 'Banana': <mvt:eval expr="'an' IN 'Banana'"/><br> <h2><code>CIN</code> <small>First String Position (Case In-sensitive)</small></h2> 'apple' CIN 'Banana': <mvt:eval expr="'apple' CIN 'Banana'"/><br> 'ba' CIN 'Banana': <mvt:eval expr="'ba' CIN 'Banana'"/><br> 'Ba' CIN 'Banana': <mvt:eval expr="'Ba' CIN 'Banana'"/><br> 'an' CIN 'Banana': <mvt:eval expr="'an' CIN 'Banana'"/><br> <h2><code>EIN</code> <small>Last String Position (Case Sensitive)</small></h2> 'apple' EIN 'Banana': <mvt:eval expr="'apple' EIN 'Banana'"/><br> 'ba' EIN 'Banana': <mvt:eval expr="'ba' EIN 'Banana'"/><br> 'Ba' EIN 'Banana': <mvt:eval expr="'Ba' EIN 'Banana'"/><br> 'an' EIN 'Banana': <mvt:eval expr="'an' EIN 'Banana'"/><br> ('an' IN 'Banana') !== ('an' EIN 'Banana'): (<mvt:eval expr="'an' IN 'Banana'"/>) !== (<mvt:eval expr="'an' EIN 'Banana'"/>)<br> <h2><code>ECIN</code> <small>Last String Position (Case In-sensitive)</small></h2> 'apple' ECIN 'Banana': <mvt:eval expr="'apple' ECIN 'Banana'"/><br> 'ba' ECIN 'Banana': <mvt:eval expr="'ba' ECIN 'Banana'"/><br> 'Ba' ECIN 'Banana': <mvt:eval expr="'Ba' ECIN 'Banana'"/><br> 'an' ECIN 'Banana': <mvt:eval expr="'an' ECIN 'Banana'"/><br> ('an' CIN 'Banana') !== ('an' ECIN 'Banana'): (<mvt:eval expr="'an' CIN 'Banana'"/>) !== (<mvt:eval expr="'an' ECIN 'Banana'"/>)<br> <h2>Value Comparison Opperators</h2> <h3><code>EQ</code></h3> 1 EQ 1: <mvt:eval expr="1 EQ 1"/><br> 1 EQ '1': <mvt:eval expr="1 EQ '1'"/><br> 1 EQ '01': <mvt:eval expr="1 EQ '01'"/><br> 1 EQ 2: <mvt:eval expr="1 EQ 2"/><br> 1 EQ 0: <mvt:eval expr="1 EQ 0"/><br> 1 EQ '': <mvt:eval expr="1 EQ ''"/><br> <h3><code>NE</code></h3> 1 NE 1: <mvt:eval expr="1 NE 1"/><br> 1 NE '1': <mvt:eval expr="1 NE '1'"/><br> 1 NE '01': <mvt:eval expr="1 NE '01'"/><br> 1 NE 2: <mvt:eval expr="1 NE 2"/><br> 1 NE 0: <mvt:eval expr="1 NE 0"/><br> 1 NE '': <mvt:eval expr="1 NE ''"/><br> <h3><code>LT</code></h3> 1 LT 1: <mvt:eval expr="1 LT 1"/><br> 1 LT '1': <mvt:eval expr="1 LT '1'"/><br> 1 LT '01': <mvt:eval expr="1 LT '01'"/><br> 1 LT 2: <mvt:eval expr="1 LT 2"/><br> 1 LT 0: <mvt:eval expr="1 LT 0"/><br> 1 LT '': <mvt:eval expr="1 LT ''"/><br> <h3><code>LE</code></h3> 1 LE 1: <mvt:eval expr="1 LE 1"/><br> 1 LE '1': <mvt:eval expr="1 LE '1'"/><br> 1 LE '01': <mvt:eval expr="1 LE '01'"/><br> 1 LE 2: <mvt:eval expr="1 LE 2"/><br> 1 LE 0: <mvt:eval expr="1 LE 0"/><br> 1 LE '': <mvt:eval expr="1 LE ''"/><br> <h3><code>GT</code></h3> 1 GT 1: <mvt:eval expr="1 GT 1"/><br> 1 GT '1': <mvt:eval expr="1 GT '1'"/><br> 1 GT '01': <mvt:eval expr="1 GT '01'"/><br> 1 GT 2: <mvt:eval expr="1 GT 2"/><br> 1 GT 0: <mvt:eval expr="1 GT 0"/><br> 1 GT '': <mvt:eval expr="1 GT ''"/><br> <h3><code>GE</code></h3> 1 GE 1: <mvt:eval expr="1 GE 1"/><br> 1 GE '1': <mvt:eval expr="1 GE '1'"/><br> 1 GE '01': <mvt:eval expr="1 GE '01'"/><br> 1 GE 2: <mvt:eval expr="1 GE 2"/><br> 1 GE 0: <mvt:eval expr="1 GE 0"/><br> 1 GE '': <mvt:eval expr="1 GE ''"/><br> <h3><code>ISNULL</code></h3> ISNULL 1: <mvt:eval expr="ISNULL 1"/><br> ISNULL '1': <mvt:eval expr="ISNULL '1'"/><br> ISNULL '01': <mvt:eval expr="ISNULL '01'"/><br> ISNULL 2: <mvt:eval expr="ISNULL 2"/><br> ISNULL 0: <mvt:eval expr="ISNULL 0"/><br> ISNULL '': <mvt:eval expr="ISNULL ''"/><br> <h2>Logical Comparison Opperators</h2> <h2><code>AND</code></h2> 1 AND 1: <mvt:eval expr="1 AND 1"/><br> 1 AND 0: <mvt:eval expr="1 AND 0"/><br> 1 EQ 1 AND 2 EQ 2: <mvt:eval expr="1 EQ 1 AND 2 EQ 2"/><br> 1 EQ 2 AND 2 EQ 2: <mvt:eval expr="1 EQ 2 AND 2 EQ 2"/><br> 1 EQ 2 AND 2 EQ 3: <mvt:eval expr="1 EQ 2 AND 2 EQ 3"/><br> <h2><code>OR</code></h2> 1 OR 1: <mvt:eval expr="1 OR 1"/><br> 1 OR 0: <mvt:eval expr="1 OR 0"/><br> 1 EQ 1 OR 2 EQ 2: <mvt:eval expr="1 EQ 1 OR 2 EQ 2"/><br> 1 EQ 2 OR 2 EQ 2: <mvt:eval expr="1 EQ 2 OR 2 EQ 2"/><br> 1 EQ 2 OR 2 EQ 3: <mvt:eval expr="1 EQ 2 OR 2 EQ 3"/><br>
 

MivaScript Operators

 mivascript  operators  NOT  ROUND  CRYPT  MOD  POW  math  string  IN  CIN  EIN  ECIN  EQ  LT  LE  GT  GE  ISNULL  AND  OR
Created: 1456865827
View "MivaScript Operators"
<h1>MivaScript Operator Examples</h1> <h2><a href="http://www.mivascript.com/topic/operators.html">Documentation</a></h2> <h2><a href="http://snippets.miva.com/id/1456864554/latest">snippets.miva.com Examples</a></h2>c <h2><code>NOT</code></h2> NOT 0: <mvt:eval expr="NOT 0" /><br> NOT 1: <mvt:eval expr="NOT 1" /><br> NOT '': <mvt:eval expr="NOT ''" /><br> NOT 'foobar': <mvt:eval expr="NOT 'foobar'" /><br> <h2><code>ROUND</code></h2> <mvt:assign name="g.PI" value="3.14159265359" /> g.PI: &mvte:global:PI;<br> g.PI ROUND 0: <mvt:eval expr="g.PI ROUND 0" /><br> g.PI ROUND 1: <mvt:eval expr="g.PI ROUND 1" /><br> g.PI ROUND 2: <mvt:eval expr="g.PI ROUND 2" /><br> g.PI ROUND 3: <mvt:eval expr="g.PI ROUND 3" /><br> <h2><code>CRYPT</code></h2> <mvt:assign name="g.password" value="'open-sesame'" /> g.password: &mvte:global:password;<br> g.password CRYPT 'key': <mvt:eval expr="g.password CRYPT 'key'" /><br> g.password CRYPT 'other-key': <mvt:eval expr="g.password CRYPT 'other-key'" /><br> <h2><code>MOD</code></h2> 3 MOD 3: <mvt:eval expr="3 MOD 3"/><br> 4 MOD 3: <mvt:eval expr="4 MOD 3"/><br> 5 MOD 3: <mvt:eval expr="5 MOD 3"/><br> 6 MOD 3: <mvt:eval expr="6 MOD 3"/><br> 7 MOD 3: <mvt:eval expr="7 MOD 3"/><br> 8 MOD 3: <mvt:eval expr="8 MOD 3"/><br> 9 MOD 3: <mvt:eval expr="9 MOD 3"/><br> <h2><code>POW</code></h2> 2 POW 1: <mvt:eval expr="2 POW 1"/><br> 2 POW 2: <mvt:eval expr="2 POW 2"/><br> 2 POW 0: <mvt:eval expr="2 POW 0"/><br> 2 POW 3: <mvt:eval expr="2 POW 3"/><br> 2 POW 4: <mvt:eval expr="2 POW 4"/><br> <h2><code>+-*/</code> <small>Math Operators</small></h2> 3 + 3: <mvt:eval expr="3 + 3"/><br> 3 - 3: <mvt:eval expr="3 - 3"/><br> 3 * 3: <mvt:eval expr="3 * 3"/><br> 3 / 3: <mvt:eval expr="3 / 3"/><br> <h2><code>$</code> <small>String Concatination</small></h2> 'foo' $ 'bar': <mvt:eval expr="'foo' $ 'bar'"/><br> <mvt:assign name="g.name" value="'John'" /> 'Hello ' $ g.name: <mvt:eval expr="'Hello ' $ g.name"/><br> <h2><code>IN</code> <small>First String Position (Case Sensitive)</small></h2> 'apple' IN 'Banana': <mvt:eval expr="'apple' IN 'Banana'"/><br> 'ba' IN 'Banana': <mvt:eval expr="'ba' IN 'Banana'"/><br> 'Ba' IN 'Banana': <mvt:eval expr="'Ba' IN 'Banana'"/><br> 'an' IN 'Banana': <mvt:eval expr="'an' IN 'Banana'"/><br> <h2><code>CIN</code> <small>First String Position (Case In-sensitive)</small></h2> 'apple' CIN 'Banana': <mvt:eval expr="'apple' CIN 'Banana'"/><br> 'ba' CIN 'Banana': <mvt:eval expr="'ba' CIN 'Banana'"/><br> 'Ba' CIN 'Banana': <mvt:eval expr="'Ba' CIN 'Banana'"/><br> 'an' CIN 'Banana': <mvt:eval expr="'an' CIN 'Banana'"/><br> <h2><code>EIN</code> <small>Last String Position (Case Sensitive)</small></h2> 'apple' EIN 'Banana': <mvt:eval expr="'apple' EIN 'Banana'"/><br> 'ba' EIN 'Banana': <mvt:eval expr="'ba' EIN 'Banana'"/><br> 'Ba' EIN 'Banana': <mvt:eval expr="'Ba' EIN 'Banana'"/><br> 'an' EIN 'Banana': <mvt:eval expr="'an' EIN 'Banana'"/><br> ('an' IN 'Banana') !== ('an' EIN 'Banana'): (<mvt:eval expr="'an' IN 'Banana'"/>) !== (<mvt:eval expr="'an' EIN 'Banana'"/>)<br> <h2><code>ECIN</code> <small>Last String Position (Case In-sensitive)</small></h2> 'apple' ECIN 'Banana': <mvt:eval expr="'apple' ECIN 'Banana'"/><br> 'ba' ECIN 'Banana': <mvt:eval expr="'ba' ECIN 'Banana'"/><br> 'Ba' ECIN 'Banana': <mvt:eval expr="'Ba' ECIN 'Banana'"/><br> 'an' ECIN 'Banana': <mvt:eval expr="'an' ECIN 'Banana'"/><br> ('an' CIN 'Banana') !== ('an' ECIN 'Banana'): (<mvt:eval expr="'an' CIN 'Banana'"/>) !== (<mvt:eval expr="'an' ECIN 'Banana'"/>)<br> <h2>Value Comparison Opperators</h2> <h3><code>EQ</code></h3> 1 EQ 1: <mvt:eval expr="1 EQ 1"/><br> 1 EQ '1': <mvt:eval expr="1 EQ '1'"/><br> 1 EQ '01': <mvt:eval expr="1 EQ '01'"/><br> 1 EQ 2: <mvt:eval expr="1 EQ 2"/><br> 1 EQ 0: <mvt:eval expr="1 EQ 0"/><br> 1 EQ '': <mvt:eval expr="1 EQ ''"/><br> <h3><code>NE</code></h3> 1 NE 1: <mvt:eval expr="1 NE 1"/><br> 1 NE '1': <mvt:eval expr="1 NE '1'"/><br> 1 NE '01': <mvt:eval expr="1 NE '01'"/><br> 1 NE 2: <mvt:eval expr="1 NE 2"/><br> 1 NE 0: <mvt:eval expr="1 NE 0"/><br> 1 NE '': <mvt:eval expr="1 NE ''"/><br> <h3><code>LT</code></h3> 1 LT 1: <mvt:eval expr="1 LT 1"/><br> 1 LT '1': <mvt:eval expr="1 LT '1'"/><br> 1 LT '01': <mvt:eval expr="1 LT '01'"/><br> 1 LT 2: <mvt:eval expr="1 LT 2"/><br> 1 LT 0: <mvt:eval expr="1 LT 0"/><br> 1 LT '': <mvt:eval expr="1 LT ''"/><br> <h3><code>LE</code></h3> 1 LE 1: <mvt:eval expr="1 LE 1"/><br> 1 LE '1': <mvt:eval expr="1 LE '1'"/><br> 1 LE '01': <mvt:eval expr="1 LE '01'"/><br> 1 LE 2: <mvt:eval expr="1 LE 2"/><br> 1 LE 0: <mvt:eval expr="1 LE 0"/><br> 1 LE '': <mvt:eval expr="1 LE ''"/><br> <h3><code>GT</code></h3> 1 GT 1: <mvt:eval expr="1 GT 1"/><br> 1 GT '1': <mvt:eval expr="1 GT '1'"/><br> 1 GT '01': <mvt:eval expr="1 GT '01'"/><br> 1 GT 2: <mvt:eval expr="1 GT 2"/><br> 1 GT 0: <mvt:eval expr="1 GT 0"/><br> 1 GT '': <mvt:eval expr="1 GT ''"/><br> <h3><code>GE</code></h3> 1 GE 1: <mvt:eval expr="1 GE 1"/><br> 1 GE '1': <mvt:eval expr="1 GE '1'"/><br> 1 GE '01': <mvt:eval expr="1 GE '01'"/><br> 1 GE 2: <mvt:eval expr="1 GE 2"/><br> 1 GE 0: <mvt:eval expr="1 GE 0"/><br> 1 GE '': <mvt:eval expr="1 GE ''"/><br> <h3><code>ISNULL</code></h3> ISNULL 1: <mvt:eval expr="ISNULL 1"/><br> ISNULL '1': <mvt:eval expr="ISNULL '1'"/><br> ISNULL '01': <mvt:eval expr="ISNULL '01'"/><br> ISNULL 2: <mvt:eval expr="ISNULL 2"/><br> ISNULL 0: <mvt:eval expr="ISNULL 0"/><br> ISNULL '': <mvt:eval expr="ISNULL ''"/><br> <h2>Logical Comparison Opperators</h2> <h2><code>AND</code></h2> 1 AND 1: <mvt:eval expr="1 AND 1"/><br> 1 AND 0: <mvt:eval expr="1 AND 0"/><br> 1 EQ 1 AND 2 EQ 2: <mvt:eval expr="1 EQ 1 AND 2 EQ 2"/><br> 1 EQ 2 AND 2 EQ 2: <mvt:eval expr="1 EQ 2 AND 2 EQ 2"/><br> 1 EQ 2 AND 2 EQ 3: <mvt:eval expr="1 EQ 2 AND 2 EQ 3"/><br> <h2><code>OR</code></h2> 1 OR 1: <mvt:eval expr="1 OR 1"/><br> 1 OR 0: <mvt:eval expr="1 OR 0"/><br> 1 EQ 1 OR 2 EQ 2: <mvt:eval expr="1 EQ 1 OR 2 EQ 2"/><br> 1 EQ 2 OR 2 EQ 2: <mvt:eval expr="1 EQ 2 OR 2 EQ 2"/><br> 1 EQ 2 OR 2 EQ 3: <mvt:eval expr="1 EQ 2 OR 2 EQ 3"/><br>
 

MivaScript Operators

 mivascript  operators  NOT  ROUND  CRYPT  MOD  POW  math  string  IN  CIN  EIN  ECIN  EQ  LT  LE  GT  GE  ISNULL  AND  OR
Created: 1456864554
View "MivaScript Operators"
<h1><A href="http://www.mivascript.com/topic/operators.html">MivaScript Operators</A></h1> <mvt:assign name="g.counter" value="1" /> <h2><code>NOT</code></h2> NOT 0: <mvt:eval expr="NOT 0" /><br> NOT 1: <mvt:eval expr="NOT 1" /><br> NOT '': <mvt:eval expr="NOT ''" /><br> NOT 'foobar': <mvt:eval expr="NOT 'foobar'" /><br> <h2><code>ROUND</code></h2> <mvt:assign name="g.PI" value="3.14159265359" /> g.PI: &mvte:global:PI;<br> g.PI ROUND 0: <mvt:eval expr="g.PI ROUND 0" /><br> g.PI ROUND 1: <mvt:eval expr="g.PI ROUND 1" /><br> g.PI ROUND 2: <mvt:eval expr="g.PI ROUND 2" /><br> g.PI ROUND 3: <mvt:eval expr="g.PI ROUND 3" /><br> <h2><code>CRYPT</code></h2> <mvt:assign name="g.password" value="'open-sesame'" /> g.password: &mvte:global:password;<br> g.password CRYPT 'key': <mvt:eval expr="g.password CRYPT 'key'" /><br> g.password CRYPT 'other-key': <mvt:eval expr="g.password CRYPT 'other-key'" /><br> <h2><code>MOD</code></h2> 3 MOD 3: <mvt:eval expr="3 MOD 3"/><br> 4 MOD 3: <mvt:eval expr="4 MOD 3"/><br> 5 MOD 3: <mvt:eval expr="5 MOD 3"/><br> 6 MOD 3: <mvt:eval expr="6 MOD 3"/><br> 7 MOD 3: <mvt:eval expr="7 MOD 3"/><br> 8 MOD 3: <mvt:eval expr="8 MOD 3"/><br> 9 MOD 3: <mvt:eval expr="9 MOD 3"/><br> <h2><code>POW</code></h2> 2 POW 1: <mvt:eval expr="2 POW 1"/><br> 2 POW 2: <mvt:eval expr="2 POW 2"/><br> 2 POW 0: <mvt:eval expr="2 POW 0"/><br> 2 POW 3: <mvt:eval expr="2 POW 3"/><br> 2 POW 4: <mvt:eval expr="2 POW 4"/><br> <h2><code>+-*/</code> <small>Math Operators</small></h2> 3 + 3: <mvt:eval expr="3 + 3"/><br> 3 - 3: <mvt:eval expr="3 - 3"/><br> 3 * 3: <mvt:eval expr="3 * 3"/><br> 3 / 3: <mvt:eval expr="3 / 3"/><br> <h2><code>$</code> <small>String Concatination</small></h2> 'foo' $ 'bar': <mvt:eval expr="'foo' $ 'bar'"/><br> <mvt:assign name="g.name" value="'John'" /> 'Hello ' $ g.name: <mvt:eval expr="'Hello ' $ g.name"/><br> <h2><code>IN</code> <small>First String Position (Case Sensitive)</small></h2> 'apple' IN 'Banana': <mvt:eval expr="'apple' IN 'Banana'"/><br> 'ba' IN 'Banana': <mvt:eval expr="'ba' IN 'Banana'"/><br> 'Ba' IN 'Banana': <mvt:eval expr="'Ba' IN 'Banana'"/><br> 'an' IN 'Banana': <mvt:eval expr="'an' IN 'Banana'"/><br> <h2><code>CIN</code> <small>First String Position (Case In-sensitive)</small></h2> 'apple' CIN 'Banana': <mvt:eval expr="'apple' CIN 'Banana'"/><br> 'ba' CIN 'Banana': <mvt:eval expr="'ba' CIN 'Banana'"/><br> 'Ba' CIN 'Banana': <mvt:eval expr="'Ba' CIN 'Banana'"/><br> 'an' CIN 'Banana': <mvt:eval expr="'an' CIN 'Banana'"/><br> <h2><code>EIN</code> <small>Last String Position (Case Sensitive)</small></h2> 'apple' EIN 'Banana': <mvt:eval expr="'apple' EIN 'Banana'"/><br> 'ba' EIN 'Banana': <mvt:eval expr="'ba' EIN 'Banana'"/><br> 'Ba' EIN 'Banana': <mvt:eval expr="'Ba' EIN 'Banana'"/><br> 'an' EIN 'Banana': <mvt:eval expr="'an' EIN 'Banana'"/><br> ('an' IN 'Banana') !== ('an' EIN 'Banana'): (<mvt:eval expr="'an' IN 'Banana'"/>) !== (<mvt:eval expr="'an' EIN 'Banana'"/>)<br> <h2><code>ECIN</code> <small>Last String Position (Case In-sensitive)</small></h2> 'apple' ECIN 'Banana': <mvt:eval expr="'apple' ECIN 'Banana'"/><br> 'ba' ECIN 'Banana': <mvt:eval expr="'ba' ECIN 'Banana'"/><br> 'Ba' ECIN 'Banana': <mvt:eval expr="'Ba' ECIN 'Banana'"/><br> 'an' ECIN 'Banana': <mvt:eval expr="'an' ECIN 'Banana'"/><br> ('an' CIN 'Banana') !== ('an' ECIN 'Banana'): (<mvt:eval expr="'an' CIN 'Banana'"/>) !== (<mvt:eval expr="'an' ECIN 'Banana'"/>)<br> <h2>Value Comparison Opperators</h2> <h3><code>EQ</code></h3> 1 EQ 1: <mvt:eval expr="1 EQ 1"/><br> 1 EQ '1': <mvt:eval expr="1 EQ '1'"/><br> 1 EQ '01': <mvt:eval expr="1 EQ '01'"/><br> 1 EQ 2: <mvt:eval expr="1 EQ 2"/><br> 1 EQ 0: <mvt:eval expr="1 EQ 0"/><br> 1 EQ '': <mvt:eval expr="1 EQ ''"/><br> <h3><code>NE</code></h3> 1 NE 1: <mvt:eval expr="1 NE 1"/><br> 1 NE '1': <mvt:eval expr="1 NE '1'"/><br> 1 NE '01': <mvt:eval expr="1 NE '01'"/><br> 1 NE 2: <mvt:eval expr="1 NE 2"/><br> 1 NE 0: <mvt:eval expr="1 NE 0"/><br> 1 NE '': <mvt:eval expr="1 NE ''"/><br> <h3><code>LT</code></h3> 1 LT 1: <mvt:eval expr="1 LT 1"/><br> 1 LT '1': <mvt:eval expr="1 LT '1'"/><br> 1 LT '01': <mvt:eval expr="1 LT '01'"/><br> 1 LT 2: <mvt:eval expr="1 LT 2"/><br> 1 LT 0: <mvt:eval expr="1 LT 0"/><br> 1 LT '': <mvt:eval expr="1 LT ''"/><br> <h3><code>LE</code></h3> 1 LE 1: <mvt:eval expr="1 LE 1"/><br> 1 LE '1': <mvt:eval expr="1 LE '1'"/><br> 1 LE '01': <mvt:eval expr="1 LE '01'"/><br> 1 LE 2: <mvt:eval expr="1 LE 2"/><br> 1 LE 0: <mvt:eval expr="1 LE 0"/><br> 1 LE '': <mvt:eval expr="1 LE ''"/><br> <h3><code>GT</code></h3> 1 GT 1: <mvt:eval expr="1 GT 1"/><br> 1 GT '1': <mvt:eval expr="1 GT '1'"/><br> 1 GT '01': <mvt:eval expr="1 GT '01'"/><br> 1 GT 2: <mvt:eval expr="1 GT 2"/><br> 1 GT 0: <mvt:eval expr="1 GT 0"/><br> 1 GT '': <mvt:eval expr="1 GT ''"/><br> <h3><code>GE</code></h3> 1 GE 1: <mvt:eval expr="1 GE 1"/><br> 1 GE '1': <mvt:eval expr="1 GE '1'"/><br> 1 GE '01': <mvt:eval expr="1 GE '01'"/><br> 1 GE 2: <mvt:eval expr="1 GE 2"/><br> 1 GE 0: <mvt:eval expr="1 GE 0"/><br> 1 GE '': <mvt:eval expr="1 GE ''"/><br> <h3><code>ISNULL</code></h3> ISNULL 1: <mvt:eval expr="ISNULL 1"/><br> ISNULL '1': <mvt:eval expr="ISNULL '1'"/><br> ISNULL '01': <mvt:eval expr="ISNULL '01'"/><br> ISNULL 2: <mvt:eval expr="ISNULL 2"/><br> ISNULL 0: <mvt:eval expr="ISNULL 0"/><br> ISNULL '': <mvt:eval expr="ISNULL ''"/><br> <h2>Logical Comparison Opperators</h2> <h2><code>AND</code></h2> 1 AND 1: <mvt:eval expr="1 AND 1"/><br> 1 AND 0: <mvt:eval expr="1 AND 0"/><br> 1 EQ 1 AND 2 EQ 2: <mvt:eval expr="1 EQ 1 AND 2 EQ 2"/><br> 1 EQ 2 AND 2 EQ 2: <mvt:eval expr="1 EQ 2 AND 2 EQ 2"/><br> 1 EQ 2 AND 2 EQ 3: <mvt:eval expr="1 EQ 2 AND 2 EQ 3"/><br> <h2><code>OR</code></h2> 1 OR 1: <mvt:eval expr="1 OR 1"/><br> 1 OR 0: <mvt:eval expr="1 OR 0"/><br> 1 EQ 1 OR 2 EQ 2: <mvt:eval expr="1 EQ 1 OR 2 EQ 2"/><br> 1 EQ 2 OR 2 EQ 2: <mvt:eval expr="1 EQ 2 OR 2 EQ 2"/><br> 1 EQ 2 OR 2 EQ 3: <mvt:eval expr="1 EQ 2 OR 2 EQ 3"/><br>
 

Basket #11760

Get the formatted date one week from now.
Created: 1455057431
View "Basket #11760"
<mvt:eval expr="7 - 3" />
 
View "Sort One Dimensional Array"
<mvt:assign name="l.settings:list[1]" value="'apples'" /> <mvt:assign name="l.settings:list[2]" value="'bananas'" /> <mvt:assign name="l.settings:list[3]" value="'carrots'" /> <h2>Before</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach> <mvt:do file="g.module_library_utilities" name="l.null" value="QuickSortArray(l.settings:list, '', -1)" /> <h2>After</h2> <mvt:foreach iterator="item" array="list"> &mvt:item;<br> </mvt:foreach>
 
View "Credit Card Number Formatter & Cleaner "
<mvt:assign name="g.cc_num_dirty" value="'4444-5555/3333A1111-adasdsadasdas!'" /> <mvt:while expr="l.character_counter LT len(g.cc_num_dirty)"> <mvt:assign name="l.character_counter" value="l.character_counter + 1" /> <mvt:assign name="l.character" value="substring_var( g.cc_num_dirty, l.character_counter, 1 )"/> <mvt:if expr="isdigit(l.character)"> <mvt:if expr="l.digit_counter GT 0 AND l.digit_counter MOD 4 EQ 0"> <mvt:assign name="g.cc_num_clean" value="g.cc_num_clean $ '-'" /> </mvt:if> <mvt:assign name="g.cc_num_clean" value="g.cc_num_clean $ l.character" /> <mvt:assign name="l.digit_counter" value="l.digit_counter + 1" /> </mvt:if> </mvt:while> &mvte:global:cc_num_clean;
 
View "Credit Card Number Formatter & Cleaner "
<mvt:assign name="g.cc_num_dirty" value="'4444-5555/3333A1111-adasdsadasdas!'" /> <mvt:while expr="l.character_counter LT len(g.cc_num_dirty)"> <mvt:assign name="l.character_counter" value="l.character_counter + 1" /> <mvt:assign name="l.character" value="substring_var( g.cc_num_dirty, l.character_counter, 1 )"/> <mvt:if expr="isdigit(l.character)"> <mvt:if expr="l.digit_counter GT 0 AND l.digit_counter MOD 4 EQ 0"> <mvt:assign name="g.cc_num_clean" value="g.cc_num_clean $ '-'" /> </mvt:if> <mvt:assign name="g.cc_num_clean" value="g.cc_num_clean $ l.character" /> <mvt:assign name="l.digit_counter" value="l.digit_counter + 1" /> </mvt:if> </mvt:while> &mvte:global:cc_num_clean;