Hi Brian,
macro dim_arraytype(ty,va,y,x ityp,ivar)
Are ityp and ivar something like MACROTEMPs? If so, what determines them as such? 3 spaces with no comma?
Yes, they are the equivalent of MacroTemp. Any unused terms in the macro header will be renamed with a unique symbol, so they are not identifiable outside the macro.
In this form of macro header, commas are not significant, but there should be one after the x, for consistency.
Also, another issue i am having is the freedom of syntax. As things are now, Its a double edged sword, because i dont know if we are talking about a language or another, and the code needs to be interpreted every time. Is it correct? Is it oxygen?
Yes, I agree. I think we will eventually arrive at a preferred syntax, which gives the clearest possible expression of BASIC code.
In Oxygen, If i need to get the variable address of the string, would i need to @va[29].s or va[29].@s, will i need another macro for that?
The address of string chars is always
strptr(..), for example: strptr(va[29].s)
This is distinct from the resolved address of the variable
@va, @va[29].s
How would i get the length of the fixed length string?
If the strings are defined as a contiguous 255 character length + null terminated, would i need an extra character for the null or the next string would interfere? I think Oxygen will need to check for either the null character or the max length of 255... not sure if that can be done at higher level. Also i am guessing that passing it to core API functions that require a null terminated string, would cause issues.
len(..) also works for fixed length strings. It counts up to, but not including a null character. It won't tell you the allocated size.
When creating a fixed length string, include the null terminator in your count