ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Movea

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

  • Movea

    In free formatted RPG, what is the equivalent statement to this:
    /End-Free
    C MOVEA D14A OFF
    /Free

    D14A represents an array that is 102 characters long. I am moving the array to a field that is also 102 long that is a precursor to writing the information to a file.

    When I try this statement

    Off = D14A;
    RECONP5VX = Off;

    I get this error:
    *RNF5343 30 2 Array has too many omitted indexes; specification is ignored.

  • #2
    Re: Movea

    There is no direct conversion. Look into using %subarr()

    Comment


    • #3
      Re: Movea

      Data structures are a way to simulate the function, but there is no direct replacement:
      Code:
      D                 DS                                                
      D   TestString                  25                                  
      D   TestArray                    1    OVERLAY(TestString:1) DIM(25) 
      D MyArray         S              1    DIM(25)                       
                                                                                                                        
       /FREE                                        
        MyArray(1) = 'A';                           
        MyArray(2) = 'x';                           
        MyArray(3) = 'B';                           
        MyArray(4) = 'Q';                           
        MyArray(5) = 'W';                           
        MyArray(6) = 'E';                           
        MyArray(7) = 'R';                           
                                                    
        TestArray = MyArray;                        
        DSPLY TestString;                           
                                                    
        RETURN;                                     
                                                    
       /END-FREE
      Last edited by KenM; November 12, 2007, 03:44 PM. Reason: Fixc bad code. Shouldn't try to code from memory.
      Goodbye

      Comment


      • #4
        Re: Movea

        movea is equal to myarray1 = myarray2....
        I'm not anti-social, I just don't like people -Tommy Holden

        Comment

        Working...
        X