Re: [dev] BASIC Variants, VarType(), and arrays

2010-04-19 Thread Andrew Douglas Pitonyak

On 04/09/2010 08:49 PM, TJ Frazier wrote:
Can I get a little help from someone who knows the code, to confirm my 
experimental observations? Then I can get the documentation updated, 
and fix the BASIC code.


The VarType function can be used on a variant to return the type of 
data therein, as documented. However, when the variant contains an 
array, VarType apparently returns the value x'2000' (decimal 8192) 
plus the "simple" type of the array variables, which is not documented.


What I'm seeing: If a variant is set with the Array function, VarType 
returns a 200C (8204) code, indicating type "variant", which is more 
or less useless. If the variant is set to an existing array:


Dim ai(2) as Integer : ai(0) = 1 : v = ai()

then the VarType returns 2002 (8194), where "2" is the type code for 
"integer". Similarly, explicit string arrays return 2008 (8200). 
Values like these occur in property sets.


This affects the OLH and wiki documentation, and BASIC code on the 
wiki and in the released macro libraries. I'll update the wiki, and 
file issues for the rest, once I'm sure what to say.


This agrees with my observations when I last checked the code Bit 14 
is set for Array types. It can return many different types. I have not 
checked the code in a while, but, last I checked... These types were 
returned.


BASIC VarType TypeName Len Description
yes 0 Empty 0 Variant variable is not initialized
yes 1 Null 0 No valid data in an Object variable
yes 2 Integer 2 Integer variable
yes 3 Long 4 Long Integer variable
yes 4 Single 4 Single floating-point variable
yes 5 Double 8 Double floating-point variable
yes 6 Currency 8 Currency variable
yes 7 Date 8 Date variable
yes 8 String strlen String variable
yes 9 Object 0 Object variable
no 10 Error 2 Internal OOo type
yes 11 Boolean 1 Boolean variable
yes 12 Variant 0 Variant variables act like any type
no 13 DataObject 0 Internal OOo type
no 14 Unknown Type 0 Internal OOo type
no 15 Unknown Type 0 Internal OOo type
no 16 Char 1 Internal OOo type, a single text character
yes 17 Byte 1 Internal OOo type, but you can use CByte to create one
no 18 UShort 2 Internal OOo type, unsigned short integer (16 bits)
no 19 ULong 4 Internal OOo type, unsigned long (32 bits)
no 20 Long64 8 Internal OOo type, long (64 bits)
no 21 ULong64 8 Internal OOo type, unsigned long (64 bits)
no 22 Int 2 Internal OOo type, integer (16 bits)
no 23 UInt 2 Internal OOo type, unsigned integer (16 bits)
no 24 Void 0 Internal OOo type, no value
no 25 HResult 0 Internal OOo type
no 26 Pointer 0 Internal OOo type, pointer to something
no 27 DimArray 0 Internal OOo type
no 28 CArray 0 Internal OOo type
no 29 Userdef 0 Internal OOo type, user-defined
no 30 Lpstr strlen Internal OOo type, long pointer to a string
no 31 Lpwstr strlen Internal OOo type, long pointer to a “Wide” Unicode 
string

no 32 Unknown Type 0 Internal core string type
no 33 WString strlen Internal OOo type, “Wide” Unicode string
no 34 WChar 2 Internal OOo type, “Wide” Unicode character
no 35 Int64 8 Internal OOo type, integer (64 bits)
no 36 UInt64 8 Internal OOo type, unsigned integer (64 bits)

Sorry, I don't have time to verify these at the moment, however :-(

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] (Open-Office writer froze up)

2010-04-19 Thread 韩博
Hi, Mel

According to the situation you described, its seems like there are something
wrong with the OpenOffice customer files. Since the normally using
OpenOffice won't break the Application itself but might grab the customer
files in an unexpected status, which could be a problem.

IMHO, move the OpenOffice customer files to somewhere else may solve this
problem. If it works you can remove the customer files you have moved, and
if not, just move the files back. Nothing lost except few minutes.

On windows, customer files I mentioned above are at somewhere like
C:\Documents and Settings\hanbo\Application Data\OpenOffice.org

and on linux, it *MAYBE* at somewhere like
/home/hanbo/.OpenOffice.org

Hope this helps.

Regards,
hanbo

2010/4/17 Melvin Northrop 

>   Sirs:-
>I have the Ubuntu 9.10 on our computers in the computer room. Well I was
> copying something and using Open-Office to paste it, and Open-Office froze
> up, so I force-quited it. Now none of the Open-Offices  work. How can I get
> them to work again? You can E-mail me . You should get my address from
> above. Thanks if you can help me.
>
> Open Office User
>
>   Mel
>
>
>


Re: [dev] Re: Finding code for SvNumberFormatter

2010-04-19 Thread Eike Rathke
Hi Matt,

On Saturday, 2010-04-17 11:36:16 -0400, Matt Needles wrote:

> Thanks, Niklas. I see from these sources where to add the new format
> code, but I can't find where the actual rendering of the formats is
> done. That is, where is the code that creates the output string in the
> specified format? Can you help please?

Niklas answered that already. However, I'm curious what you're up to.
Could you explain a bit, please?

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to the e...@sun.com account, which I use for
 mailing lists only and don't read from outside Sun. Use er...@sun.com Thanks.


pgp9otcBwbaVp.pgp
Description: PGP signature


Re: [dev] Re: Finding code for SvNumberFormatter

2010-04-19 Thread Niklas Nebel

On 04/17/10 17:36, Matt Needles wrote:

Thanks, Niklas. I see from these sources where to add the new format
code, but I can't find where the actual rendering of the formats is
done. That is, where is the code that creates the output string in the
specified format? Can you help please?


SvNumberFormatter::GetOutputString calls 
SvNumberformat::GetOutputString. There are separate variants for strings 
and numbers. Some locale-dependent code is in i18npool.


Niklas

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org