Use arrays in CODE resources
This is an open request for anyone who can help. The problem is that the FB compiler won't allow arrays in a WDEF code resource that I'm writing.
It turns out that the snippet below compiles properly without the RESOURCES statement, but as soon as I put the RESOURCES statement back in, I get the array error message. Here is a code snippet. (By the way, you don't need to have the resource file available to see the error message. If anyone needs the file, you can use a copy of the "Windoid WDEF.rsrc" file in the "WDEF Folder" inside the Examples folder.)
My WDEF's structure is copied from the WDEF that is supplied with FB. Thus the LONG FN and the use of a "global".
OUTPUT FILE "TestArray.rsrc"
LONG FN TestArray
Right. There's no way to do it. You'll have to create and manage an array some other way.
For example, you could create a pointer block and use accessor functions:
_gTestSize = 4
LOCAL FN InitGTest
gTestPtr& = FN NEWPTR(11 * _gTestSize) '11 elements, 4 bytes per element
LOCAL FN GetGTest(item%)
END FN = [gTestPtr& + (item% * _gTestSize)]
LOCAL FN SetGTest(item%, value&)
& gTestPtr& + (item% * _gTestSize), value&