Normal Topic Custom Menu (Read 1249 times)
aheimdal
Member
*
Offline


No personal text

Posts: 14
Joined: Dec 16th, 2003
Custom Menu
May 20th, 2004 at 11:38am
Print Post Print Post  
I would like to create a custom menu for a "workorder" data base that several people (like 50) will be using to imput workorders.  Few of these people will ever know the ins and outs of Sesame.  The menu would consist of the following:

            1.ADD WORKORDER
            2.SEARCH FOR A WORKORDER
            3.COSTING INFORMATION OF A WORKORDER
            4.CREATE A REPORT
            5.EXIT

I would like this to be the only real menu that the users need to see.  I curently have a menu similar to this in Q&A DOS. and I need to keep this same format if we switch to Sesame.

  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Custom Menu
Reply #1 - May 20th, 2004 at 12:01pm
Print Post Print Post  
I am not sure of what response you are looking for. Is there a specific question you need answered?

If you want to know if you can create menu like features the answer is a definite yes.
There are many ways to accomplish your goal of having a non Sesame savvy user do there job easily. I personally would take a good look at using command buttons to automate features and using  the Closecommandarea command on page 147 in the programming manual used with the –macro startup switch to force the user to a form you want them to use.

With a little effort you can use Sbasic to see who the user is and act accordingly to that specific user. You can have your application behave differently for each user and there specific assigned tasks.

In my opinion the most important step to successfully reaching you goal is to have a clearly thought out objective and a clear understanding on how your application will be designed. The more effort and thought you put in at the beginning the better your end product will be.   Smiley
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Custom Menu
Reply #2 - May 20th, 2004 at 12:13pm
Print Post Print Post  
Ok with your post edit I see your question.

Use the macro startup switch to force the user to a form you want them to use. Use the command buttons to control the tasks. Sbasic gives you the ability to do many things to control the user. One example is the visibility commands. You can display specific elements at specific times. For example you can have a specific button click display the specific elements for order entry. Another button can hide all those elements and display a set of buttons for printing reports.

At the moment I find my only limitation in creating my application is in the amount of effort I am willing to put into using Sesame and Sbasic. I have found methods to do almost anything I have dreamt of.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Custom Menu
Reply #3 - May 20th, 2004 at 4:55pm
Print Post Print Post  
aheimdal,
Not knowing your exact application I cannot replicate exactly what you want but I played around and used the macro switch to bring me to a form with buttons and no command tree. This is an example of my shortcut command line starting sesame with a macro and my own splash screen


C:\Sesame\ver\may18\sesame.exe -macro c:\sesame\start2mac.mac -splash c:\sesame\pics\ids4.jpg  c:\sesame\data\menutry1.db

I then had a command button to add workorder I used the new record commands explained starting on page 8 in supplement for version 1.031

            I then used a command button  SEARCH FOR A WORKORDER with the @selectTreeitem () command see page 160 and 161 in programming guide. My example used:

// Selects Search mode

var vsearch as int


if lastname <>  "mcsd"


{

     Vsearch=@selectTreeitem ("Search Update Menu!Search (F7)")
}

            3.COSTING INFORMATION OF A WORKORDER 

I had no clue what this should do.

            Then I used a command button CREATE A REPORT  I used an example from previous posts and from Appendix 2 of the Sesame Programming Guide. This pops up a list of report choices when clicked it merges automatically.

// Letter Merge routine

var vFileHandle as Int          // For writing data file
var vHeader as String           // Data file header line
var vData as String             // Data file data line
var n as Int = 1            // General purpose counter
var vSelectedDoc as String      // Document selected from menu
var vOneOrAll as String         // Include record(s) option
var F as array[25] of String    // Mergeable fields array
var vStartingRec = @ResultSetCurrentPosition()
var vGoPrint as String

/* This program differs slightly from the one in
   Appendix 2 of the Sesame Programming Guide.
   This one gets its list of available merge documents
   from an external text file (list.txt) instead of the
   document names being hard-coded into the program.
   One may then create any number of merge documents,
   and simply edit the list.txt file (with Notepad) to
   correspond to the available merge documents */

// Next 4 lines user modifiable
var vDataPath as String = "c:\sesame\docs\num1.txt"
var vDocsPath as String = "c:\sesame\docs\"
var vWordPath as String = "c:\sesame\word.bat"
var vListPath as String = "c:\sesame\docs\list.txt"

SUBROUTINE PrintCurrentRecordOnly()

If @Askuser("Merge print the " + vSelectedDoc + " for "
+ vOneOrAll + "?","","") Then
{

vGoPrint = "Yes"

n = 1                  
While F[n] <> ""
{
     vHeader = vHeader + F[n]   + "^"
     vData   = vData   + @(F[n]) + "^"
     n = n + 1
}

vFileHandle = fileOpen(vDataPath)
fileSeek(vFileHandle, 0)
fileWriteLn(vFileHandle, vHeader + @NewLine() + vData)
fileClose(vFileHandle)

}

END SUBROUTINE

SUBROUTINE PrintAllRetrievedRecords()

var n as Int
var i as Int = 1

If @Askuser("Merge Print " + vSelectedDoc + " for these " + @ResultSetTotal() + " retrieved records?",
"( If not, cancel this task, press F7 for a new search,"," and retrieve the records DO you want to print. )")
Then
{

     vGoPrint = "Yes"

     n = 1                  
     While F[n] <> ""
           {
           vHeader = vHeader + F[n]   + "^"
           n = n + 1
           }

     vFileHandle = fileOpen(vDataPath)
     fileSeek(vFileHandle, 0)
     fileWriteLn(vFileHandle, vHeader)

     For n = 1 to @ResultSetTotal()

     ResultSetCurrentPosition(n)

     While F[i] <> ""
           {
           vData = vData + @(F[i]) + "^"
           i = i + 1
           }

     FileWriteLn(vFileHandle, vData)

     @Msg("Processed Record " + n + " of " + @ResultSetTotal())
     vData = ""
     i = 1

     Next

     fileClose(vFileHandle)

     // Rewind to record where it all started
     ResultSetCurrentPosition(vStartingRec)

     }

END SUBROUTINE


// BEGIN MAIN PROGRAM

// Build documents menu

vSelectedDoc = @PopupMenu(
@insert(vListPath), "SELECT MERGE DOCUMENT" )

// Build which record(s) menu

vOneOrAll = @PopupMenu(
"THIS Record Only;" +
"ALL Retrieved Records;" , "SELECT RECORD(S) TO MERGE PRINT" )

If vSelectedDoc <> "" and vOneOrAll <> "" Then
{      

     // Delete exsting data file. New one will be generated.
     If FileExists(vDocsPath + vSelectedDoc) Then
     {
     fileDelete(vDataPath)      

     // Fields available for merging
     F[1] = "patientid";        F[2] = "itemextamt";     F[3] = "lastname"
     F[4] = "homephone" ;        F[5] = "workphone";     F[6] = "Homestreet"
     F[7] = "HomeState";        F[8] = "homeZip" ;     F[9] = "homecity"
     F[10]= "Emailhome";        F[11]= "insconameprimary"; F[12]= "insconamesec"
     F[13]= "DateEntered"; F[14]= "cellphone";  F[15]= "insuredemployer"

     If vOneOrAll = "THIS Record Only" Then
           PrintCurrentRecordOnly()
     Else
           PrintAllRetrievedRecords()

     If vGoPrint = "Yes" Then
     {
           // Start Word via Word.bat and pass doc filename.            
           n = @Shell(vWordPath + " " + @Chr(34) + vDocsPath + vselectedDoc + @Chr(34))
           If n = 1 Then
           @MSgbox(vDocsPath + vSelectedDoc,"word.bat not found or something else wrong.","")
     }
     }
     Else
           @Msgbox(vDocsPath + vSelectedDoc + " doesn't exist.","","Aw shucks!")
}
           
I then used a command button EXIT

See @Exit  page 86 in programming Guide

This is only an example of some methods that could work for you. There are many other and probably better ways. I just wanted to try and give you an idea on how to progress.


Hope this helps
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Custom Menu
Reply #4 - May 22nd, 2004 at 2:46am
Print Post Print Post  
BobScott,

I vote that Lantica give you a raise!

Smiley

Thanks for all your detailed posts.

Steve in Texas
  
Back to top
IP Logged
 
aheimdal
Member
*
Offline


No personal text

Posts: 14
Joined: Dec 16th, 2003
Re: Custom Menu
Reply #5 - May 26th, 2004 at 7:18pm
Print Post Print Post  
BobScott

Ok.  I found some time to play with the information that you gave me.  I used a shortcut to bring me to a Sesame session with a command button "Add Workorder"-worked great.  Next question:

When programming that command button how can I get it bring up a form from a different database in this "Application" to "Add Data" to?

aheimdal
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Custom Menu
Reply #6 - May 27th, 2004 at 1:42pm
Print Post Print Post  
Aheimdal,

As with most anything you would like to accomplish with Sesame there is always more then one way to accomplish your desired task. Between macros, Sbasic and standard Sesame features a creative person can always find another method. The way I found that seems to work best for me at putting a user in add mode on a particular form is to

1 make a subform on a tab element of the particular form.
2 add a command button on the subform tab called Add yada yada
3 use Sbasic code like this

// This puts the user into Add mode in invoices

var mm as int

mm = @formnewrecord("inv data")


In my example when a user wants to enter a new invoice from the main form, they click on the Invoice Tab and click the add invoice button. With Sesames built in natural linking it automatically associates the new invoice to the parent record.

I also like the button menu concept you are trying to achieve, however I am finding by using tabs and subforms that with 1 click of a tab (easy as button) the user is exactly were they need to be. I am starting to wonder if this menu concept many of us are attempting to achieve is actually outdated and we are just thinking it is best because that is what we are used to. Take a good look at the tab and subform concept let each tab be your menu selection button, it might end up being a better way in the long run. (Just an opinion and thought out loud)

Keep us posted on your progress and your solutions.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged