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

Home » Public Forums » archive » Re: Convert Integer to Text
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: Convert Integer to Text [message #25059 is a reply to message #25058] Sun, 13 May 2001 15:06 Go to previous messageGo to previous message
m.hadfield is currently offline  m.hadfield
Messages: 36
Registered: April 2001
Member
From: "Emmler, Oliver" <Oliver.Emmler@med.uni-heidelberg.de>


> I want to convert Interger to Text to produce indexed filenames.
> Is there any help ?
>
> Files are like this:
>
> MC023.dcm
> MC024.dcm
> MC025.dcm
>
> I want to set up like: 'MC'+text+'.dcm'

Use formatted output. The "In.n" format descriptor will produce a string n
characters wide, padded with zeros.

You can add the prefix and suffix via the "+" operator like this...

name = 'MC'+string(index,format='(I3.3)')+'.dcm'

or within the format specifier like this...

name = string(index,format='("MC",I3.3,".dcm"')'

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research



--
Posted from clam.niwa.cri.nz [202.36.29.1]
via Mailgate.ORG Server - http://www.Mailgate.ORG
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Determining circularity
Next Topic: Can't READ_DICOM without DIALOG_PICKFILE

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

Current Time: Sat Oct 11 11:50:06 PDT 2025

Total time taken to generate the page: 0.48639 seconds