I dony' understand. Look at this code:
So, if CLEAR completely remove b%(), so that it doesn't exist anymore, why it is however needed REDIM SHARED b%(30) before CLEAR? It seems that CLEAR completely remove b%(), without removing the information that it is SHARED. But how is it possible that an inexistent array could be SHARED?
Code: (Select All)
'DIM SHARED b%(30) 'if activated, the program doesn't work.
REDIM SHARED b%(30) 'if activated, the program works.
'if both deactivated, the program doesn't work.
CLEAR
FOR i% = 1 TO 40
REDIM _PRESERVE b%(i%)
b%(i%) = i%
NEXT i%
CALL ciao
SUB ciao
PRINT b%(3)
END SUB
So, if CLEAR completely remove b%(), so that it doesn't exist anymore, why it is however needed REDIM SHARED b%(30) before CLEAR? It seems that CLEAR completely remove b%(), without removing the information that it is SHARED. But how is it possible that an inexistent array could be SHARED?