Hello everyone,

I've been having this problem for years:
"Compile error: Procedure too large"
I asked this question in few places, Expert-Exchange was one,
but nobody never came out with an answer, now here i am again,
hoping to find a solution for this issue or problem in my project.

Here is a bit of information about this error:
I am trying to create a file from a resource file, but not a .RES file,
when i said Resources i meant, resource code, and i have no problems with
small files, but when the file is bigger than 4MB i get this error.

Recommended Answers

All 2 Replies

Break up your main function into multiple functions.
You can call them all from main.

...or are you implying you're loading a resource that is taking up too much RAM?

Hi thines,

No, let me explain... actually let me post a bit of example.

Sub C0ding()
Dim Coding$(1)
Coding$(1) = "D A 48657920686920746F2065766572796F6E6520686572652061742044616E69576562203A2D29D A D A 5468697320697320433064696E67205E5F5ED A D A "

DF = FreeFile
Open "C:\Dani-Web.txt" For Output As #DF
For i = 1 To 1
a$ = Coding$(i)
While Len(a$) > 0
b$ = "&H" & Left$(a$, 2)
a$ = Right$(a$, Len(a$) - 2)
Print #DF, Chr$(Val(b$));
Wend
Next i
Close #DF
End Sub

This is just a fraction of a very small resource file,
the big the file gets, the numbers of coding lines grow.
and then if the final out put file is too big, i get an
error when decompile my final executable project.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.