Liberty BASIC Community Forum
« Arrays »

Welcome Guest. Please Login or Register.
Jan 20th, 2018, 10:57am

Rules|Home|Help|Search|Recent Posts|Notification

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Arrays  (Read 183 times)
Dan Teel

member is offline


Homepage PM

Gender: Male
Posts: 1130
xx Arrays
« Thread started on: Jun 27th, 2017, 02:20am »

I'd like to be able to pass an array to a sub/function like so

dim PeopleAges(100)
dim DogAges(100)

for i=1 to 100
next i

call printAges PeopleAges()
call printAges DogAges()

sub printAges ages()
 for i = 1 to 100
   print ages(i)
 next i
end sub

This gives the programmer more flexibility. And it would be super nice to have a function that would give me the current size of an array.

 for i = 1 to arrayLen(PeopleAges)
  print PeopleAges(i)
next i

I also wish that you can define the scope of an array, instead of them always being global.
« Last Edit: Jun 27th, 2017, 3:40pm by Dan Teel » User IP Logged
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls