Welcome to iraf.net Friday, May 10 2024 @ 08:34 AM GMT


 Forum Index > Help Desk > Systems New Topic Post Reply
 string conversion of INDEF-valued real
   
Jason Quinn
 06/24/2008 07:20PM (Read 2790 times)  
+++++
Active Member

Status: offline


Registered: 04/07/2006
Posts: 175
real tmpx=INDEF
print("The value is "//str(tmpx))returns: INDEF
expect: The value is INDEF

 
Profile Email
 Quote
fitz
 06/24/2008 07:20PM  
AAAAA
Admin

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

 
Profile Email
 Quote
   
Content generated in: 0.08 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login