ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Array

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

  • Array

    D DS
    D W14 1 1024
    D DIM(1024)

    I set up an array W14 with 1024 elements. I debug my program and only see 500 possible characters in my W14 array. Is there a limitation of 500 characters per array?

    DAC

  • #2
    Re: Array

    DAC,

    Try the (code) and (/code) tags when you post code. Replace the ( with [ and ) with ] in the actual message. They make the source code easier to read

    I *think* the code you posted should look like this

    Code:
    D                 DS                             
    D W14                     1   1024               
    D                                     DIM(1024)

    This will be an array of 1024 elements that are each 1024 characters long.

    There is not a limit of 500 for the elements on the array that I know of. I use many more than 500 all the time. Might be the debugger, what are you using?
    Goodbye

    Comment


    • #3
      Re: Array

      0083.09 D DS
      0083.10 D W14 1 1024
      0083.11 D DIM(1024)


      I did set up the code like that but I am only getting 500 characters in my array. I wonder if it's a limitation of debugger!

      DAC

      Comment


      • #4
        Re: Array

        Hi dcutaia:


        While in debug press f1-help
        page down to RPG Language Examples
        With your cursor on that line press enter
        go down to display an array....press enter
        page down to comments

        Comment: An array reference without subscripts
        displays up to 500 array elements. The
        elements displayed are the first 500
        elements of the array.

        A range of array elements can be displayed
        by entering the subscript as the first
        element of the range, followed by two
        period characters, followed by the last
        element of the range.
        Using your above example
        Code:
         EVAL W14(501..1000)
        will display elements 501-1000

        Best of Luck
        GLS
        The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

        Comment

        Working...
        X