palmtree with sun behind it CONTACT US
Phone: (412) 835-9417
Email: sales@vss3.com

Tip #35 filePro® MENU Command


This command is useful to display a list of choices that can be selected like a regular filePro menu. By pressing the character prompt, or by moving the cursor to the selection and pressing ENTER. In this example, it is used to replace the filePro Inquire/Update/Add menu by labeling the section with the @MENU label. This can make the user interface much more friendly.

Processing: Input

57 ------- - - - - - - - - - - - - - - - -
@menu If: sn eq ""
     Then: sn="1"
58 ------- - - - - - - - - - - - - - - - -
If:
   Then: dim line(11)(35);line("1")="Customer Main Menu Screen:"<sn
59 ------- - - - - - - - - - - - - - - - -
If:
   Then: line("2")="1:Inquire by Account Code";line("3")="2:Inquire by Company Name"
60 ------- - - - - - - - - - - - - - - - -
If:
   Then: line("4")="3:Add Customers"; line("5")="4:Inquire by Phone Number"
61 ------- - - - - - - - - - - - - - - - -
If:
   Then: line("6")="5:Inquire by Street Address"; line("8")="6:Inquire by 2nd Street Address"
62 ------- - - - - - - - - - - - - - - - -
If:
   Then: line("8")="7:Inquire by Check Number"; line("9")="8:Scan Customers"
63 ------- - - - - - - - - - - - - - - - -
If:
   Then: line("10")="9:Select a Screen"
64 - --- - - - - - - - - - - - - - - - - - - - - - - - - - - - --
If:
   Then: menu line lone,ltwo,lthree,lfour,lfive,lsix,lseven,leight,lnine,lten,lexit


This menu line works like a ON..GOTO statement, if they selected option 1, it will goto lone, if the user selected 4 it would goto lfour. I like to use labels that help me match the items.
65 ------- - - - - - - - - - - - - - - - -
If:
   Then: goto @menu 'this will return to the menu if nothing is selected
66 ------- - - - - - - - - - - - - - - - -
lnine If:
   Then: dim scn(4)(20);scn("1")="1 - General Info";scn("2")="2 - Aging Data"
67 ------- - - - - - - - - - - - - - - - -
If:
   Then: scn("3")="3 - AR Summary";scn("4")="4 - Sales Screen"
68 ------- - - - - - - - - - - - - - - - -
If:
   Then: sn=listbox(scn)
69 ------- - - - - - - - - - - - - - - - -
If: sn lt " 1" or sn gt " 4"
   Then: sn="1"
70 ------- - - - - - - - - - - - - - - - -
If:
   Then: goto @menu
71 ------- - - - - - - - - - - - - - - - -
lone If:
   Then: pushkey "4A";end 'select with index A
72 ------- - - - - - - - - - - - - - - - -
leight If:
   Then: pushkey "2";end 'start selection options
73 ------- - - - - - - - - - - - - - - - -
lthree If:
   Then: pushkey "3";end 'start add mode
74 ------- - - - - - - - - - - - - - - - -
ltwo If:
   Then: pushkey "4B";end 'go to index mode with index B (Company Name)
75 ------- - - - - - - - - - - - - - - - -
lfour If:
   Then: pushkey "4H";end 'go to index mode with index H (Phone Number)
76 ------- - - - - - - - - - - - - - - - -
lfive If:
   Then: pushkey "4F";end
77 ------- - - - - - - - - - - - - - - - -
lsix If:
   Then: pushkey "4G";end
78 ------- - - - - - - - - - - - - - - - -
lexit If:
   Then: exit 'puts you out to the user menu
79 ------- - - - - - - - - - - - - - - - -
lseven If:
   Then: input popup ck(10,allup) "Check Number: ";
80 ------- - - - - - - - - - - - - - - - -
If:
   Then: show("23","10")"\kZ to SELECT \KY to Exit "
81 ------- - - - - - - - - - - - - - - - -
If:
   Then: lookup chk = tmsck k=ck i=b -nxm b="(brw=12 fill=asc,top)[Account Inv# TY Check Date Check No. Check Amount]*1 *2 *6 *14 *16 *17"
84 ------- - - - - - - - - - - - - - - - -
If: not chk
   Then: goto @menu
85 ------- - - - - - - - - - - - - - - - -
If:
   Then: an(4,allup,g)=chk(1)

Once a check number has been found, the proper account number in the current file is plucked and used to move to the correct customer using lookup - (lookup dash). This allows you to find a customer based on information not in the current file. At this point we are not on any record in the file, so no blank record is left behind.
86 ------- - - - - - - - - - - - - - - - -
If:
   Then: lookup - k=an i=a -nx
87 ------- - - - - - - - - - - - - - - - -
If:
   Then: end


Written by Nancy Palmquist

Copyright, 1997 by Virtual Software Systems.  All rights reserved.

Contact Us by: Email to Virtual Software Systems or Phone: (412) 835-9417