[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
CAPE-OPEN • View topic - How to return UNDEFINED

How to return UNDEFINED

Discusses CAPE-OPEN specific middleware and corresponding development kit

Moderator: jasper

How to return UNDEFINED

Postby jrdp » 25 May 2023, 15:48

jrdp
 
Posts: 4
Joined: 12 May 2023, 13:35

Re: How to return UNDEFINED

Postby jasper » 26 May 2023, 13:10

The definition you see is for passing as input argument. As output argument - I suppose the easiest it so call .clear() on the passed output argument itself - UNDEFINED for a string value equals an empty string.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: How to return UNDEFINED

Postby jasper » 26 May 2023, 13:11

What is the context in which you are returning UNDEFINED? Which function is it?
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: How to return UNDEFINED

Postby jrdp » 30 May 2023, 13:41

This question arose whilst working on implementing the GetPresentPhases function of the ICapeThermoMaterial interface. The overall context is implementing a Modelica-CAPE-OPEN interface for Dymola.
jrdp
 
Posts: 4
Joined: 12 May 2023, 13:35

Re: How to return UNDEFINED

Postby jrdp » 30 May 2023, 16:15

Regarding this particular function, GetPresentPhases, its parameters are CapeArrayString and CapeArrayEnumeration<CAPEOPEN_1_2::CapePhaseStatus>, so there is no clear()-function available. Would a resize(0) on the output parameters comply with the specification of the function?
jrdp
 
Posts: 4
Joined: 12 May 2023, 13:35

Re: How to return UNDEFINED

Postby jasper » 05 June 2023, 06:02

Yes - UNDEFINED for arrays is an empty array. Indeed resize(0) will do the trick.
User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain


Return to CAPE-OPEN Binary Interop Architecture

Who is online

Users browsing this forum: No registered users and 1 guest

cron