Loading ...
Sorry, an error occurred while loading the content.

how do u print an array's contents

Expand Messages
  • rhynodfox
    G day programmers, my name is ryan and i m relatively new at programming with liberty basic. i have formed an array consisting of 20 names, and i can t work
    Message 1 of 3 , Aug 1, 2002
    • 0 Attachment
      G'day programmers,

      my name is ryan and i'm relatively new at programming with liberty
      basic. i have formed an array consisting of 20 names, and i can't
      work out how to print the contents of the array. This problem is has
      got me baffled, sorry for my ignorance, but if you have an answer
      please e-mail me, thankyou,

      yours in programming, ryan.
    • AW
      ... To print to the mainwindow: for i = 1 to 20 print array$(i) next i To print to the printer: for i = 1 to 20 lprint array$(i) next i dump To print to a
      Message 2 of 3 , Aug 1, 2002
      • 0 Attachment
        At 10:26 AM 8/1/02 -0000, you wrote:
        > G'day programmers,
        >
        > my name is ryan and i'm relatively new at programming with liberty
        > basic. i have formed an array consisting of 20 names, and i can't
        > work out how to print the contents of the array. This problem is has
        > got me baffled, sorry for my ignorance, but if you have an answer
        > please e-mail me, thankyou,


        To print to the mainwindow:

        for i = 1 to 20
        print array$(i)
        next i

        To print to the printer:

        for i = 1 to 20
        lprint array$(i)
        next i
        dump

        To print to a texteditor:

        for i = 1 to 20
        print #win.texted, array$(i)
        next i



        Regards,
        Alyce





        .
      • Chergarj@cs.com
        In a message dated 08/01/2002 3:26:54 AM Pacific Daylight Time, ... Basically, if you want to print each element ONE time, you will want to know how many
        Message 3 of 3 , Aug 1, 2002
        • 0 Attachment
          In a message dated 08/01/2002 3:26:54 AM Pacific Daylight Time, rhynodfox@... writes:
          and i can't
          work out how to print the contents of the array


          Basically, if you want to print each element ONE time, you will want to know how many elements you have first.

          ****
          Dim ra$(100)  ' maybe you need fewer elements than 100
          ' more code to build or fill the array, usually to fill it.

          ' lets say you have m elements filled into your ra$()
          prompt "how many elements do you want to see?"; m

          for i = 1 to m
          print ra$(i)
          next i

          END
          ****

          The exact context helps in deciding how all this is to be done.   Which book are you using to learn from?

          G C
        Your message has been successfully submitted and would be delivered to recipients shortly.