View previous topic :: View next topic |
Author |
Message |
AjithSivakumar
Joined: 04 Jan 2008 Posts: 14
|
Posted: Tue May 20, 2008 3:36 pm Post subject: Concatenating two characters |
|
|
Hi,
I am trying to concatenate two characters.
CHARACTER*80 IDENTITY,getenv@
IDENTITIY=getenv@('Test')//'\\Tmp\\File.txt'
When i try to print it , it is showing only the path for the environmental variable. It is not appending \\Tmp\\File.txt
Any help will be appreciated.
Thanks,
Ajith. |
|
Back to top |
|
|
brucebowler Guest
|
Posted: Tue May 20, 2008 9:21 pm Post subject: Re: Concatenating two characters |
|
|
AjithSivakumar wrote: | Hi,
I am trying to concatenate two characters.
CHARACTER*80 IDENTITY,getenv@
IDENTITIY=getenv@('Test')//'\\Tmp\\File.txt'
When i try to print it , it is showing only the path for the environmental variable. It is not appending \\Tmp\\File.txt
Any help will be appreciated.
Thanks,
Ajith. |
Note that IDENTITY is 80 characters long. And you've told the compiler that GETENV@ is supposed to return 80 characters as well. That leaves no room for the rest of your string in IDENTITY...
try doing it in a couple of steps and don't forget to use trim() where it's needed. |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2560 Location: Sydney
|
Posted: Wed May 21, 2008 3:16 am Post subject: |
|
|
Why not try :
Code: |
IDENTITIY = trim (getenv@('Test')) // '\\Tmp\\File.txt'
|
Certainly, IDENTITIY should be more than 80 chatacters.
John |
|
Back to top |
|
|
AjithSivakumar
Joined: 04 Jan 2008 Posts: 14
|
Posted: Wed May 21, 2008 9:16 am Post subject: Thank You |
|
|
Hi All,
Thanks for the help. I have modified the code in the following way and it is working now.
CHARACTER*80 getenv@
CHARACTER*100 IDENTITY
IDENTITY=trim(getenv@('Test'))//'\\Tmp\\File.txt'
Cheers,
Ajith |
|
Back to top |
|
|
|