Menu Documenter

Below is the information the programmer needs to replicate a Visual FoxPro menu.  For example, The Export Table prompt calls the "wexport" screen.  "Export Table Command: DO FORM wexport"

We plan to automate this process but not as a priority.

The information below will save the programmer several hours.

Wmenu.mnx
 
Objtype:  1 Objccode: 22
-------------------------- 
Procedure: 
        
-------------------------- 
Objtype:  2 Objccode:  1 Name: _MSYSMENU
Objtype:  3 Objccode: 77 Prompt: \<File
 
Objtype:  2 Objccode:  0 Name: FILE
Objtype:  3 Objccode: 67 Prompt: Change \<User Command: DO FORM WUSER
Objtype:  3 Objccode: 77 Prompt: \<System
 
Objtype:  2 Objccode:  0 Name: Command
Objtype:  3 Objccode: 67 Prompt: User Preferences Command: DO FORM wuserpref WITH _Screen.UP_machineid
Objtype:  3 Objccode: 78 Prompt: \-
Objtype:  3 Objccode: 67 Prompt: Export Table Command: DO FORM wexport
Objtype:  3 Objccode: 67 Prompt: Compact Histinvt/Inv Records Command: DO FORM WCOMPACT
Objtype:  3 Objccode: 80 Prompt: Find orphaned workorder records
-------------------------- 
Procedure: 

***** hunt for orphaned WODETAIL.DBF records

OKANS=MESSAGEBOX("This process will find any 
orphaned records in the WODETAIL.DBF file." + 
CHR(10) + CHR(10) + "Do you want to 
continue?",4+32+256,"Confirm")
IF OKANS<>6 THEN
    RETURN
ENDIF

* count orphaned records
TEXT TO cSQL TEXTMERGE NOSHOW
    CALL usp_countwodetailorphan()
ENDTEXT
gDB_SendSqlSelect(cSQL,"csrOrphan",1174)
ICOUNT = ForceNumeric(csrOrphan.c)
USE IN "csrOrphan"

*we now know if there were any orphaned records
IF ICOUNT=0 THEN
    *no records, just exit
    MESSAGEBOX("No orphaned records 
found",0+64,"Information")
ELSE
    *offer to delete orphaned records
    OKANS=MESSAGEBOX(TRANSFORM(ICOUNT)+" orphaned 
records found."+CHR(10)+CHR(10)+"Would you like to
 mark them as deleted?",4+32+256,"Confirm")
    IF OKANS=6
        TEXT TO cSQL TEXTMERGE NOSHOW
            CALL usp_deletewodetailorphan()
        ENDTEXT
        gDB_SendSqlCommand(cSQL,2072)
        MESSAGEBOX(TRANSFORM(ICOUNT)+" records 
deleted",0+64,"Information")
    ENDIF
ENDIF

-------------------------- 
Objtype:  3 Objccode: 80 Prompt: Test Stored Procedure
-------------------------- 
Procedure: 

aa = 4
bb = 0
lr = SQLExec(gDB.dbconnection,'call 
sp(?aa)','csrResult')
IF lr<0
    MESSAGEBOX("error")
    = AERROR(aErrorArray)
    MESSAGEBOX(TRANSFORM(aErrorArray(1)) + " " + 
aErrorArray(2))
ELSE
    * the error result
    MESSAGEBOX("lr = " + TRANSFORM(lr))
    * result only goes to a cursor, so take it to a 
variable
    bb = csrResult.dp2
    * now show the variable
    MESSAGEBOX("bb = " + TRANSFORM(bb))
    * and release the cursor
    USE IN "csrResult"
ENDIF


-------------------------- 
Objtype:  3 Objccode: 80 Prompt: Fix Orphan Inventory
-------------------------- 
Procedure: 


* fix orphans in various tables
TEXT TO cSQL TEXTMERGE NOSHOW
    CALL usp_fixorphans()
ENDTEXT
gDB_SendSqlCommand(cSQL,9999)
        
MESSAGEBOX("Completed")
-------------------------- 
Objtype:  3 Objccode: 80 Prompt: Delete Blank Bookcode Records
-------------------------- 
Procedure: 

* delete blank bookcode records from various 
tables
TEXT TO cSQL TEXTMERGE NOSHOW
    CALL usp_deleteblankbookcode()
ENDTEXT
gDB_SendSqlCommand(cSQL,9999)
        
MESSAGEBOX("Completed")
-------------------------- 
Objtype:  3 Objccode: 78 Prompt: \-
Objtype:  3 Objccode: 67 Prompt: E\<xit Command: DO WEXIT
Objtype:  3 Objccode: 77 Prompt: \<Edit
 
Objtype:  2 Objccode:  0 Name: Edit
Objtype:  3 Objccode: 67 Prompt: \<Customers Command: DO FORM WEDITCUST WITH ""
Objtype:  3 Objccode: 67 Prompt: I\<nventory Command: DO FORM wedititem WITH ""
Objtype:  3 Objccode: 67 Prompt: \<Vendors Command: DO FORM WEDITVEND WITH ""
Objtype:  3 Objccode: 78 Prompt: \-
Objtype:  3 Objccode: 67 Prompt: Agent Command: DO FORM WEDITAGT WITH 0
Objtype:  3 Objccode: 67 Prompt: Book Reviews Command: DO FORM WEDITBOOKREV WITH 0
Objtype:  3 Objccode: 67 Prompt: Congregation Command: DO FORM WEDITCONG WITH ""
Objtype:  3 Objccode: 67 Prompt: SS List Command: DO FORM WEDITSS WITH 0
Objtype:  3 Objccode: 77 Prompt: \-
 
Objtype:  2 Objccode:  0 Name: _3rq1a6mtm
Objtype:  3 Objccode: 67 Prompt: School Order Command: DO editmastinvt IN wdirectedittable
Objtype:  3 Objccode: 67 Prompt: Inv Command: DO editinv IN wdirectedittable
Objtype:  3 Objccode: 67 Prompt: Histinvt Command: DO edithistinvt IN wdirectedittable
Objtype:  3 Objccode: 67 Prompt: Onorinvt Command: DO editonorinvt IN wdirectedittable
Objtype:  3 Objccode: 77 Prompt: \<Search
 
Objtype:  2 Objccode:  0 Name: Search
Objtype:  3 Objccode: 67 Prompt: A/R Trans Command: DO FORM WSEARCH WITH 0,"A/R Trans","Account","LIKE",""
Objtype:  3 Objccode: 67 Prompt: Agent Command: DO FORM WSEARCH WITH 0,"Agent","Cong","LIKE",""
Objtype:  3 Objccode: 67 Prompt: BO Detail Command: DO FORM WSEARCH WITH 0,"BO Detail","Account","LIKE",""
Objtype:  3 Objccode: 67 Prompt: BO Fulfill Command: DO FORM WSEARCH WITH 0,"BO Fulfill","Bookname","LIKE",""
Objtype:  3 Objccode: 67 Prompt: BO Title Command: DO FORM WSEARCH WITH 0,"BO Title","Code","LIKE",""
Objtype:  3 Objccode: 67 Prompt: Book Reviews Command: DO FORM WSEARCH WITH 0,"Book Reviews","Bookname","LIKE",""
Objtype:  3 Objccode: 67 Prompt: Book Set Command: DO FORM WSEARCH WITH 0,"Bookset","Setcode","LIKE",""
Objtype:  3 Objccode: 67 Prompt: Congregation Command: DO FORM WSEARCH WITH 0,"Congregation","Code","LIKE",""
Objtype:  3 Objccode: 67 Prompt: Consign Summary Command: DO FORM WSEARCH WITH 0,"Consign Summary","Bookcode","LIKE",""
Objtype:  3 Objccode: 67 Prompt: Consign Detail Command: DO FORM WSEARCH WITH 0,"Consign Detail","Bookcode","LIKE",""
Objtype:  3 Objccode: 67 Prompt: \<Customers Command: DO FORM WSRCHCUST WITH 0
Objtype:  3 Objccode: 67 Prompt: Gift Cert Command: DO FORM WSEARCH WITH 0,"Gift Cert","Gift No","LIKE",""
Objtype:  3 Objccode: 67 Prompt: Endinv Command: DO FORM WSEARCH WITH 0,"Endinv","Inv No","LIKE",""
Objtype:  3 Objccode: 67 Prompt: EndinvShip Command: DO FORM WSEARCH WITH 0,"EndinvShip","Inv No","LIKE",""
Objtype:  3 Objccode: 67 Prompt: Inventory Command: DO FORM WSEARCH WITH 0,"Inventory","Code","LIKE",""
Objtype:  3 Objccode: 67 Prompt: InvMiscEdit Command: DO FORM WSEARCH WITH 0,"InvMiscEdit","Code","LIKE",""
Objtype:  3 Objccode: 67 Prompt: InvSkuEdit Command: DO FORM WSEARCH WITH 0,"InvSkuEdit","Code","LIKE",""
Objtype:  3 Objccode: 67 Prompt: \<Invoice Command: DO FORM WSEARCH WITH 0,"Invoice","Invoice","LIKE",""
Objtype:  3 Objccode: 67 Prompt: \<Messenger Command: DO FORM WSRCHMOT WITH 0
Objtype:  3 Objccode: 67 Prompt: PO Summary Command: DO FORM WSEARCH WITH 0,"PO Summary","PO Num","LIKE",""
Objtype:  3 Objccode: 67 Prompt: PO Detail Command: DO FORM WSEARCH WITH 0,"PO Detail","PO Num","LIKE",""
Objtype:  3 Objccode: 67 Prompt: Purchases Command: DO FORM WSEARCH WITH 0,"Purchases","Code","LIKE",""
Objtype:  3 Objccode: 67 Prompt: Vendor Command: DO FORM WSEARCH WITH 0,"Vendor","Code","LIKE",""
Objtype:  3 Objccode: 67 Prompt: SS List Command: DO FORM WSEARCH WITH 0,"SS List","Cong","LIKE",""
Objtype:  3 Objccode: 67 Prompt: Users Command: DO FORM WSEARCH WITH 0,"Users","Machineid","LIKE",""
Objtype:  3 Objccode: 77 Prompt: \<Invoice
 
Objtype:  2 Objccode:  0 Name: INVOICE
Objtype:  3 Objccode: 67 Prompt: \<Workorders Command: DO FORM WSOWORK WITH 0
Objtype:  3 Objccode: 67 Prompt: \<Backorders Command: DO FORM wsearch WITH 0,"BO Fulfill","Bookname","LIKE",""
Objtype:  3 Objccode: 67 Prompt: Create \<Invoice Command: DO FORM WSOINVOICE WITH 0,""
Objtype:  3 Objccode: 67 Prompt: Analyze Invoice Command: DO FORM WSOANALYZE
Objtype:  3 Objccode: 78 Prompt: \-
Objtype:  3 Objccode: 67 Prompt: Print Invoice Label Command: DO FORM wsollabel
Objtype:  3 Objccode: 67 Prompt: Print Sales by Category Command: DO FORM wsosum
Objtype:  3 Objccode: 67 Prompt: Print Sales Totals by Bookcode Command: DO FORM wendinvsumquanbydate
Objtype:  3 Objccode: 67 Prompt: Print Invoice Summary by Date Command: DO FORM wendinv
Objtype:  3 Objccode: 67 Prompt: Print Invoice Summary by Book Code Command: DO FORM wendinvbybookcode
Objtype:  3 Objccode: 67 Prompt: Print Kansas Sales Tax Report Command: DO FORM WKSSALESTAX
Objtype:  3 Objccode: 67 Prompt: Print GST Report Command: DO FORM WGST
Objtype:  3 Objccode: 77 Prompt: I\<nventory
 
Objtype:  2 Objccode:  0 Name: Inventory
Objtype:  3 Objccode: 67 Prompt: Print Reorder List Command: DO INVTORDR IN WINREPORT
Objtype:  3 Objccode: 67 Prompt: Create Purchase Orders Command: DO FORM WINPURCH WITH 0
Objtype:  3 Objccode: 67 Prompt: Receive Purchase Order Command: DO FORM WINRECV1
Objtype:  3 Objccode: 67 Prompt: Receive/Adjust Inventory Command: DO FORM winrecv2 WITH ""
Objtype:  3 Objccode: 78 Prompt: \-
Objtype:  3 Objccode: 67 Prompt: Print Open Purchase Order List Command: DO INLISTPO IN WINREPORT
Objtype:  3 Objccode: 67 Prompt: Print Items on Order Command: DO INLISTOR IN WINREPORT
Objtype:  3 Objccode: 67 Prompt: Print History Purchase Order Command: DO FORM wsearch WITH 0,"PO Summary","PO Num","",""
Objtype:  3 Objccode: 67 Prompt: Print Item Transaction History Command: DO FORM WINTRANS
Objtype:  3 Objccode: 67 Prompt: Print Bookset Report Command: DO BOOKSET IN WINREPORT
Objtype:  3 Objccode: 78 Prompt: \-
Objtype:  3 Objccode: 80 Prompt: Inventory Valuation
-------------------------- 
Procedure: 

** CALCULATE VALUATION OF INVENTORY

* update the valuation for all inventory records
* based on current inventory count times cost
* and return the total
TEXT TO cSQL TEXTMERGE NOSHOW
    CALL usp_updatemastinvtvaluation()
ENDTEXT
gDB_SendSqlSelect(cSQL,"csrMastinvt",1124)
mValuation = csrMastinvt.s_valuation
USE IN "csrMastinvt"
MESSAGEBOX("Total inventory cost valuation:  
$"+TRANSFORM(mValuation),0+64,"Information")
-------------------------- 
Objtype:  3 Objccode: 67 Prompt: Print Count Sheets by Week Command: DO INCSW IN WINREPORT
Objtype:  3 Objccode: 67 Prompt: Print Count Sheets by Vendor Command: DO INCSV IN WINREPORT
Objtype:  3 Objccode: 78 Prompt: \-
Objtype:  3 Objccode: 67 Prompt: Consignment Activity Command: DO FORM wconsign
Objtype:  3 Objccode: 67 Prompt: Consignment Report Command: DO FORM wconsact
Objtype:  3 Objccode: 77 Prompt: \<Receivables
 
Objtype:  2 Objccode:  0 Name: RECEIVABLE
Objtype:  3 Objccode: 67 Prompt: Enter Payments Command: DO FORM WARROA WITH "",0.00
Objtype:  3 Objccode: 67 Prompt: Print Deposit Report Command: DO FORM WARDEPOS
Objtype:  3 Objccode: 78 Prompt: \-
Objtype:  3 Objccode: 67 Prompt: Print AR Balance Summary Command: DO FORM WARLIST
Objtype:  3 Objccode: 67 Prompt: Print AR Detail by Date Command: DO FORM WARTRAND
Objtype:  3 Objccode: 78 Prompt: \-
Objtype:  3 Objccode: 67 Prompt: Close Previous Statement Process Command: DO ardone IN warproc
Objtype:  3 Objccode: 67 Prompt: Open New Statement Process Command: DO FORM warbegin
Objtype:  3 Objccode: 67 Prompt: Print Customer Statement Summary Command: DO ARTRLIST IN WARREPORT
Objtype:  3 Objccode: 67 Prompt: Print Customer Statements Command: DO FORM WARSTMT WITH "",.F.,.F.
Objtype:  3 Objccode: 77 Prompt: \<Point of Sale
 
Objtype:  2 Objccode:  0 Name: PointofSal
Objtype:  3 Objccode: 67 Prompt: Create POS Invoices Command: DO FORM WPSINVOICE
Objtype:  3 Objccode: 78 Prompt: \-
Objtype:  3 Objccode: 67 Prompt: Reprint Receipt Command: DO FORM wsearch WITH 0,"Endinv","Customer","=","10000"
Objtype:  3 Objccode: 67 Prompt: Print X-Tape Command: DO FORM WPSXTAPE
Objtype:  3 Objccode: 67 Prompt: Print X-Tape (NEW) Command: DO FORM WPSXTAPE2
Objtype:  3 Objccode: 67 Prompt: Print Sales for Specified Dates Command: DO FORM WPSRTAPE
Objtype:  3 Objccode: 78 Prompt: \-
Objtype:  3 Objccode: 67 Prompt: Issue Gift Certificatei Command: DO FORM wgiftcert WITH 0
Objtype:  3 Objccode: 67 Prompt: Gift Certificate Activity Report Command: DO FORM WGIFTACTIVITY
Objtype:  3 Objccode: 67 Prompt: Gift Certificate Reconciliation Command: DO FORM WGIFTREC
Objtype:  3 Objccode: 77 Prompt: \<Lists
 
Objtype:  2 Objccode:  0 Name: Lists
Objtype:  3 Objccode: 67 Prompt: SS List Command: DO sslist IN wssproc
Objtype:  3 Objccode: 67 Prompt: SS Small Labels Command: DO sssmall IN wssproc
Objtype:  3 Objccode: 67 Prompt: SS Large Labels Command: DO sslarge IN wssproc
Objtype:  3 Objccode: 80 Prompt: SS Zone Totals
-------------------------- 
Procedure: 


* get query of ss zone totals
TEXT TO cSQL TEXTMERGE NOSHOW
    CALL usp_sszone()
ENDTEXT
gDB_SendSqlSelect(cSQL,"csrSszone",9999)
SELECT csrSszone

*get output choice
DO FORM WOUTPUT WITH 1,_Screen.UP_PrtReports TO 
mOutput
DO CASE
CASE mOutput=1    && preview
    REPORT FORM wsszone ;
        NOCONSOLE PREVIEW
CASE mOutput=2 OR mOutput=3    && printer
    mOkprint=.T.
    IF mOutput=2
        SET PRINTER TO NAME (_Screen.UP_PrtReports)
    ELSE
        mPrinter = ALLTRIM(GETPRINTER())
        IF !EMPTY(mPrinter)
            SET PRINTER TO NAME (mPrinter)
        ELSE
            mOkprint=.F.
        ENDIF
    ENDIF
    IF mOkprint
        REPORT FORM wsszone ;
            NOCONSOLE TO PRINTER
    ENDIF
    SET PRINTER TO
ENDCASE

USE IN "csrSszone"

-------------------------- 
Objtype:  3 Objccode: 77 Prompt: \<Time Clock
 
Objtype:  2 Objccode:  0 Name: TimeClock
Objtype:  3 Objccode: 67 Prompt: Clock In/Out Command: DO FORM WTIMECLOCK
Objtype:  3 Objccode: 67 Prompt: Print Time Report Command: DO FORM WTIMELIST
 

Helvetica Light is an easy to read font, with tall and narrow letters, that works well on almost every site.

Helvetica Light is an easy to read font, with tall and narrow letters, that works well on almost every site.