Welcome to iraf.net Friday, May 10 2024 @ 08:34 AM GMT
Jason Quinn |
06/24/2008 07:20PM (Read 2790 times)
|
|
|
Status: offline
Registered: 04/07/2006
Posts: 175
|
real tmpx=INDEF
print("The value is "//str(tmpx))returns: INDEF
expect: The value is INDEF
|
|
|
|
fitz |
06/24/2008 07:20PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
The '//' is a binary operator and as a rule expressions involving an INDEF operand are not allowed, so what you're seeing is that the result of concatenating a string with an INDEF is itself an INDEF value. In v2.14 you can use the isindef() builtin to test for this, e.g.[code:1:c254c39034]
if (isindef (foo)) {
print ("value is INDEF")
} else {
print ("value is " // foo)
}
[/code:1:c254c39034]Alternatively, use printf() instead:[code:1:c254c39034]
ecl> x = INDEF
ecl> printf ("value is %s\n\n", str(x))
value is INDEF
[/code:1:c254c39034]Cheers,
-Mike
|
|
|
|
| |
|
Content generated in: 0.08 seconds |
|