<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.5726" name=GENERATOR></HEAD>
<BODY><!-- Converted from text/plain format -->
<P><FONT color=#0000ff>Hi Leen,<BR><BR>I think you mean to write your if-test as
follows:</FONT></P>
<DIV><FONT size=2> <FONT face="Courier New"> IF(Q.lt<FONT
color=#ff0000>.</FONT>0-0.05.AND.T.eq.1.AND.G.eq.2)THEN</FONT></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT color=#0000ff>
<DIV><FONT color=#0000ff>(note that the 'lt' comparison operator should
be terminated with a '.'. I think this is probably the source of your
error.)</FONT></DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV><FONT color=#0000ff>In this case, '0' is a integer, and you're relying the
compiler to implicitly cast it as a real. Most compilers will do this reliably,
but it's better to retype your '0' as a real:</FONT></DIV></FONT></DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV> <FONT size=2><FONT face="Courier New">IF (
</FONT></FONT><FONT size=2><FONT face="Courier New">Q .lt. (0.-0.05)
.AND.</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face="Courier New"> & T
.eq. 1 .AND.</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face="Courier New"> & G
.eq.
2
) THEN</FONT></FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT size=2><FONT color=#0000ff size=3>If you're not working with legacy
code, please consider using clear variable names so that other developers do not
need to guess at the meaning of 'Q', 'T' and 'G'. Hungarian notation can make
the type of variables even clearer; when I first read your question, I
assumed T must be temperature and therefore a real. You might use a convention
like the following:</FONT></FONT></DIV>
<DIV><FONT color=#0000ff></FONT> </DIV>
<DIV><FONT face="Courier New">Q -> fQHeatFlux</FONT></DIV>
<DIV><FONT size=2><FONT face="Courier New" size=3>T -> iType
</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face="Courier New" size=3>G ->
iGSomeOtherName</FONT></DIV><FONT color=#0000ff size=3>
<P><FONT color=#0000ff size=3>It seems a little pedantic at first, but I find
that once you adapt to Hungarian notation, it's har</FONT><FONT color=#0000ff
size=3>d to keep your types straight without it!</FONT></P>
<P>Finally, the developer's list is probably a better forum for questions like
these. Let me know if you have trouble posting to it.</P>
<P><FONT color=#0000ff size=3>Cheers,</FONT></P></FONT>
<DIV><FONT color=#0000ff size=3>- Alex</FONT></DIV>
<P><FONT color=#0000ff size=3></FONT><!-- Converted from text/rtf format --></P>
<P align=left><B><SPAN lang=en-us><FONT face="Times New Roman">Alex
Ferguson</FONT></SPAN></B><SPAN lang=en-us><BR><FONT
face="Times New Roman">Sustainable Buildings and Communities (Housing
Group)<BR>CanmetENERGY<BR>Natural Resources Canada<BR>P:+1 613 995 3294<BR>F:+1
613 996 9909<BR><A
href="mailto:Alex.Ferguson@NRCan-RNCan.gc.ca">Alex.Ferguson@NRCan-RNCan.gc.ca</A><BR></P>
<P></FONT></SPAN><FONT color=#0000ff size=3></FONT><BR><BR>-----Original
Message-----<BR>From: esp-r-bounces@lists.strath.ac.uk [<A
href="mailto:esp-r-bounces@lists.strath.ac.uk">mailto:esp-r-bounces@lists.strath.ac.uk</A>]
On Behalf Of Leen Peeters<BR>Sent: March 5, 2009 16:38<BR>To:
esp-r@lists.strath.ac.uk<BR>Subject: [esp-r] invalid type
combination<BR><BR>Dear,<BR><BR>going through the debugger I get the following
message<BR><BR><BR>invalid type combination in ordering
comparison<BR><BR><BR>when evaluating a case
like<BR><BR>IF(Q.lt-0-0.05.AND.T.eq.1.AND.G.eq.2)THEN<BR><BR>where Q is a real
and T and G are integers<BR><BR><BR>Can anyone explain me why?<BR>I does not
seem to help to add brackets around the value
-0.05...<BR><BR>Leen<BR>Disclaimer: <A
href="http://www.kuleuven.be/cwis/email_disclaimer.htm">http://www.kuleuven.be/cwis/email_disclaimer.htm</A><BR><BR><BR>_______________________________________________<BR>esp-r
mailing list<BR>esp-r@lists.strath.ac.uk<BR><A
href="http://lists.strath.ac.uk/mailman/listinfo/esp-r">http://lists.strath.ac.uk/mailman/listinfo/esp-r</A><BR></P></FONT></BODY></HTML>