[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Author Index][Subject Index]

empty string (



Dear All,


   bad news first:     there is no empty string in Midas

That is our heritage from the VMS/Fortran days...


So, if you want to replace with the contents of a keyword, you always get at
least one char.

DEFINE/LOCAL ROOT/C/1/180 " " all

until 99NOVpl1.1 or so a completely blank string would yield just one blank

e.g. write/out lola{root}xy
would display:  lola xy


After 99NOVpl1.1 that was changed (on request of the FORS pipeline group btw)
that if all elements are blank the full blank string should be returned.

Thus, now

write/out lola{root}xy
would display:  lola                                                           
                       xy




As I understand now, what you really want is that

WRITE/OUT "file{root}_restofname"
results in 

file_restofname

when root is empty, i.e. only blanks.



This you'll achieve in a Midas procedure via:

if m$len(root) .eq. 0 then
   write/out file_restofname
else
   write/out file{root}_restofname
endif

(the function M$LEN returns 0 if all elements of a char. keyword are blanks)


Good luck,
Klaus Banse