Welcome to iraf.net Tuesday, May 21 2024 @ 08:05 PM GMT
sw |
04/09/2008 06:13PM (Read 1684 times)
|
|
|
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
|
|
|
|
fitz |
04/09/2008 06:13PM
|
|
|
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
|
|
|
|
sw |
04/09/2008 06:13PM
|
|
|
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!!
|
|
|
|
| |
|
Content generated in: 0.10 seconds |
|