Error XS0173 Type of IIF expression cannot be determined

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1865
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Error XS0173 Type of IIF expression cannot be determined

Post by ic2 »

Consider this line:

Code: Select all

cAttachPath := Iif(Self:lEWMvalid, Self:oMailSends:oEWM:cSaveAttachmentPath, "")


This gives:

Error XS0173 Type of IIF expression cannot be determined because there is no implicit conversion between '?' and 'string'

What's actually happening here is that oEWM was not declared (outcommented from converted code) within the class assigned to variable Self:oMailSends.

I can imagine some logic in the error message but it would be a lot clearer if the compiler could directly tell that it can't find oEWM. Maybe warning XS9073? The tooltip says Undeclared.

Dick
User avatar
Chris
Posts: 4986
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Error XS0173 Type of IIF expression cannot be determined

Post by Chris »

Hi Dick,

What is oMailSends declrared as?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1865
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Error XS0173 Type of IIF expression cannot be determined

Post by ic2 »

Hello Chris,

This is a class which opens emails.dbf, reads the account data from a setting file and more using a set of protected variables.

In the VO version we have the class variables include oEWM which is a reference to a splitwindow in which we show the mails. This is (yet) not defined in X#. SO I just wondered why the compiler doesn't directly tell me that oEWM is unknown within this line of code.

Dick
User avatar
Chris
Posts: 4986
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Error XS0173 Type of IIF expression cannot be determined

Post by Chris »

Hi Dick,

I meant how is the iVar "oMailSends" itself defined? What is the exact line of code where it is declared?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1865
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Error XS0173 Type of IIF expression cannot be determined

Post by ic2 »

Hello Chris,

Like this:

Code: Select all

oEmailForm := NewEmail{Self, oCKEmail, cFromAccount, cSendType, lEverything, cRecordList}
oEmailForm:Show()

.......

Public Constructor(oCaller As MailSends, oInEmail As Chilkat.Email, cFromAccount As String, cSendType As String, lEverything As Logic, cRecordList As String) Strict Class NewMail
InitializeComponent()
Self:oMailSends := oCaller

Dick
User avatar
robert
Posts: 4567
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Error XS0173 Type of IIF expression cannot be determined

Post by robert »

Dick,
Chris wants to know how the instance variable oMailSend is defined.
Like:

Code: Select all

EXPORT oMailSends as MailSends
or

Code: Select all

EXPORT oMailSends as OBJECT
If oMailSends is declared AS OBJECT then the compiler does know that oEWM is a commented out property of the MailSends class.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
ic2
Posts: 1865
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Error XS0173 Type of IIF expression cannot be determined

Post by ic2 »

Hello Robert,

Ah, of course. Like this:

PROTECTED oMailSends AS MailSends

I would say the compiler should then see & tell that oEWM is not defined in MailSends.

It's not a big deal but that error would have been a lot clearer.

Dick
Post Reply