-
Mar 13th, 2007, 09:07 AM
#1
Thread Starter
New Member
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
-
Mar 13th, 2007, 09:16 AM
#2
Re: Procedure too large - Urgent
"The dark side clouds everything. Impossible to see the future is."
-
Mar 13th, 2007, 09:57 AM
#3
Re: Procedure too large - Urgent
VB6 Code Limitations
This is for VB4, but maybe it is applicable for VB6 too.
Try to breake the procedure into more smaller subprocedures and place them in different modules.
-
Mar 13th, 2007, 10:51 AM
#4
Fanatic Member
Re: Procedure too large - Urgent
Is there an array?
Oh, this is a compile error.
Maybe you have a coding error.
Reduce the program. Compile it, Then add the code, compile it...etc
Alpha Micro: Alpha Basic, AS400 V5r2, EDI (Trusted Link/ Inovis.com),Access AS/400 via VB6, Qbasic for data conversions. A mix of Hardware too. ASCII Table , New Number to Words/66 digits , AS/400(v5r2) VB6 Viewer/Ask for code(ODBC) ^ What Is Transferring? , Check your Ports #Perfect Passwords , *Slide Bar Example , Logoff, Restart, Shut-Down PC *Keep Form On Top , Opaque Form ^ Create Objects at Run Time @ Check Key Caps Locks # GetTickCount(System Up Time) * Convert text to Excel & Collected Icons + Resize: Form/Text box ^ PC GateWay via Shell $ Drag & Drop Game ! PopUpMenu *Print File/no Open# Timer on Mult Forms ~ Splash & Mult Forms & Lots of Comments + Random/Timer/Guess * Dec >Hex >Oct >Bin % Get MAC (NIC) < saving to Registry > Wookiee Cookies \ BackUpDisk / World Conection SpeedTest $ Glossary Commonly Used Terms # phonetic list @ Detailed Computer Scan
When posting Code, Use tags.. [CODE] *Your Code* [/CODE]
-
Nov 27th, 2012, 07:48 PM
#5
New Member
Re: Procedure too large - Urgent
Did some quick bounds checking to find some of the limits of a procedure:
1. Limited to 9347 function calls (lines) if functions have no parameters
2. Each parameter of a called function costs an additional line
3. Removing line continuations (_) or putting multiple lines on one line ( does not help
4. Making parameters optional does not help
5. Comments and whitespace are ignored
6. Oversize procedures can still be compiled and run from the executable
-
Nov 27th, 2012, 08:44 PM
#6
Re: Procedure too large - Urgent
sounds like it needs to be broken up into different DLLs or something... or at the least some classes... what in the world does this "procedure" of epic size DO that it needs to be so large?
-tg
-
Nov 28th, 2012, 08:44 AM
#7
Re: Procedure too large - Urgent
Duplicate threads merged, and moved to the VB6 forum - please post each question (or variation of it) only once. If you think you have posted in the wrong forum, click the "report" icon on the left of a post (or PM a moderator) to ask for it to be moved.
-
Nov 28th, 2012, 03:15 PM
#8
Re: Procedure too large - Urgent
i think this was just someone posting some additional information to a very old thread, which could have great value for anyone finding this thread from a search
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Nov 28th, 2012, 03:37 PM
#9
Banned
Re: Procedure too large - Urgent
I had the same problem before. To overcome this problem split the program into several functions and in the main program call the functions
-
Nov 28th, 2012, 04:34 PM
#10
Re: Procedure too large - Urgent
It is a problem that you will not run into with a properly designed program. One should try to keep subs, functions small in size whenever possible. Ideally you should be able to see the full code of a sub or function without needing to scroll the page. Of course this is not always possible but there is no case I can think of to where a single sub or function would have over 2k lines of code in it. I would hate to be the one to have to go back and make changes to something written like that.
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
|