Normal Topic Macro problems (Read 947 times)
Peter
Member
*
Offline


No personal text

Posts: 22
Joined: Jan 7th, 2004
Macro problems
Feb 6th, 2004 at 12:26pm
Print Post Print Post  
Hi

I'm trying to set up a layout to use as a menu screen.

I recorded a macro to leave the menu layout, open a new database file and search for records. It seems to work fine when running from "Playback" and so I saved the macro as "select". I then programmed a command button on my Menu Screen (the only element) with @macro("select"). On clicking on the command button (having made sure the macro is loaded) I get a message "Macro Select failed to open". Clicking OK then causes the macr to run, my new database opens but then Sesame crashes with the message sesame.exe has generated errors. I then have to unlock my database that has just been opened.

Any suggestion please?

Peter
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Macro problems
Reply #1 - Feb 6th, 2004 at 1:33pm
Print Post Print Post  
If you are receiving the message "Macro select failed to open" then that macro did not open during the @macro command. If it ran, it was because the macro you recorded was still the active macro. Sesame adds the extension ".mac" to macro files - try invoking the macro with: @macro("select.mac").

Sesame crashing probably has more to do with the content of the macro, then to do with running a macro by itself. By running a macro during SBasic (using @Macro) and using it to open another application - you inadvertantly closed the form that contained the SBasic you were running - thereby stopping the SBasic program you were running suddenly - the @macro routine had no place to return to - when it returned.

I'll look into it.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Peter
Member
*
Offline


No personal text

Posts: 22
Joined: Jan 7th, 2004
Re: Macro problems
Reply #2 - Feb 6th, 2004 at 1:59pm
Print Post Print Post  
Thanks for your help. @macro("Select.mac" ) on the command button gives the same result.

This would certainly be a great function to have working - it seems to me to be the only equivalent of the Q&A Custom Menu structure and could potentially make user navigation much easier for not-very-computer-literate users!

Peter
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Macro problems
Reply #3 - Feb 6th, 2004 at 2:09pm
Print Post Print Post  
Is the macro file "select.mac" in your "Start In" directory? If not, try specifying the full path to the macro file:

@macro("c:\Sesame\Data\select.mac")

Substitute the actual path for the path specified above. Unlike Q&A, Sesame's macros are standalone files. This allows them to be used generically in multiple applications, allows the user to store them in a central location, again - for multiple applications, and also allows them to be used on startup, before an application has been loaded.

As to using macros to create a "custom menu" - you may want to look at the SBasic command "SelectTreeItem" - it may be what you need.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Peter
Member
*
Offline


No personal text

Posts: 22
Joined: Jan 7th, 2004
Re: Macro problems
Reply #4 - Feb 6th, 2004 at 2:36pm
Print Post Print Post  
OK. The full path and filename does allow the macro to run straight away but, perhaps as you suspected, we get the crash when the new database opens. I'll play around with @SelectTreeItem. Can it be used it to open another database within the same application?

Thanks

Peter
  
Back to top
 
IP Logged