Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Would this be considered proper form?
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Silent Avenger




PostPosted: Thu Jan 11, 2007 10:02 pm   Post subject: Would this be considered proper form?

I'm working on a program and I have a dynamic array being used I'm just wondering if it would be considered proper to run a loop until an overflow error occurs and use error handling code. I asked my teacher and he sad he wasn't sure if it was proper practice to purposely create and error, any help would be great.
Sponsor
Sponsor
Sponsor
sponsor
rdrake




PostPosted: Thu Jan 11, 2007 10:12 pm   Post subject: RE:Would this be considered proper form?

Creating an error on purpose means that one is too lazy to read up on another way 99.9% of the time. That 0.1% is only for times when it is absolutely necessary.
Silent Avenger




PostPosted: Thu Jan 11, 2007 10:26 pm   Post subject: Re: Would this be considered proper form?

It's not that I'm too lazy it's just there is no other way I can display the array other than creating an error and I've spent the past couple days trying to get around it. The problem is that I'm using many different variables to adjust the size of the array.
rdrake




PostPosted: Thu Jan 11, 2007 11:22 pm   Post subject: RE:Would this be considered proper form?

More information on the problem you are trying to solve would help. Perhaps there is another way of doing it? Smile
Silent Avenger




PostPosted: Thu Jan 11, 2007 11:35 pm   Post subject: Re: Would this be considered proper form?

Well there is another way of doing it but then I have to add in even more variables and then the issue of efficiency comes up. So what would be more efficient in terms of memory and processing power for adding items to a list from an array? Having 6 more variables, 2 boolean and 4 integer or just having a loop that will handle the error of subscript out of range?
cool dude




PostPosted: Thu Jan 11, 2007 11:48 pm   Post subject: Re: Would this be considered proper form?

you know there might be a much easier way to do it and you just don't see it yet. keep trying to figure it out. If your still stumped post your code and we can have a look at it.
rdrake




PostPosted: Thu Jan 11, 2007 11:52 pm   Post subject: RE:Would this be considered proper form?

Use the extra variables. I do not see how looping through until you reach a state of error would be more efficient.
Silent Avenger




PostPosted: Thu Jan 11, 2007 11:52 pm   Post subject: Re: Would this be considered proper form?

Ok I'll keep trying to figure out another way but is creating an error on purpose really that bad? I know when you use the commondialog control there are some cases when you need an error to be created when the cancel button is clicked.
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: