Page Index Toggle Pages: 1 [2]  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Custom Menu (Read 7949 times)
Leezerd
Member
*
Offline


I wish I had a better
picture than this...

Posts: 49
Joined: Aug 23rd, 2004
Re: Custom Menu
Reply #15 - Nov 18th, 2004 at 9:52pm
Print Post Print Post  
thanks poppy.  this programming stuff is really starting to strech my brain a little too far.  I have a rudimentary understanding of SBasic, but I haven't got a clue about macros.  What do you expect from a roofer in Detroit?  Do you know when 1.0.5 is being released?
  

How can you be in two places at once when you're not anywhere at all.
Back to top
 
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: Custom Menu
Reply #16 - Nov 18th, 2004 at 10:55pm
Print Post Print Post  
I know all about that brain stretching, but its good to keep mind busy doing something to make you smarter, macro's are easy, read up on it in the users manual, create one to open your menu, then follow the instructions in thread,
http://www.lantica.com/Forum2/cgi-bin/yabb/YaBB.pl?board=archived;action=display...  if I can create something that works than anybody can, believe me I know. Wink

P.S. Last word I heard was, they were expecting it to be released around mid-October.  ???
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Custom Menu
Reply #17 - Nov 19th, 2004 at 1:06am
Print Post Print Post  
Quote:
...I read somewhere that you could do that by calling a macro with a startup switch something like this "c:\sesame\programs\sesame.exe - @macro("mainmenu")...

Here's an example of an actual shortcut's target field that I use:
C:\Sesame\Program\sesame.exe "Data\Price List.db" -macro "Data\Price List Menu.mac"

Note that the macro filename also contains the name of the application file. I did it this way because I have more than one application that uses a custom menu. (I don't close the Sesame command tree, but you could also include a startup switch to do that, if needed.)

The most helpful command button I created, is the one that automates the "Backup Application" function. One click and its done - no browsing through a list of filenames to find the correct backup file for the app I'm working with, and no popup warning message asking me to confirm - it just gets the job done.

Here is the programming for the "Backup" command button:
Code
Select All
var success as Int
var MacroFile as string

success = @SelectTreeItem("Price List!Application Utilities!Backup Application")

if success = 1 then
      {
      MacroFile = @repllas(@fn, "\", "\Backup ")            // Insert "Backup "
      MacroFile = @repllas(MacroFile, ".db", "")            // Delete ".db"
      @macro(MacroFile + ".mac")
      }
 


I could have hardcoded the macro filename, but with this code, I can simply copy & paste it into other apps, without modification.

This code looks for a macro file in this format (assuming you are using the Sesame default directory structure):
C:\Sesame\Data\Backup [AppFileName].mac

Example:
C:\Sesame\Data\Backup Price List.mac

The macro is needed because the @SelectTreeItem function only opens the file selection window where you select or type a filename for the backup copy. The macro I recorded simply contains a mouse-click in the Filename text box (be sure to click so the cursor is at the end of the default "Data\" subdirectory), and then contains the keystrokes to type out the name of the backup copy, then mouse-clicks on Accept.

I don't think it's safe to just click on the filename in the list rather than typing it out. The list of files can (and is likely to) change, and I'm not sure whether Sesame records the name you click on, or if it just records where you clicked - better to be safe than sorry.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Custom Menu
Reply #18 - Nov 19th, 2004 at 1:23am
Print Post Print Post  
Quote:
I could have hardcoded the macro filename, but with this code, I can simply copy & paste it into other apps, without modification.

Now that I look at this... stupid me Embarrassed, I forgot that this does still need some modification. The "Price List" portion of the @SelectTreeItem line does need to be changed when used in another application.

It's probably just as easy to use this code, and change the "Price List" portions as needed:
Code
Select All
var success as Int

success = @SelectTreeItem("Price List!Application Utilities!Backup Application")

if success = 1 then
      @macro("C:\Sesame\Data\Backup Price List.mac")
 


The only danger using this simplified version, is if you were to copy the application to a new name, to use it for another set of data, and forgot to modify the programming, the Backup command button would copy the new application to the backup copy for the original application.

Bottom line: Use the more complex code I posted earlier, and simply modify the @SelectTreeItem function as needed.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Custom Menu
Reply #19 - Nov 19th, 2004 at 1:44am
Print Post Print Post  
I just checked, and the next release will have a new funtion named @Application(), which can be used on the @SelectTreeItem line to return the name of the application as it appears at the top of the menu tree.

THEN the code can be completely portable without the need for modification. Wink
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Leezerd
Member
*
Offline


I wish I had a better
picture than this...

Posts: 49
Joined: Aug 23rd, 2004
Re: Custom Menu
Reply #20 - Nov 19th, 2004 at 5:50pm
Print Post Print Post  
This is my code for executing my Backup Application function with a command button.

var success as Int

success = @SelectTreeItem("NewSesameApplication!Application Utilities!Backup Application")

if success = 1 then
     @macro("D:\My Documents\Sesame\Data\Backup bpi.mac")

Is there any way to save (F10) the record and then backup and then exit Sesame?

maybe something like:
if success = 1 then
     @Save
     @macro("D:\My Documents\Sesame\Data\Backup bpi.mac")
     @Exit

I know theres a thread about command buttons that says something about saving and exiting.  I'll look there, but I'm not sure.

  

How can you be in two places at once when you're not anywhere at all.
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Custom Menu
Reply #21 - Nov 20th, 2004 at 2:34am
Print Post Print Post  
@Exit will not exit out of Sesame - it only exits the FORM. You will need to use a macro to exit totally out of Sesame.

While recording a macro, Sesame will NOT exit if you select File/Exit, which is good, because this allows you to actually save a macro that WILL close Sesame during playback.

So, try something like this:
Code
Select All
var success as Int

@Save

success = @SelectTreeItem("NewSesameApplication!Application Utilities!Backup Application")

if success = 1 then
 {
 @macro("D:\My Documents\Sesame\Data\Backup bpi.mac")
 @macro("D:\My Documents\Sesame\Data\ExitSesame.mac")
 }
 


The ExitSesame.mac simply needs to have:
1) Click on File
2) Click on Exit

Or you could just re-record your Backup bpi.mac macro with those 2 steps added on.

Edit:
BTW, this code assumes that the button containing it will be on your data form.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Leezerd
Member
*
Offline


I wish I had a better
picture than this...

Posts: 49
Joined: Aug 23rd, 2004
Re: Custom Menu
Reply #22 - Nov 20th, 2004 at 4:07pm
Print Post Print Post  
Thanks Carl.  I will let you know if this works. Grin Grin 8) 8)
  

How can you be in two places at once when you're not anywhere at all.
Back to top
 
IP Logged
 
Leezerd
Member
*
Offline


I wish I had a better
picture than this...

Posts: 49
Joined: Aug 23rd, 2004
Re: Custom Menu
Reply #23 - Nov 23rd, 2004 at 9:15pm
Print Post Print Post  
Well Carl after sometime trying to get this the way I want it I have come up with this:  I got the save, backup, exit button to work.  And then I decided I didn't want  the exit part.  So I took that out.  I still wanted to open my database to the add data form with a shortcut on the desktop.  So I recorded a macro to do that.  The database opens just fine with the macro.  Here's the problem.  When I open my database with the open macro the save/backup macro doesn't work.  If I take the open macro out, the save/backup works.  Here's what my shortcut target looks like:

C:\Sesame\Program\Sesame.exe "D:\My Documents\Sesame\Data\bpitest.db" -macro "d:\my documents\Sesame\Data\openbpi.mac

The code for the Save/Backup button is the same as above.

The Sesame program (sesame.exe) resides on the C:\ of my computer, the .db files are located on a drive image (D:\) for backup/safety purposes.  Could that affect the way these work together?

Any suggestions on why this is happening?  ??? Cry ??? Cry
  

How can you be in two places at once when you're not anywhere at all.
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Custom Menu
Reply #24 - Nov 23rd, 2004 at 9:55pm
Print Post Print Post  
Hello Leezerd,

Try this.

Start Sesame with your Open Macro.
Re-Record your Save and Backup Macro
Save the Newly Created Macro as
D:\My Documents\Sesame\Data\Backup bpi2.mac
Go into Designer and change the code for your button so it now references the new macro.
Reconcile

Now test your database with both macros.
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Leezerd
Member
*
Offline


I wish I had a better
picture than this...

Posts: 49
Joined: Aug 23rd, 2004
IRe: Custom Menu
Reply #25 - Nov 24th, 2004 at 12:38pm
Print Post Print Post  
Ray,

When I go to save the new backup macro, I can't save it in the same directory.  I only have one database root directory to choose from:  C:\Sesame\Program

All my .db files and the open macro is saved on the drive image (D:\).  When I open Sesame with a macro I cannot choose to save the backup macro in D:\.

Thats why I resorted to recording them seperate of each other.  This also causes a problem with the path of the backup .db files.  I get the same problem.  Can't save to the D:\.

Suggestions  ??? ??? ???
  

How can you be in two places at once when you're not anywhere at all.
Back to top
 
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: Custom Menu
Reply #26 - Nov 24th, 2004 at 2:00pm
Print Post Print Post  
I had that problem, try right clicking on the icon to start Sesame and go to properties then down to "start in box" and change the path to c:\Sesame, then start sesame.  Cheesy
  
Back to top
 
IP Logged
 
Leezerd
Member
*
Offline


I wish I had a better
picture than this...

Posts: 49
Joined: Aug 23rd, 2004
Re: Custom Menu
Reply #27 - Nov 24th, 2004 at 4:07pm
Print Post Print Post  
That was it!!  Ray was right about recording the macro, and poppy was right with the open in command.  You all have been a great help to me with this. I appreciate it.
Grin Grin Grin
  

How can you be in two places at once when you're not anywhere at all.
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send Topic Send Topic Print Print