Pocket Plane Group

Friends and Neighbors => Weimer Republic (WeiDU.org) => WeiDU => Topic started by: K4thos on September 23, 2018, 06:02:27 AM

Title: Request: CLEAR_ARRAY affecting VARIABLE_IS_SET (solved)
Post by: K4thos on September 23, 2018, 06:02:27 AM
Quote from documentation:
Quote
ACTION_CLEAR_ARRAY String
‘Forgets’ that the array string exists until its values are recalled. The actual variables’ values are kept, the only effect is that *PHP_EACH will not consider old values.
I'd like to request an action that actually clears the array rather then faking it (or make the current action affect VARIABLE_IS_SET). Example code that displays the value after "clearing" the array:
Code: [Select]
ACTION_DEFINE_ASSOCIATIVE_ARRAY array BEGIN ~a~ => ~b~ END

ACTION_CLEAR_ARRAY array

ACTION_IF (VARIABLE_IS_SET $array(~a~)) BEGIN
OUTER_TEXT_SPRINT var $array(~a~)
PRINT ~VARIABLE_IS_SET: %var%~
END
Title: Re: Request: CLEAR_ARRAY affecting VARIABLE_IS_SET
Post by: K4thos on September 23, 2018, 07:16:17 AM
Nevermind, the same functions can be reused with different arrays via $EVAL, so clearing arrays is not really needed.