Re: Macro question
Dick Hoffman <[email protected]> Tue, 12 Jan 2010 19:17:34 -0500
| Newsgroups | gmane.comp.openoffice.dba.user |
|---|---|
| Message-ID | <[email protected]> |
Frank Schoenheit, Sun Microsystems Germany wrote: > Hi Dick, > >> OK, here are the steps I went through to create a second macro. > > ah, *that's* a useful problem description :) > >> 1. I double-clicked on my dbase to activate Base. >> 2. I then selected TOOLS -> MACROS -> ORGANIZE MACROS -> OpenOffice.org >> Basic. That opened a window with a box that displayed a list of items >> including my dbase. >> 3. Clicking on the "+" to the left of my dbase dropped down a folder >> named "STANDARD". >> 4. Clicking on the "+" to the left of STANDARD revealed it contained a >> Macro named "Stat1" which is the first macro I wrote. I want to create >> another macro in this folder called STANDARD. >> 5. I click on the folder called STANDARD to highlight it, type the new >> macro name "Species" in the box provided and select "NEW" on the right. >> 6. A window opens to enter the Basic code with the Basic statements >> "Sub Species" and "End Sub" already provided. The statements for the >> macro "Stat1" are visible above the "Sub Species" statement so this new >> macro is being appended to the previous one. >> 7. I enter the rest of the code for "Species" and close the window. (For >> some reason, the provided "End Sub" is not recognized and I have to >> enter another one.) I again look at what macros are listed in STANDARD >> and only "Stat1" is listed. If I highlight "Stat1" the list of macros on >> the right now shows "Stat1" and "Species" as macros. If I highlight >> "Species" and select RUN only that macro executes, which is OK. > > Okay, we have a terminology problem here. "Standard" is the name of a > Basic library. As said, libraries contain multiple "modules" - you have > one named "Stat1", which is displayed in the left hand side tree view > below the "Standard" node. > > However, you *also* have a *sub routine" called "Stat1", which is > located in the *module" "Stat1". > > The steps you describe create a new *sub routine* in the existing > *module* named "Stat1". > > > Try the following: Open "Stat1" for editing (select it in the dialog, > and press the "Edit" button, so the Basic IDE opens). > At the bottom of the window, you'll see a small tab named "Stat1". Open > its context menu, and choose "Insert / BASIC module". This will create a > new module, indicated by a second tab, and default-named "Module1". When > you now open the organizer dialog, again, you'll note that below the > "Standard" node in the tree, there's two entries: "Stat1" and "Module1" > => you're done :) > > Ciao > Frank > Thanks for your help so far!!! I followed your suggestions above and figured out I had to right click on the "Stat1" tab to get to the "Insert / BASIC module" option. I now have two modules: one named Module1 which contains the "Species" macro, and another named Module2 which contains the "Stat1" macro. Now I can't figure out how to rename the modules. Dick