ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Maximum value using move

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maximum value using move

    Hello,

    I want to do something like this:

    MOVE '0000000000000000' MYFIELD

    But the Move command only lets me write '00000000'... how can i do this?

  • #2
    Re: Maximum value using move

    are you just going to move all zeros? if so then you can do this...

    MOVE *ZEROS MYFIELD


    you can also do this...

    EVAL MYFIELD = 'STRING TEXT HERE'

    or

    EVAL MYFIELD = *ZEROS
    Your future President
    Bryce

    ---------------------------------------------
    http://www.bravobryce.com

    Comment


    • #3
      Re: Maximum value using move

      Thanks, can i use EVAL eventhough my rpg program is an RPG III ?

      I will use zeros for one field and '999999999' for another one.

      Comment


      • #4
        Re: Maximum value using move

        bigstring = *all'0';

        eval somefield = *HIVAL


        eval somefield = *LOVAL
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: Maximum value using move

          move *all'0' myfield


          I think that is right. its along the lines of what jamie is talkin about. but his won't work as is in RPG III. that is a /free way of doing it.

          I am correct right? /free is only ILE?
          Your future President
          Bryce

          ---------------------------------------------
          http://www.bravobryce.com

          Comment


          • #6
            Re: Maximum value using move

            Ok, yes, JaimieF replies are for RPG ILE... the one from you Bryce is adecuated to RPG III, thanks a lot to both for the quick response!

            Comment


            • #7
              Re: Maximum value using move

              Originally posted by bryce4president View Post
              move *all'0' myfield


              I think that is right. its along the lines of what jamie is talkin about. but his won't work as is in RPG III. that is a /free way of doing it.

              I am correct right? /free is only ILE?
              You are correct that /free is only allowed in RPG-IV (aka RPG-ILE). However, the MOVE command will work in fixed-format. MOVE is not allowed in free-format

              Comment


              • #8
                Re: Maximum value using move

                good to know. i think i want to start programming in free, but the other two guys in the office only code in fixed format, and the one will NEVER change.
                Your future President
                Bryce

                ---------------------------------------------
                http://www.bravobryce.com

                Comment


                • #9
                  Re: Maximum value using move

                  Originally posted by bryce4president View Post
                  good to know. i think i want to start programming in free, but the other two guys in the office only code in fixed format, and the one will NEVER change.
                  Just tell your co-workers that America is the "Land of the Free" and if they still ague ask to see their green cards

                  GC
                  Greg Craill: "Life's hard - Get a helmet !!"

                  Comment

                  Working...
                  X