Hello, I know I have posted an simillar topic and I'am annoying! But need strongly help. Here are more Information!
I want to Cast an .NET System.Object to Fortran Datatypes like INTEGER2, INTEGER4 or CHARACTER*?
The INTEGER value I must receive is 1 but if I print the Value after 'transfer' Function it looks like 32123455. The CHARACTER Value should be '28VA1' but after print I see binary character.
I think I get a pointer from the DOTNETGetObjectValue(nIndex) Method.
...
OBJECT('System.Object[]') :: oR
OBJECT('System.Int32') :: nResult
OBJECT('System.String') :: sString
INTEGER*4 VALUE
CHARACTER*10 STR
oR = NEW@('System.Object[],2)
! Get Object and want to Cast to Integer*4
oR(1) = DOTNETGetObjectValue(1)
! CAST ????
nResult = CAST@(oR(1), 'System.Int32')
VALUE = transfer(nResult ,VALUE)
print *,VALUE
! Get Object and want to Cast to CHARACTER*6
oR(2) = DOTNETGetObjectValue(2)
! CAST ????
sString = CAST@(oR(2), 'System.String')
STR = transfer(sString,STR)
print *,STR
So what can I do! I need strongly help please!
Greetings from Germany Michael