1. What is the difference between PUBLIC and SHARED?
2. Why does this work:
DEFINT A - Z
I = 19285
DIM AnArray(I) AS BYTE
PUBLIC AnArray()
CALL Prt()
END
SUB Prt
PRINT UBOUND(AnArray())
END SUB
while this produces a duplicate definition error:
DEFINT A - Z
PUBLIC AnArray() 'AS BYTE produces a syntax error
I = 19285
DIM AnArray(I) AS BYTE
CALL Prt()
END
SUB Prt
PRINT UBOUND(AnArray())
END SUB
PS: The first semantic seems like a rather unstructured approach.
2. Why does this work:
DEFINT A - Z
I = 19285
DIM AnArray(I) AS BYTE
PUBLIC AnArray()
CALL Prt()
END
SUB Prt
PRINT UBOUND(AnArray())
END SUB
while this produces a duplicate definition error:
DEFINT A - Z
PUBLIC AnArray() 'AS BYTE produces a syntax error
I = 19285
DIM AnArray(I) AS BYTE
CALL Prt()
END
SUB Prt
PRINT UBOUND(AnArray())
END SUB
PS: The first semantic seems like a rather unstructured approach.
Comment