Functions Documentation | |
Name | enumWhile |
Syntax | (enumWhile list condition itemVar exp) -> value of last expression |
Argument List | list: A list of elements you want to walk through. condition: Stops enum if condition is Nil. itemVar: Name of the variable that will be used to hold the current element you are at in the enum. Does not need to be defined beforehand. exp: The expression you want to evaluate for each element in the list. The element will be available inside the expression under the name you used in `itemVar'. |
Returns | Whatever the last expression evaluated inside returns. |
Category | list, iteration |
Description | A function allowing you to evaluate an expression using the variable to store the element you are at for every element in a list unless condition is Nil. |
Example |
(block (condition) (setq condition True) (enumwhile '(a b c d) condition theElement (block Nil (if (eq theElement 'b) (setq condition Nil)) (dbgOutput theElement) ) ) ) This will display on the debug console. a b True |
Comment | Basically a enum with an if inside of it. |
Mod of the Month (February '24) |
Featured Mods (random) |
Uncharted |
Tractor Beam |
Quality Mods (random) |
ODM Civilian Crafts |
Angelus-class Explorer |
Balanced Mods (random) |
F.F.A.S. (Friendly Fire Avoidance System) for Autons |
Repair droids |