This is kind of odd, and was brought to light to me by IAmAPersson (I get worried that I spelled that wrong every single time, but I'm pretty certain this time). So I was working on ZOS when something odd happened. ZOS works by splitting a program up into individual labels with code in them, then using GOSUB to run each line. However, things took a twist when I tried to use an array. This is what it looked like.
Now, I think I have a general idea of what is happening, so here it is.
When the program GOSUBs to the label, it declares the array. The array is in slot 1, however it is being run by slot 0, so it is set as an array in slot 1, being assigned a pointer to use. Then, the interpreter returns to slot 0. When the program later returns to a later line with FILES, it does find an array in slot 1, but it's pointer is stored by the program in slot 0 (or possibly even forgotten). Thus, it is a NULL and Void pointer, and the function FILES called for an array.
Then again, I'm probably wrong with at least one of those things.
'THE PROGRAM BEING RUN IN ZOS: @FEXP_CODE_0 DIM F$[0] RETURN 'ZOS ''POINTLESS LOOPS THAT ADD NOTHING TO THE MEANING OF THIS POST GOSUB "1:@FEXP_CODE_"+STR$(I) 'I=0But then what happened? Well, I ran the code and used the array F$ in FILES. FILES F$,"/" Which gave me a Type Mismatch error. Obviously the string literal is indeed a string literal, so then I decided to test what F$ was.
?F$+1 TYPE MISMATCH ?F$[0] TYPE MISMATCH ?F$ TYPE MISMATCHI concluded that F$ was nothing, but after IAmAPersson's suggestion that I may have turned it into a pointer, I tested that theory.
DIM A$[10] A$[0]="HELLO" A$[1]="WORLD" F$=A$ ?F$[0] HELLOSo thus, I conclude that F$ must be a pointer. However, it doesn't just point at arrays, and it gets odd after getting used to the type suffixes.
VAR H=99 F$=H F$=F$-1 ?H 98