Forum Moderators: coopster

Message Too Old, No Replies

Class, Function, Switch

called witin a "while"

         

henry0

10:38 pm on Mar 23, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a class, with a function that contains a switch and is called within a "while"
When I made it I obviously did not think that being in a "while" I will trigger the "Cannot redeclare class.." error

How may I get around
of course I could reverse it to "procedure" instead of OOP but I would like finding a solution

I guess the real question is what should be the logic
to utilize a class called within a "while"

when I read what I wrote it seems like no way out!

joelgreen

11:08 pm on Mar 23, 2007 (gmt 0)

10+ Year Member



You could declare class before the while, and create instance of the class in the while loop.

henry0

12:03 pm on Mar 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Great I am awarding to myself
the crown for excellence in:
"Shooting from the hips and not using my pea brain" :)