Solved

Procedure Too Large -- But Only In Debug Mode

Posted on 2006-07-05
10
489 Views
Last Modified: 2008-02-01
I have some legacy code that compiles fine. However, when I run it in debug mode, this one function stops with "procedure too large". Is there something easy that I can set/fix? Changing this code to reduce code might be a pain.
0
Comment
Question by:GivenRandy
  • 3
  • 3
  • 3
  • +1
10 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17043639
Hmm, never seen that one before. Any chance you can break the procedure down into smaller sub routines ?
0
 
LVL 9

Author Comment

by:GivenRandy
ID: 17043666
Yeah, but I'd rather not (has to go through a lot of testing, etc.). Was hoping there was something "strange", like some setting. If not, will have to modify the code. :(
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 17043678
Just out of curiosity, how long is your procedure ?
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17043768
Why dont u break it up into smaller procedures?
Just a work around suggestion


sub Proc1
   'do some stuff

    'Call another procedure to continue
    Proc2
end sub

sub Proc2
   'do some stuff

    'Call another procedure to continue
    Proc3
end sub

etc

0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17043793
checking the net, I found one site that says

if this is a treeview programme, then you can list a long segment under a separate procedure and call this procedure in the main programme.
i have done this and it works smoothly.



0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 9

Author Comment

by:GivenRandy
ID: 17044311
>Just out of curiosity, how long is your procedure ?

4,626 lines
122,146 characters (not counting whitespace)
201,639 characters (counting whitespace)
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 17044351
wow, thats one big procedure. Apparently the max size for a procedure is 64K:

    http://www.aivosto.com/vbwatch/help/faq.htm
0
 
LVL 9

Expert Comment

by:justchat_1
ID: 17044470
I think that means you have no choice but to break the procedure up into three parts...
0
 
LVL 9

Author Comment

by:GivenRandy
ID: 17044763
Yep, I was afraid of that. It's going to be a pain.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17045548
Will it be that bad?

The workaround I gave, which is what u are look like your doing now anyway
If u make those variables in that procedure globals to that mod
it may work, no?

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now