; ; @ANO_SCRIPT_NAME var_trigger ; @ANO_SCRIPT_VERSION 0.0.1 ; @ANO_SCRIPT_DESCRIPTION Simple variable trigger example ; ; @ANO_FLAGS_USE_PROTOS [ ] ; @ANO_FLAGS_VAR_NAME_SUBS [ ] ; @ANO_FLAGS_VAR_WARN_UNUSED [ ] ; ; Copyright (c) 2016-2026, Jani Salonen ; All rights reserved. ; ; Ano script supports variable trigger functions when variable value changes, ; here is small demonstration about that. ; main [exit: 0] { ; Move something to my_one to start trigger function... ; mov my_one (1) ; ...and make it again. ; add my_one (2) ; Make another round with threaded trigger. ; for (mov _i (0); _i < 10; inc _i) { mov my_two (_i) } ; Wait for all trigger threads to finish. ; thread_wait_all } trigger my_one { fetch _tmp (my_one) print "This is trigger for my_one variable, localized as _tmp.\n" print "_tmp value is " . _tmp . "\n" } trigger my_two [mode: threaded] { fetch _tmp (my_two) print "This is trigger for my_two variable, localized as _tmp.\n" print "_tmp value is " . _tmp . "\n" }