After working with MapBasic in 10+ years, it seems an old rat can still learn new tricks :-)
Markus Lindner pointed out that one should always take care to recompile all modules when changing common definitions. Good pprogramming practice indeed, but alas that wasn't causing my problems. Rinus Duerloo mentions a possible 64 KB limit on MBX, but I can say clearly that this is not the case. I made a quick scan of my develeopment tree, and the winner was an MBX in excess of 500 KB. So whatever the limit is, it's (luckily) not 64 KB. Bill Thoen also pointed this out. The answer to my solve my trouble was first given by Erik Nielsen and later by Bill Thoen. It was a naming conflict. In a multi module application, local variables in modules are only valid (have scope) in the module, so it's not a problem to have similarly named variables in several modules. In my na�vity I thought this also applied to subs/functions, giving MB a whiff of OOP. It doesn't ! I have two very similar modules in my app, and (off course) copied one to the other. I took care to rename all entry points, i.e. subs called from other modules, but thought no more of all the local subs called within the module. Alas, my lazy strategy was thwarted. :-/ So, all subs and functions must be uniquely named within the total application, rendered OOP-like modularization in MB rather impossible. Thanks to all that replied. Best regards / Med venlig hilsen Lars V. Nielsen -------------------------------------------------------- Hvenegaard & Meklenborg Rugaardsvej 55, DK-5000 Odense C Denmark http://www.hvm.dk ----- Original Message ----- From: "Lars V. Nielsen (HVM)" <[EMAIL PROTECTED]> To: "MapInfo-L" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, August 27, 2004 1:25 PM Subject: Size limit when linking an MBX ?? > I'm building a rather large MapBasic utility for specialized database > administration, and suddenly MapBasic refuses to link my program. It will > however compile all my modules. > > The error messages are the infamous: > > The instruction at "0x123456789" referenced memory at "0x987654321". The > memory could not be "written" > The instruction at "0x123456789" referenced memory at "0x987654321". The > memory could not be "read" > > I'm wondering whether it's a size limit issue somewhere in MapBasic. If I > replace one of the (large) modules with a dummy, it links my app without a > problem. > > The (6) MBO's that go into the MBX are a total of 232 KB in size. Not much > by any standard, I would say, but somehow it makes MB barf. > > Has anyone experienced something similar ? And yes, I _have_ tried to reboot > my PC ;-) > > Windows 2000 Server, MapBasic 6.5. I've also tried to link with 4.1, and > 7.5 : exact same result. > > Best regards / Med venlig hilsen > Lars V. Nielsen > -------------------------------------------------------- > Hvenegaard & Meklenborg > Rugaardsvej 55, DK-5000 Odense C > Denmark > http://www.hvm.dk > --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 13117
