cancel
Showing results for 
Search instead for 
Did you mean: 

Getting a decimal variable from OLEObject

former_member329524
Active Participant
0 Kudos

Hello, all

Does anyone know how to handle this problem.

I have a .NET component, which is COM visible.

PB classic connects to it and executes all functions without a problem.

However, when it tries to access variable of type System.Decimal it cannot convert it to PB decimal. or to any other PB variable type.

Trying to convert it to string by using string ls_price = string(ole_res.price) returns empty string.

Any idea how to get to the System.Decimal ?

Thank you

Arcady

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Decimal is not as standard as Double or other numeric data types and each language may have a different implementation.

So COM and .NET and also powerscript don't share the same representation of Decimal.

In .NET System.Decimal is a structure with methods with ComVisibleAttribute set to True.

So are you able to call it's methods, do you see it's methods in the COM browser?

You might be able to call it's ToString() function and then convert it further into powersctipt Decimal.

Ben