Hi all.
I would have a new function (if not exist already) for the command $mid ... and i suggest to use $midn
So... the function that i suggest is:
$midn(text,S,F)
Returns characters between position S and F in text.
This because... i have a string as: xxxx yyyy zzzz
If i want the part of this string after the first space but before of the second... therefore "yyyy" .... but i don't know how many characters are before and after "yyyy" i must to use $mid and $pos...
In fact the function $mid need S (position to star in text) and N (the number of character)... but i only know that there are 2 space in this string and between which there is mine "yyyy"... therefore i use this command:
set %text xxxx yyyy zzzz
set %pos1 $pos(%text,$chr(32),1) return 5
set %pos2 $pos(%text,$chr(32),2) return 10
set %char $calc(%pos2 -%pos1 -1) return 4 (lengh of yyyy)
set %find $mid(%text,%pos1,%char) return yyyy
It's too long!?!?!?!?!
It's possible to implement this new function? $midn
Bye bye!!
P.S. If someone have another idea to resolve my problem i'll be happy for discussing of this