Actually, I assumed it had worked, since the structured variable was created with no errors, and I was able to work with it. (There is an issue about WITH that I will address elsewhere.) If one tries to DIM s AS STRING * 20, for example, a syntax error happens. This does not happen inside a TYPE structure, which shows an inconsistency in the syntax checker.You can not declare a variable to be of a specified length. At least I have never heard of this. You could use an array of characters, but you can not do that directly by definition inside of your own data types :-( The following line does NOT declare a string of length 4. I might consider the acceptance of this form an error unless it is for some kind of compatibility.
Dim s As String * 4
This is the way you do this in VisualBasic. It worked, too, from what I see in the OOo Macro Variable Watch window.
So, which one of us is the optimist :-)
I assumed that it did not work because of the following behavior:
Dim s As String * 4 Print Len(s) REM Prints 0 s = "abced" Print Len(s) REM Prints 5
Yes, I found the same thing. This is not how Len() is supposed to work, or at least not how it works in any flavor of MS Basic. Len returns the actual number of bytes occupied by the variable, no matter what its type. Is there a SizeOf function in OOo Basic that I could use, then?
I am not aware of a "SizeOf" method. An RFE should probably be filed. I doubt if they will support this for all cases, even if they do implement it.
Thanks, I'll do that for sure. This is not the way this function is supposed to work.
Given that VB works in a different way, your RFE is likely to have a higher priority.
-- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm Free Info: http://www.pitonyak.org/oo.php
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
