|
-
May 16th, 2000, 09:16 PM
#1
Thread Starter
Frenzied Member
I'm trying to write a Class Module that will work in a For Each Loop, ie
Code:
Dim objMyClass as New clsMyClass
Dim i as Variant
For Each i in objMyClass
MsgBox i
Next i
It's not a normal collection type thing (Actually I want it to define an elipse and the For each loop to go through every pixel on the border of that ellipse) How can I get this to work without having to have a collection inside my class (Filling a collection with all the points would be a huge waste of memory) I don't mind a bit of V-Table jiggery Pokery, any hints at all would be great.
-
May 17th, 2000, 02:04 AM
#2
transcendental analytic
AFAIK, For each just works with objects, so you need to put a second object of another class to act as that object. Then have the items all refering to the same object, with property get/set
But for this i would use for next instead and have the points in a simple property get/let to calculate the points, but i don't know if you actually need it to be an object.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 17th, 2000, 01:43 PM
#3
Hyperactive Member
For each... only works with collections.
Try it out with the classbuilder wizard, create a collection class, and a class of the type you created the collection for. The wizard automatically adds code for a for each loop
-
May 17th, 2000, 07:20 PM
#4
transcendental analytic
Not really, you can use with variable arrays too, we've discussed this out so don't bother anymore
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 17th, 2000, 11:37 PM
#5
Hyperactive Member
you could do the math. I have it at home if you don't mind waiting about 8 hours till school's out. It's using the sin of the x and y to PSet a point on the picture box (you have to add stuff like (this is off the top of my head, here):
Code:
For i = 1 to 360 step .1
x = 2000+(300 * Sin (500 * i))
y = 2000+(150 * Sin (500 * i))
Next i
bob
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|