forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CAST from System.Object to e.g. INTEGER*4 or CHARACTER*4

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
m.burkhardt



Joined: 02 Sep 2008
Posts: 26

PostPosted: Wed Jun 08, 2011 10:33 am    Post subject: CAST from System.Object to e.g. INTEGER*4 or CHARACTER*4 Reply with quote

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 INTEGER*2, INTEGER*4 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.

Code:

...
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
Back to top
View user's profile Send private message Send e-mail MSN Messenger
alex21



Joined: 20 Apr 2011
Posts: 65
Location: Australia

PostPosted: Fri Jun 21, 2019 6:04 am    Post subject: Reply with quote

I replied to your other issue as well and have made a more recent post with the example source code hosted on github: http://forums.silverfrost.com/viewtopic.php?t=4025
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group