comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » concatenating strings
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: concatenating strings [message #85702 is a reply to message #85695] Wed, 28 August 2013 14:58 Go to previous messageGo to previous message
kagoldberg is currently offline  kagoldberg
Messages: 26
Registered: November 2012
Junior Member
> So the leading spaces are created by the 'caldat' function when it outputs the variables, right?
This is not correct. The mon, day, year values are numbers, not strings, so they have no inherent spaces. The leading spaces are inserted when you convert them to strings without specifying a formatting for string() to use.

You could choose to format them like this
string(year, FORMAT='(i4.4)') + string(mon, FORMAT='(i2.2)') + string(day, FORMAT='(i2.2)') or
string(year, mon, day, FORMAT='(i4.4,i2.2,i2.2)')

the code "i2" means you want an integer that has 2 digits (including possible leading space), and the ".2" means to pad single digit results with leading zeros to make the number always have 2 digits. Similar for the "i4.4"
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: What subprogram? What parameters and keywords?
Next Topic: Emacs IDLWAVE

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Tue Dec 02 09:25:11 PST 2025

Total time taken to generate the page: 0.08156 seconds