forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Concatenating two characters

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
AjithSivakumar



Joined: 04 Jan 2008
Posts: 14

PostPosted: Tue May 20, 2008 3:36 pm    Post subject: Concatenating two characters Reply with quote

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
View user's profile Send private message
brucebowler
Guest





PostPosted: Tue May 20, 2008 9:21 pm    Post subject: Re: Concatenating two characters Reply with quote

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: 2554
Location: Sydney

PostPosted: Wed May 21, 2008 3:16 am    Post subject: Reply with quote

Why not try :
Code:

IDENTITIY = trim (getenv@('Test')) // '\\Tmp\\File.txt'


Certainly, IDENTITIY should be more than 80 chatacters.

John
Back to top
View user's profile Send private message
AjithSivakumar



Joined: 04 Jan 2008
Posts: 14

PostPosted: Wed May 21, 2008 9:16 am    Post subject: Thank You Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group