Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2007, 09:03 AM
Registered User
 
Join Date: Mar 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Procedure too large - Urgent

Hi All,

This is related to Visual Basic 6.0.
I am getting the compile error "Procedure too large". Is there any limitations while creating a huge procedure in Visual Basic 6.0.
My procedure contains 2500 lines. All lines required.
I splitted into sub procedures and call the subs into main procedure. Eventhough it is giving compile error.

Can anyone help me.

Thanks and advance
Regards
Balakrishna
 
Old March 13th, 2007, 12:08 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First of all, hopefully all the lines your are coding are required!!! If you were writting code with lines that are NOT required - you'd really need help.

So what is your problem? Once you have broken your sub into smaller subs everything should be working fine. Is there some new compiling error?

Please clarify.

So what is your new compile error?

One bit of advice from a seasoned developer: Any procedure you write that is longer than can be displayed in one screen in your editor is TOO BIG. It indicates a misunderstanding of how to properly design a method - each method should have ONE PURPOSE.

Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems
 
Old March 13th, 2007, 12:21 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I agree with woody. A procedure that is 2500 Lines long? That seems a bit excessive, have you broken this code out into multiple classes/routines as is logically sensible?? Do you have redundant coding (e.g. making calls to a database) that would be better suited in a class or a method of its own?

Personally I couldn't imagine opening a file and seeing a routine span 2500 lines and it is quite likely that I would break down into nervous convulsions. ><

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old March 13th, 2007, 12:39 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by dparsons
Personally I couldn't imagine opening a file and seeing a routine span 2500 lines and it is quite likely that I would break down into nervous convulsions. ><
I have survived opening files like that! I once had to fix a single Select Case construct that was almost that long!!! It is enourmously troubling to find these things, as it usually indicates that the entire project is at least as poorly written. On the other hand, I do love puzzles and fixing code like this can be a very rewarding puzzle - intellectually and financially.

Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems
 
Old March 13th, 2007, 12:53 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Quote:
quote:Originally posted by woodyz
On the other hand, I do love puzzles and fixing code like this can be a very rewarding puzzle - intellectually and financially.
...at the sake of a heart attack =P

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old March 13th, 2007, 03:48 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by dparsons...at the sake of a heart attack =P
I try to work out every day so I won't get a code induced heart attack.


Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems
 
Old March 14th, 2007, 05:40 AM
Registered User
 
Join Date: Mar 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

All lines are required for me.
I need to insert the records into 8 tables based on some conditions. If one condition satisfied I need to insert the min. of 35 records in 8 tables. Database is SQL Server.
Is there any limitation of using variables in a procedure, because I used 70 variables in my main procedure. and my procedure size is 170kb. is there any limitation on these points
I Splitted the code into sub procedures and used in main procedure.
Eventhough it is giving the same Compli error Procedure too large.
After splitting my procedure size is just 100kb.

Still I m trying to split the procedure. Is there any tool.
Thanks in advance.

Regards,
Balakrishna

 
Old March 14th, 2007, 05:44 AM
Registered User
 
Join Date: Mar 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

All lines are required for me.
I need to insert the records into 8 tables based on some conditions. If one condition satisfied I need to insert the min. of 35 records in 8 tables. Database is SQL Server.
Is there any limitation of using variables in a procedure, because I used 70 variables in my main procedure. and my procedure size is 170kb. is there any limitation on these points
I Splitted the code into sub procedures and used in main procedure.
Eventhough it is giving the same Compli error Procedure too large.
After splitting my procedure size is just 100kb.

Still I m trying to split the procedure. Is there any tool.
Thanks in advance.

Regards,
Balakrishna

Quote:
quote:Originally posted by devireddybalu
 Hi All,

This is related to Visual Basic 6.0.
I am getting the compile error "Procedure too large". Is there any limitations while creating a huge procedure in Visual Basic 6.0.
My procedure contains 2500 lines. All lines required.
I splitted into sub procedures and call the subs into main procedure. Eventhough it is giving compile error.

Can anyone help me.

Thanks and advance
Regards
Balakrishna
 
Old March 14th, 2007, 07:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

there should be a better way to do this... If you are inserting the same record into 35 tables (or more) the code should be simple... are you sure you are not coding too much??? I personally would like to see that procedure, because I think there should be a better way to handle it... if you want send it to me at hotmail (address in profile)...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
 
Old March 14th, 2007, 11:03 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

As far as I recollect, a procedure in VB6 can be 64kb.

You don't need any tool to split a function.

It is very puzzling that you created such a large procedure in the first place.
How did it get so large without testing along the way?
It seems that you would have realized it was too large way before it got to the size it is at now.

Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems





Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent: Oralce Stored Procedure ramuis78 ASP.NET 2.0 Basics 6 September 18th, 2007 10:06 AM
Large Project ken killeen All Other Wrox Books 0 October 27th, 2004 07:43 AM
Too large query - what to do? janise MySQL 14 June 14th, 2004 11:50 AM
stored procedure urgent help required sarfraz Crystal Reports 0 April 19th, 2004 08:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.