Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use of arrays 1

Status
Not open for further replies.

chriisb

Programmer
Mar 13, 2003
28
US
i'm trying to learn visual basic 6, and i was trying to construct a program in which i would need to check for the collision of a bouncing ball with a large number of pictures. if i stored the names of each picture.Top and .Left in an array, would it be possible for me to write a code to cycle through the array and check each picture.Top for the collisions? I could get the program to produce the name "picture2.Top" or whatever from the array, but i couldn't get it to then check for the position, it just stored the "picture2.Top" as a string and would not manipulate it. Any help on this would be greatly appreciated.
 

First of all declare you variable as a number, such as Integer, Long, Single, or Double. Then you would do an assignment like
[tt]
MyIntegerVariable = Picture1.Top
[/tt]
or in your case as an array
[/tt]
MyIntergerVariable(1) = Picture1.Top
[/tt]
Notice that there are no quotes around Picture1.Top

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top