CreateUnoValue Function

рд╡рд╕реНрддреБрдорд╛ рдлрд░реНрдХрд╛рдЙрдБрдЫ рдЬрд╕рд▓реЗ рдХрдбрд╛рдЗрдХрд╛ рд╕рд╛рде рдЯрд╛рдЗрдк рдЧрд░реЗрдХреЛ рдорд╛рди Uno рдкреНрд░рдХрд╛рд░ рдкреНрд░рдгрд╛рд▓реАрд▓рд╛рдИ рд╕рд╛рдиреНрджрд░реНрднрд┐рдд рдЧрд░реНрди рдкреНрд░рддрд┐рдиреАрдзрд┐рддреНрд╡ рдЧрд░реНрджрдЫ ред

рдЬрдм Unoрдорд╛ рдкрд╛рд╕ рдЧрд░рд┐рдиреНрдЫ рдпреЛ рд╡рд╕реНрддреБ рд╕реНрд╡рдд:рд░реВрдкрдореИ рдХреБрдиреИ рдЕрдиреБрд░реВрдк рдкреНрд░рдХрд╛рд░рдорд╛ рд░реВрдкрд╛рдиреНрддрд░рдг рд╣реБрдиреНрдЫ ред рдпреЛ рдкреНрд░рдХрд╛рд░ рдпрд╕рдХреЛ рдкреВрд░реНрдгрд░реВрдкрдорд╛ рд╕рдХреНрд╖рдо Uno рдкреНрд░рдХрд╛рд░ рдирд╛рдорджреНрд╡рд╛рд░рд╛ рдирд┐рд░реНрджрд┐рд╖реНрдЯ рдЧрд░реНрди рдЬрд░реБрд░рд┐ рд╣реБрдиреНрдЫ ред

рджреНрд░рд╖реНрдЯрд╡реНрдп рдкреНрд░рддрд┐рдорд╛

LibreOffice APIрд▓реЗ рдЬреБрдирд╕реБрдХреИ рдкреНрд░рдХрд╛рд░ рдмрд╛рд░рдореНрдмрд╛рд░ рдкреНрд░рдпреЛрдЧ рдЧрд░рд┐рд░рд╣рдиреНрдЫ ред рдпреЛ рдЕрд░реВ рдкрд░рд┐рдмреЗрд╢рд╣рд░реВрдмрд╛рдЯ рдЪрд┐рдирд╛рдЗрдПрдХреЛ рднрд┐рдиреНрди рдкреНрд░рдХрд╛рд░рдХреЛ рд╕рд╛рдореБрдиреНрдиреЗ рдЦрдгреНрдб рд╣реЛ ред рдХреБрдиреИ рдкреНрд░рдХрд╛рд░рд▓реЗ рдПрдЙрдЯрд╛ рдЕрдирд┐рдпрдиреНрддреНрд░рд┐рдд Uno рдкреНрд░рдХрд╛рд░рд▓рд╛рдИ рд╣реЛрд▓реНрдб рдЧрд░реНрджрдЫ рд░ рдпрд╕рдХреЛ рдЬреЗрдиреЗрд░рд┐рдХ Uno рдЗрдиреНрдЯрд░рдлреЗрд╕рд╣рд░реВрдорд╛ рдкреНрд░рдпреЛрдЧ рд╣реБрдиреНрдЫ ред


Syntax:

oUnoValue = CreateUnoValue( "[]byte", MyBasicValue ) ' to get a byte sequence.

If CreateUnoValue cannot be converted to the specified Uno type, and error occurs. For the conversion, the TypeConverter service is used.

This function is intended for use in situations where the default Basic to Uno type converting mechanism is insufficient. This can happen when you try to access generic Any based interfaces, such as XPropertySet::setPropertyValue( Name, Value ) or X???Container::insertBy???( ???, Value ), from LibreOffice Basic. The Basic runtime does not recognize these types as they are only defined in the corresponding service.

In this type of situation, LibreOffice Basic chooses the best matching type for the Basic type that you want to convert. However, if the wrong type is selected, an error occurs. You use the CreateUnoValue() function to create a value for the unknown Uno type.

You can also use this function to pass non-Any values, but this is not recommend. If Basic already knows the target type, using the CreateUnoValue() function will only lead to additional converting operations that slow down the Basic execution.