Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Procedure Length limit 2

Status
Not open for further replies.

mprogram

Programmer
Apr 27, 2004
2
US
I am new to Extra Basic. I am using Attachmate and writing macros with Extra basic. The first problem I came up with is that my macro won't compile because it is too long. Has anyone else had this problem, and if so, do you know how many lines of code a macro can take before we have to break it down into separate functions in header files?
 
I had this same issue early on in learning to code. The editor will hold a lot of data, but there is a limit. I'm not sure what that limit is. When I hit the wall it was because I was using the brut force method since I didn't know some of the more advanced coding functions like Arrays.

It is likely that you've got some large sections of code that could be drastically cut down.

Another option is to use notepad to edit the macro. EB doesn't have a very good debugger, so you wouldn't be losing much. I'm not sure if the macro will still compile and run if you're over the limit.

calculus
 
The editor will hold a lot of data, but there is a limit. I'm not sure what that limit is."

Perhaps I can provide an answer to that :)

Functions and Subs have a size limit of between 900-1,000 lines each, you will get the error "proceedure is too large". But you can have as many functions/subs as you like, and the Sub Main() does not seem to have this limit at all.
If you use ebh header files, I don't think there is a limit to code size. I have tested this with a 15thousand line macro - it works fine!

Other limits are that String variables cannot hold more than 32767 characters, and arrays cannot be larger than 32767 slots in any one dimension. I have found this out the hard way :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top