X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 07 Mar 2006 03:40 PM by  anon
IDL string() function
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
07 Mar 2006 03:40 PM
    I have what seems like it should be a simple problem, when I use the string() function in this line: STRING(j + 1,'.bmp') where j is an integer, i get spaces before the filename created, so that it is in a form: ****1.bmp, where the * is a space. is there a quick way to get rid of these spaces or do I have to convert j from an integer to a character and use the character in the function?

    Deleted User



    New Member


    Posts:
    New Member


    --
    07 Mar 2006 03:40 PM
    I really dont know answer about your question! I have one question to you! I have IDL Virtual Machine 6.2, and I need to restore IDL sav files! can you help me?

    Deleted User



    New Member


    Posts:
    New Member


    --
    07 Mar 2006 03:40 PM
    Although there are several IDL language options, I think the most traditional solution for this problem you pose, is to wrap all integers and integer-type variables in IDL's STRTRIM function. For example: myfilename = strtrim(j + 1, 2) + '.bmp' The '2' argument at the end means strip off BOTH leading blank's and trailing blank's. STRTRIM is needed because IDL has very specific default formats for number-to-string conversions, default formats that include leading blank spaces. James Jones
    You are not authorized to post a reply.