I tried to make a library, but I'm getting "Undefined variable" on B[], and "Type mismatch" on A[]. What gives? How can I use arrays on my library files? Either DIM or VAR keyword should work, but it doesn't in this case.
I was having this exact problem. This is a screenshot of the library, yes? So you're including it from some other program file?
I found that I had to use EXEC "PRG1:LIB" instead of USE "PRG1:LIB". This allows the library to define its local variables. They remain in memory, but they can only be accessed by the library's functions. That should solve your A array.
As for your B array, I'm guessing it was defined in the program file that's using this library. Unfortunately, your library can't "see" any variables that were defined outside of it. Either you must pass B into INIT as an argument and work with it there, or you must define B in your library and set up COMMON functions that allow other files to access it.
Hi Ed. You got it perfect! Exec did the trick. Thanks.
I was reading Raycast.lib, and it says USE 1, so I guess I was confused. Thanks for the help. Now to make my own library!