Author Topic: Request: CLEAR_ARRAY affecting VARIABLE_IS_SET (solved)  (Read 846 times)

Offline K4thos

  • Planewalker
  • *****
  • Posts: 110
Request: CLEAR_ARRAY affecting VARIABLE_IS_SET (solved)
« 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
« Last Edit: September 23, 2018, 07:16:30 AM by K4thos »

Offline K4thos

  • Planewalker
  • *****
  • Posts: 110
Re: Request: CLEAR_ARRAY affecting VARIABLE_IS_SET
« Reply #1 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.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: