Menu

SET $EXTRACT

Developers
Pawel Krul
2000-10-17
2001-03-23
  • Pawel Krul

    Pawel Krul - 2000-10-17

    Hallo everybody,
    I am very positiv impressed by GT.M, but there is something which I painfully miss, I have stated.
    Why can $EXTRACT not appear on the left hand side of the equal sign, just like $PIECE can?
    Isn't this a sub-interpretation of the ANSI-Standard?
    I have very often used this notation (in MSM), because it allows to program certain string manipulations quickly and efficient, without the need of additional assignments and/or concatenations.
    For example:
    assume ^X(1)="aaa^ABCxyz12356^ll",^X(2)="bb^LMNxzy999^zzz",...etc.
    and now I will simply cut away the columns 4 to 6:

    in MSM:
    S I="" F  S I=$O(^X(I)) Q:I=""  S $E(^X(I),4,6)=""

    this same in GT.M:
    S I="" F  S I=$O(^X(I)) Q:I=""  S ^X(I)=$E(^X(I),1,3)_$E(^X(I),7,$L(^X(I))

    Is there the possibility to extend the notation of $E as a target for a SET command?

    Regards
    Pawel Krul

     
    • K.S. Bhaskar

      K.S. Bhaskar - 2000-10-17

      Pawel --

      Thank you for your kind words.

      As you note, $E on the left side of an assignment is not currently a feature of GT.M.  It is unlikely that Sanchez will implement this in the near future because this has so far not been important to our own banking application, PROFILE.  Of course, things may change tomorrow...

      Part of our objective in releasing GT.M is to contribute something that the M community will find useful.  We would like to work with anyone who would like to extend GT.M -- in fact, we are currently running a workshop in Malvern on building & testing GT.M.  So, if this is a task that you (or anyone else) would like to undertake when the source code is actually released, we would be glad to help you plan the work, and offer constructive suggestions.

      For now, I will add a project (see under Tasks) to extend GT.M to the 1995 M standard, and I will add this as a task there for now.

      -- Bhaskar

       
      • K.S. Bhaskar

        K.S. Bhaskar - 2001-03-23

        V4.2-FT14 is a field test version that supports Set $Extract.  Please download it and test it.  Thanx.

        -- Bhaskar

         

Log in to post a comment.