Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


How are arrays created and changed in size

How are arrays created and changed in size

How are arrays created and changed in size

Created an array using htc_wn:={} followed by AFILL(htc_wn,"NOT IN USE"). This results in a single cell having the value of "NOT IN USE".

Later in the program the statement "htc_wn:={}" is run again. What affect does the second use of the command have on the initial array? (Blanks out array? Leaves the initial value in place? Reduces the array back to one cell?)

Thanks for the support...


RE: How are arrays created and changed in size

Morning Bill

If you knock up a bit of code like that below it should help explain what is going on.


htc_win := {"hi","there"}  && creates an array with 2 members
? htc_win[1]  && print first member
? htc_win[2]  && print second member
afill(htc_win,"not in use")  && fills both
? htc_win[1]  && print first member
? htc_win[2]  && print second member
? len(htc_win)  && show how many members there are
htc_win := {"bye"}  && wipe out the old array and create a new one
? htc_win[1]  && print first member
afill(htc_win,"in use") && fill the array
? htc_win[1]  && print out the new member
? len(htc_win)  && print the new size

If you are going to declare the array in this manner, you probably want to set its size and initial values in the manner I have above.



Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

RE: How are arrays created and changed in size


Here's a sample that I pulled from one of my programs.

msfile = group of files
aFiles = array

The first line is counting the total elements for the array
The second line creates "aFiles" the array
The third line sorts the files names

Basically puts the file names into an array sorted by alpha

DECLARE aFiles[ADIR(msFile)]
ADIR(msFile, aFiles)

Jim C.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close