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

Home » Public Forums » archive » strmid()
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
strmid() [message #46925] Wed, 11 January 2006 06:09
Liberum is currently offline  Liberum
Messages: 48
Registered: September 2005
Member
Hi everyone,

Can someone check this out and explain it to me becuase I don't get it
at all:
**********************************************
a = "some_ordinaryfile.h5"
IDL> print, strmid(a,0,2,/reverse_offset)
5
IDL> print, strmid(a,0,3,/reverse_offset)
5
IDL> print, strmid(a,0,1)
s
IDL> print, strmid(a,0,2)
so
IDL> print, strmid(a,0,3)
som
IDL>
Now according to the instruction book the keyword: REVERSE_OFFSET
forces IDL to start counting from the end of the file so it should work
like this:
print, strmid(a,0,2,/reverse_offset)
h5
print, strmid(a,0,3,/reverse_offset)
.h5
but it doesn't. why ???
*******************************
At first I played around untilI found something that worked:
IDL> print, strmid(a,2,4,/reverse_offset)
.h5
which implies that the string is 2 characters longer but then when I
did this:
IDL> print, strmid(a,0,1,/reverse_offset)
5
This proves that the string is not longer. What is the logic behind
this?
Anyone, anyone!!

Sincerely,
Sheldon
IDL> print, strmid(a,2,4,/reverse_offset)
.h5
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Encapsulating IDL snippets into objects
Next Topic: Changing the title of a postscript output file

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

Current Time: Wed Oct 08 18:07:38 PDT 2025

Total time taken to generate the page: 0.00571 seconds