Tim, CaliperScript doesn't require you to declare variables, and (at least from the snippet that I've seen) there's no need to make the variables in question global in scope. If it's too cumbersome to pass the variables in question, consider using the shared scope instead. Caliper strongly discourages the use of global scope.
I'm guessing that your problem has to do with the pathname for your .bmp files rather than the scope of the variables. My experience is that the icons behave erratically (sometimes blank, other times black squares) when the variable is null or points to a file that doesn't exist. Instead of string_but1a = "buttons_48.bmp|230" try string_but1a = "bmp\\buttons.bmp|230" and instead of string_but1a = "MainButtons.bmp|7" try string_but1a = "bmp\\MainButtons.bmp|7" Hope that helps. --- In [email protected], "timmelko" <timmelko@...> wrote: > > Toolbar Push Button based on an image variable. > I'm in the process of rewriting our custom mapping module and having some difficulty with the Push Button feature and attempting to make this module work with Maptitude 4.8, 5.0 and 6.0. > > Using the current code (below) I am able to get the RSC to compile without errors but it doesn't work. > > In Maptitude 4.8 the toolbar button has no image. > > In Maptitude 5 and 6� the pre-declared variables seem to cause the program to reference the memory illegally. > > If I remove the [global string_but1a, string_but1b, string_but1c] Macro `Interface' where I have them defined� the illegal memory error goes away� but I encounter the same behavior as in 4.8, I get a blank button. > > If anyone has any thoughts I would appreciate it! > > ~Tim Melko~ > > Toolbar "Main Bar" > Update > Do > info = GetProgram() > if info[5] = 4.800000 then do > string_but1a = "buttons_48.bmp|230" > string_but1b = "buttons_48.bmp|264" > string_but1c = "buttons_48.bmp|298" > end > else do > string_but1a = "MainButtons.bmp|7" > string_but1b = null > string_but1c = null > end > enditem > > Button "Map Themes" > icon: string_but1a > Help: "Map Themes" > Do > runDbox("theme_Dbox") > enditem > > endToolBar >
