SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => SlickEdit User Macros => Topic started by: seeplusplus on January 14, 2022, 08:14:50 PM

Title: Is there a size limitation on a macro
Post by: seeplusplus on January 14, 2022, 08:14:50 PM
I am trying to load a macro built on another machine. But, if the size is above 3800 lines, I get "Runtime Error Position Found".

Is there a fix for that?


SlickEdit 2012 (v17.0.2.0 64-bit)

Serial number: FWB922119
Licensed number of users: 750
License server: 27100@license-wan-sd1

Build Date: August 09, 2012
Emulation: Visual C++ 6

OS: Windows 8 x64
OS Version: 6.02.9200 
Memory: 52% Load, 10606MB/20300MB Physical, 14056MB/41804MB Page File, 37553MB/134217727MB Virtual
Shell Info: C:\WINDOWS\system32\cmd.exe /q
Screen Size: 1920 x 1080

Project Type: Cpp
Language: .e (Slick-C)
Title: Re: Is there a size limitation on a macro
Post by: Dennis on January 14, 2022, 09:27:43 PM
The size limitations have been increased in more recent versions of SlickEdit.

The other option is to break the macro down into sub-modules.

If the module contains a lot of string data, you should consider loading the data from a data file, because lots of strings can lead to using a lot of macro byte code space.
Title: Re: Is there a size limitation on a macro
Post by: Graeme on January 14, 2022, 10:41:28 PM
You could try splitting in two and #including one of them into the other.  I don't know if this would work.  It depends where slickedit applies the limit.

You could also pre-process the file and look for lines ending in semi-colon  - then join the next line to the current line by removing the line ending  -  CR LF.  You can use the slick join_line command for this.

e.g. record a macro to search for semi-colon [whitespace] at the end of a line then call join_line.
 
Title: Re: Is there a size limitation on a macro
Post by: Dennis on January 14, 2022, 10:45:37 PM
There is no limit on the number of lines.  In fact, the error you get when a Slick-C macro is to large is "code size too large", indicating the amount of byte code generated exceeds the limit.

#include works like a C++ #include, so that is not going to cut the code size any.  But, if you break it into two modules, you can have the main module #import the other module.