Another factory pre-built array construction is the MENU command. It is similar to LISTBOX in a way, but much more familiar because it mimics the filePro menus that you use all the time. It does this as a processing command. In other words, you can put up a "menu" of choices and act on the response. There is a major caveat regarding the MENU command. If you are going to use a processing menu, you must be aware that the user does not see much difference between one of these menus and a real filePro menu. While a processing MENU is up on the screen, the record is "locked" because the user is still actually in INPUT mode. The user is really sitting at the point in the table where you are waiting for his response. If he decides to get up and go to lunch while this type of menu is on the screen, no one else will be able to use that record until he comes back and finishes his processing. This is very important to understand and program around. Either that or use processing menus very sparingly.
If:
Then: gosub domenu
If:
Then: end
domenu If: * domenu
Then: BREAK OFF
If:
Then: cls
If:
Then: dim mnu[12]
If:
Then: mnu["1"]="Company Setup and Maintenance -"<1
If:
Then: mnu["2"]="A: Company Data"
If:
Then: mnu["3"]="B: Fiscal Year"
If:
Then: mnu["4"]="C: G/L Account Types"
If:
Then: mnu["5"]="D: G/L Chart Of Accounts"
If:
Then: mnu["6"]="E: Checkbooks"
If:
Then: mnu["7"]="F: Accounts Receivable"
If:
Then: mnu["8"]="G: Accounts Payable"
If:
Then: mnu["9"]="H: Payroll"
If:
Then: mnu["10"]="I: System Generated Numbers"
If:
Then: mnu["11"]="J: Miscellaneous Defaults"
If: Here is where the menu gets put on the screen
Then: menu mnu do1,do2,do3,dosys,do4,do5,do6,do7,donums,do8
If:
Then: cls
If:
Then: input q(1,yesno) "Are you sure you are done?"
If: qq ne "Y"
Then: BREAK OFF;goto domenu
If:
Then: BREAK ON;return
do1 If:
Then: screen 1;goto domenu
do2 If:
Then: x=24;screen 2;gosub suretst
If: 24 ne "" and 168 = ""
Then: 51="0";52="0";53="0";54="0";161=24;162=47;163=24;164=47
If: 24 ne "" and 168 = ""
Then: 165=24;166=47;167=24;168=47
If:
Then: goto domenu
do3 If:
Then: fl="";dim new[1](80):11;dim old[1](80)
If:
Then: dim new2[1](16):95 ;dim old2[1](16)
If:
Then: old["1"]=new["1"] ; old2["1"]=new2["1"]
If:
Then: screen 3
do3a If:
Then: write;gosub suretst
If: fl=""
Then: goto domenu
If:
Then: dim typ[1](80):11
If: typ["1"] = ""
Then: goto domenu
do4 If:
Then: gosub cash;goto domenu
do5 If:
Then: ...
do6 If:
Then: ...
do7 If:
Then: ...
do8 If:
Then: gosub get8;screen 8;goto domenu
NOTE: As of 5.7.04, you can now run a menu command from outside of filePro
Example: p menuname -Xn
This will run menu option n, and then exit.