replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Silverfrost .NET abstract/interface typed arguments?
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 

Silverfrost .NET abstract/interface typed arguments?

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



Joined: 20 Apr 2011
Posts: 75
Location: Australia

PostPosted: Sun Aug 04, 2013 11:39 pm    Post subject: Silverfrost .NET abstract/interface typed arguments? Reply with quote

Hello,

I am trying to write a function a bit like the one below.

Code:

FUNCTION GetPropertyUnitGroupName(model, property)
        OBJECT("Domain.UnitBaseModel"), INTENT(IN) :: model
        CHARACTER(LEN=*), INTENT(IN) :: property
        CHARACTER :: GetPropertyUnitGroupName
        OBJECT("Domain.Units.UnitGroup") :: unitGroup
        unitGroup = GetPropertyUnitGroup(CAST@(model, "Domain.UnitBaseModel"), STRING@(property))
        GetPropertyUnitGroupName = CHAR(unitGroup%Name)
END FUNCTION GetPropertyUnitGroupName


However when trying to use it as such.

Code:

GetPropertyUnitGroupName(Input%IrrigationData, "PumpMinimum")


I get error messages like this.

"In the INTERFACE to GETPROPERTYUNITGROUPNAME (from MODULE MODDOMAIN), the first dummy argument (MODEL) was of type OBJECT('Domain.UnitBaseModel'), whereas the actual argument is of type OBJECT('Domain.Input.IrrigationInfrastructure')"

So I was wondering if there is anyway I can fix my function to be able to take a more generic first parameter without having to call CAST@() every time I call it?

Also what is the easiest way to get around not being able to pass .NET arrays as arguments to functions?

Thanks,
Alex.
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