Welcome to iraf.net Tuesday, May 21 2024 @ 08:05 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 script variables
   
sw
 04/09/2008 06:13PM (Read 1684 times)  
++---
Junior

Status: offline


Registered: 11/03/2007
Posts: 15
Hi,Hopefully this will be an easy question to answer if nobody minds taking a few minutes to read. I'm writing a little IRAF script and have a little problem, which essentially boils down to the following.I have the variables [i:260cd3ad7a]image[/i:260cd3ad7a] and [i:260cd3ad7a]coofile[/i:260cd3ad7a]. I have set image to be [i:260cd3ad7a]sa95.fits[/i:260cd3ad7a] and want coofile to be [i:260cd3ad7a]sa95.fits.coo[/i:260cd3ad7a] , with the sa95.fits part coming from the [i:260cd3ad7a]image[/i:260cd3ad7a] variable and the .coo bit being just text. Basically, my question is how do I set the value of a variable to be that of another variable, plus some text?[code:1:260cd3ad7a]
string image
string coofileimage = "sa95.fits"coofile = image #want this to be image.coo[/code:1:260cd3ad7a]Thanks a lot!Sam

 
Profile Email
 Quote
fitz
 04/09/2008 06:13PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Try:[code:1:011c9a986f]
image = "sa95.fits"
coofile = image // ".coo"
[/code:1:011c9a986f]The '//' is a string concatenation operator.-Mike

 
Profile Email
 Quote
sw
 04/09/2008 06:13PM  
++---
Junior

Status: offline


Registered: 11/03/2007
Posts: 15
Brilliant, thanks Mike!!You were quicker than a speeding bullet. I should have posted here straight away instead of spending hours reading manuals from 1982!!

 
Profile Email
 Quote
   
Content generated in: 0.10 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