snippet-1496699279


Snippet: 1496699279 - v1

Created: 1496699279
View "Snippet: 1496699279 - v1"
<mvt:assign name="l.success" value="miva_json_decode( '[{\"state\": \"AL\", \"loc\": \"222 Street\"}, {\"state\": \"AL\", \"loc\": \"223 Street\"}, {\"state\": \"AL\", \"loc\": \"224 Street\"}, {\"state\": \"AL\", \"loc\": \"225 Street\"}, {\"state\": \"AL\", \"loc\": \"226 Street\"}, {\"state\": \"AL\", \"loc\": \"227 Street\"}, {\"state\": \"AL\", \"loc\": \"228 Street\"}, {\"state\": \"AL\", \"loc\": \"229 Street\"}, {\"state\": \"AL\", \"loc\": \"230 Street\"}, {\"state\": \"AL\", \"loc\": \"231 Street\"}, {\"state\": \"CA\", \"loc\": \"232 Street\"}, {\"state\": \"CA\", \"loc\": \"233 Street\"}, {\"state\": \"CA\", \"loc\": \"228 Street\"}, {\"state\": \"CA\", \"loc\": \"229 Street\"}, {\"state\": \"CA\", \"loc\": \"230 Street\"}, {\"state\": \"CA\", \"loc\": \"231 Street\"}, {\"state\": \"CA\", \"loc\": \"232 Street\"}, {\"state\": \"CA\", \"loc\": \"233 Street\"}]', l.settings:points )" /> <mvt:assign name="l.settings:states" value="NULL" /> <mvt:foreach iterator="point" array="points"> <mvt:assign name="l.tmp" value="NULL" /> <mvt:assign name="l.tmp:state" value="l.settings:point:state" /> <mvt:assign name="l.success" value="miva_array_insert_var( l.tmp:loc, l.settings:point:loc, -1 )" /> <mvt:assign name="l.index" value="miva_array_search( l.settings:states, 1, l.element, 'l.element:state EQ l.tmp:state' )" /> <mvt:if expr="l.index"> <h3>Operation = Updated.</h3> <mvt:assign name="l.success" value="miva_array_insert_var( l.settings:states[ l.index ]:loc, l.tmp:loc[1], -1 )" /> <mvt:else> <h3>Operation = Inserted.</h3> <mvt:assign name="l.success" value="miva_array_insert_var( l.settings:states, l.tmp, -1 )" /> </mvt:if> <hr> </mvt:foreach> <mvt:assign name="g.mvt_debug" value="glosub( miva_array_serialize( l.settings:states ), ',', asciichar( 10 ) )" /> <textarea> &mvt:global:mvt_debug; </textarea>