Contents
Index 🔎︎

# CreateUnoValue Function

Uno 유형 시스템을 참조하는 정확하게 입력한 값을 나타내는 개체를 구합니다.

이 개체는 Uno에 전달될 때 해당 유형의 Any로 자동 변환됩니다. 유형은 전체 Uno 유형 이름으로 지정해야 합니다.

LibreOffice API는 Any 유형을 사용합니다. 이것은 다른 환경에서 알려진 Variant 유형의 상대 유형입니다. Any 유형은 임의의 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.