home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 6 / 06.iso / a / a610 / 6.ddi / DEMO / FGL / HELPDEMO.SRC < prev    next >
Encoding:
Text File  |  1989-12-08  |  15.9 KB  |  413 lines

  1. .101
  2. The Customer option presents you with a menu that allows you to:
  3.  
  4.       o   Add new customers to the database
  5.       o   Locate customers in the database
  6.       o   Update customer files
  7.       o   Remove customers from the database
  8.  
  9. .102
  10. The Orders option presents you with a menu that allows you to:
  11.  
  12.       o   Enter a new order and print an invoice
  13.       o   Update an existing order
  14.       o   Look up and display orders
  15.       o   Remove orders from the database
  16.  
  17. .103
  18. The Stock option presents you with a menu that allows you to:
  19.  
  20.       o   Add new items to the list of stock
  21.       o   Look up and display stock items
  22.       o   Modify current stock descriptions and values
  23.       o   Remove items from the list of stock
  24.  
  25. .104
  26. The Reports option presents you with a menu that allows you to:
  27.  
  28.       o   Select and print mailing labels sorted by zip code
  29.       o   Print a report of current accounts receivable
  30.       o   Print a report of backloged orders
  31.       o   Print a list of current stock available
  32.       o   Change the report output options
  33.  
  34. .105
  35. The Exit option leaves the program and returns you to the operating system.
  36.  
  37. .201
  38. The One-add option enables you to enter data on new customers to the database.
  39. You may get assistance on what input is appropriate for each field by pressing
  40. the function key F1 when the cursor is in the field.   When you  have  entered
  41. all the data you want for a given customer, press ESC to enter the data in the
  42. database. If you want to abort a given entry and not write it to the database,
  43. press CTRL-C.
  44.  
  45. .202
  46. The  Many-add  option  enables  you  to  enter  data  on  new customers to the
  47. database.  You may get assistance on what input is appropriate for each  field
  48. by  pressing  the  function key F1 when the cursor is in the field.   When you
  49. have  entered  all  the data you want for a given customer, press ESC to enter
  50. the data in the database.  If you want to abort a given entry and not write it
  51. to  the database, press CTRL-C.  After each entry, the cursor will move to the 
  52. beginning of the form and await  the  entry of the next customer.  If you have 
  53. no more customers to add, press  CTRL-Z  to return to the CUSTOMER Menu.
  54.  
  55. .203
  56. The Find-cust option allows you to select one or more customers and to display
  57. their  data  on the screen by using query-by-example input.  Use the RETURN or
  58. arrow  keys to move through the form.  Enter the criteria you want the program
  59. to use in searching for customers.  Your options include:
  60.  
  61.     o  Literal values
  62.     o  A range of values (separated by ":")
  63.     o  A list of values (separated by "|")
  64.     o  Relational operators (for example ">105")
  65.     o  Wildcards like ? and * to match single or any number of characters
  66.  
  67. .204
  68. The  Update-cust  option  enables  you  to  alter  data on old customers in the
  69. database.  You must first select a current customer row to deal with  by  using
  70. the  Find-cust option.  You may get assistance on what input is appropriate for
  71. each  field  by  pressing  the function key F1 when the cursor is in the field.
  72. When  you have altered all the data you want for a given customer, press ESC to
  73. enter the data in the database.  If you want to abort the changes and not write
  74. them to the database, press CTRL-C.
  75.  
  76. .205
  77. The  Delete-cust option enables you to remove customers from the database.  You
  78. must  first  select  a current customer row to deal with by using the Find-cust
  79. option.  For your protection, you will be asked  to  confirm  that  the  record
  80. should  be  deleted.   Once  deleted,  it  cannot  be restored.  Customers with
  81. active orders can not be deleted.
  82. .206
  83. The Exit option of the CUSTOMER Menu takes you back to the MAIN Menu.
  84.  
  85. .301
  86. The  Add-order  option enables you to add a new order for an existing customer.
  87. You must first select the desired  customer  using  query-by-example  selection
  88. criteria.  You will  then  enter  the  order  date,  PO  number,  and  shipping
  89. instructions.  The detail line items are then entered into a scrolling  display
  90. array.  Up to ten items may be entered using the four line screen array.  After
  91. the  new  order is entered, an invoice is automatically generated and displayed
  92. on the screen.
  93. .302
  94. The Update-order option is currently not implemented.
  95. .303
  96. The  Find-order  option  enables  you  to browse through and select an existing
  97. order.  You must first select the desired customer (or customers) who's  orders
  98. you  wish  to  scan.  For each customer selected, each corresponding order will
  99. be  displayed on the screen for examination.  You may either select an invoice,
  100. skip to the next invoice, or cancel processing.
  101. .304
  102. The Delete-order option is currently not implemented.
  103. .305
  104. The Exit option of the ORDER Menu returns you to the MAIN Menu.
  105.  
  106. .311
  107. You  may enter up to ten line items into the scrolling screen array.  A number
  108. of  standard  functions  are available for manipulating the cursor in a screen
  109. array.
  110.  
  111.     o  F2        Remove the current line from the screen array
  112.     o  F3        Insert new line in the screen array
  113.     o  Page Down    Down one page in the screen array
  114.     o  F4        Up one page in the screen array
  115.     o  ESC        Exit input array
  116.     o  CTRL-B        When in the Stock Number or Manufacturer Code 
  117.             fields, a window will open in the middle of the 
  118.             screen and display a scrolled list of all items 
  119.             in stock, identified by the stock number and 
  120.             manufacturer.  Using Page Down, Page Up, and the
  121.             the up and down arrow keys, move the cursor to the 
  122.             line that identifies the desired item and hit ESC.
  123.             The window will disappear and the selected information 
  124.             will automatically appear in the proper line.
  125.     o  etc...        The arrow-keys, and the standard field editing keys
  126.             are available
  127.  
  128. The item_total field will be displayed in reverse-video green for total 
  129. amounts over $500.
  130. .401
  131. The Add-stock option is currently not implemented.
  132. .402
  133. The Find-stock option is currently not implemented.
  134. .403
  135. The Update-stock option is currently not implemented.
  136. .404
  137. The Delete-stock option is currently not implemented.
  138. .405
  139. The Exit option of the STOCK Menu returns you to the MAIN Menu.
  140.  
  141. .501
  142. The Labels option enables you to create a  list  of  mailing  labels  generated
  143. using a query-by-example specification.  You will be prompted  for  the  output
  144. file name.
  145. .502
  146. The  Accounts-receivable  option enables you to create a report summarizing all
  147. unpaid  orders in the database.  You will be prompted for the output file name.
  148. .503
  149. The Backlog option is currently not implemented.
  150. .504
  151. The Stock-list option is currently not implemented.
  152. .505
  153. The  Options  option  enables  you  to  change  the  destination  of any report
  154. generated during the current session.  The default option  is  to  display  all
  155. reports  on the terminal screen.  The other options are to print all reports to
  156. either the printer or an operating system file.
  157. .506
  158. The Exit option of the REPORT Menu returns you to the MAIN Menu.
  159.  
  160. .1001
  161. The Number field on the Customer Form contains the serial integer  assigned  to
  162. the  customer  row  when  the  data  for the customer is first entered into the
  163. database.  It is a unique number for each customer.  The lowest value  of  this
  164. field is 101.
  165. .1002
  166. The first section following the Name label should contain the first name of the
  167. contact person at the customer's company.
  168. .1003
  169. The second section following the Name label should contain the last name of the
  170. contact person at the customer's company.
  171. .1004
  172. This field should contain the name of the customer's company.
  173. .1005
  174. The  first  line  of the Address section of the form should contain the mailing
  175. address of the company.
  176. .1006
  177. The  second  line  of  the Address section of the form should be used only when
  178. there  is  not  sufficient room in the first line to contain the entire mailing
  179. address.
  180. .1007
  181. The City field should contain the city name portion of the mailing  address  of
  182. the customer.
  183. .1008
  184. Enter  the two-character code for the desired state.  If no code is entered, or
  185. the entered code is not in the program's list of valid entries, a  window  will
  186. appear  on the screen with a scrolling list of all states and codes.  Using the
  187. Page Down,  Page Up, and up  and  down  arrow keys, move the cursor to the line
  188. containing the desired state.  After typing ESC, the window will disappear  and
  189. the  selected state code will appear in the customer entry screen.
  190. .1009
  191. Enter the five digit Zip Code in this field.
  192. .1010
  193. Enter  the  telephone  number  of the contact person at the customer's company.
  194. Include the Area Code and extension using the format "###-###-#### #####".
  195.  
  196. .2001
  197. The following is the INFORMIX-4GL source for the main menu.  Note that only
  198. the text is specified by the MENU statement; the structure and runtime menu
  199. functions are built-in.
  200.  
  201.     OPTIONS
  202.     HELP FILE "helpdemo"
  203.  
  204.     CALL ring_menu()
  205.     MENU "MAIN"
  206.     COMMAND "Customer" "Enter and maintain customer data" HELP 101
  207.         CALL customer()
  208.         CALL ring_menu()
  209.     COMMAND "Orders" "Enter and maintain orders" HELP 102
  210.         CALL orders()
  211.         CALL ring_menu()
  212.     COMMAND "Stock" "Enter and maintain stock list" HELP 103
  213.         CALL stock()
  214.         CALL ring_menu()
  215.  
  216.  
  217.     COMMAND "Reports" "Print reports and mailing labels" HELP 104
  218.         CALL reports()
  219.         CALL ring_menu()
  220.     COMMAND key("!")
  221.         CALL bang()
  222.         CALL ring_menu()
  223.         NEXT OPTION "Customer"
  224.         COMMAND key("X")
  225.         CALL demo()
  226.         CALL ring_menu()
  227.         NEXT OPTION "Customer"
  228.     COMMAND "Exit" "Exit program and return to operating system" HELP 105
  229.         CLEAR SCREEN
  230.         EXIT PROGRAM
  231.     END MENU
  232.  
  233. .2002
  234. The following is the INFORMIX-4GL source code for mailing-label selection and
  235. printing.  The CONSTRUCT statement manages the query-by-example input and
  236. builds the corresponding SQL where-clause.
  237.  
  238.     CONSTRUCT BY NAME where_part ON customer.*
  239.     LET query_text = "select * from customer where ", where_part CLIPPED,
  240.          " order by zipcode"
  241.     PREPARE mail_query FROM query_text
  242.     DECLARE label_list CURSOR FOR mail_query
  243.     PROMPT "Enter file name for labels >" FOR file_name
  244.     MESSAGE "Printing mailing labels to ", file_name CLIPPED," -- Please wait"
  245.  
  246.     START REPORT labels_report TO file_name
  247.     FOREACH label_list INTO p_customer.*
  248.         OUTPUT TO REPORT labels_report (p_customer.*)
  249.     END FOREACH
  250.     FINISH REPORT labels_report
  251.  
  252. See the source code option REPORT for the corresponding report routine.
  253. .2003
  254. The following is the INFORMIX-4GL source code for order entry using scrolled
  255. input fields.  Only the INPUT ARRAY statement in needed to utilize the full
  256. scrolling features.  Some additional code has been added merely to customize
  257. the array processing to this application.
  258.  
  259.     DISPLAY "Press ESC to write order" AT 1,1
  260.     INPUT ARRAY p_items FROM s_items.* HELP 311
  261.         BEFORE FIELD stock_num
  262.         MESSAGE "Enter a stock number."
  263.         BEFORE FIELD manu_code
  264.             MESSAGE "Enter the code for a manufacturer."
  265.         AFTER FIELD stock_num, manu_code
  266.             LET pa = arr_curr()
  267.         LET sc = scr_line()
  268.             SELECT description, unit_price
  269.                 INTO p_items[pa].description,
  270.                      p_items[pa].unit_price
  271.                 FROM stock
  272.         WHERE stock_num = p_items[pa].stock_num AND
  273.               stock_manu = p_items[pa].menu_code
  274.             DISPLAY p_items[pa].description, p_items[pa].unit_price
  275.         TO stock[sc].*
  276.             CALL item_total()
  277.         AFTER FIELD quantity
  278.             CALL item_total()
  279.     AFTER INSERT, DELETE, ROW
  280.         CALL order_total()
  281.     END INPUT
  282.  
  283. See the source code option QUERY-LANGUAGE for the SQL statements that
  284. insert the order information into the database.
  285. .2004
  286. The following is the INFORMIX-4GL source code that uses SQL to insert the
  287. entered order information into the database.  Note that the use of
  288. transactions ensures that database integrity is maintained, even if an
  289. intermediate operation fails.
  290.  
  291.     BEGIN WORK
  292.     LET p_orders.order_num = 0
  293.     INSERT INTO orders VALUES (p_orders.*)
  294.     IF status < 0 THEN
  295.     ROLLBACK WORK
  296.     MESSAGE "Unable to complete update of orders table"
  297.     RETURN
  298.     END IF
  299.     LET p_orders.order_num = SQLCA.SQLERRD[2]
  300.     DISPLAY BY NAME p_orders.order_num 
  301.     FOR i = 1 to arr_count()
  302.         INSERT INTO items
  303.             VALUES (p_items[counter].item_num, p_orders.order_num,
  304.                 p_items[counter].stock_num,    p_items[counter].manu_code,
  305.                 p_items[counter].quantity,     p_items[counter].total_price)
  306.         IF status < 0 THEN
  307.         ROLLBACK WORK
  308.         Message "Unable to insert items"
  309.         RETURN FALSE
  310.         END IF
  311.     END FOR
  312.     COMMIT WORK
  313. .2005
  314. The following is the INFORMIX-4GL source code that generates the mailing-label
  315. report.  See the source code option CONSTRUCT for the report calling sequence.
  316.  
  317.     REPORT labels_report (rl)
  318.         DEFINE rl RECORD LIKE customer.*
  319.         OUTPUT
  320.             TOP MARGIN 0
  321.             PAGE LENGTH 6
  322.         FORMAT
  323.             ON EVERY ROW
  324.                 SKIP TO TOP OF PAGE
  325.                 PRINT rl.fname CLIPPED, 1 SPACE, rl.lname
  326.                 PRINT rl.company
  327.                 PRINT rl.address1
  328.                 IF rl.address2 IS NOT NULL THEN
  329.                     PRINT rl.address2
  330.                 END IF
  331.                 PRINT rl.city CLIPPED, ", ", rl.state, 2 SPACES, rl.zipcode
  332.     END REPORT
  333. .2006
  334. The following is the INFORMIX-4GL source code that manages a simple form
  335. for data entry.  Note the use of special key definitions during data entry.
  336.  
  337.     OPEN FORM cust_form FROM "customer"
  338.     DISPLAY FORM cust_form
  339.  
  340.     MESSAGE "Press F1 or CTRL-F for field help;",
  341.         "F2 or CTRL-Z to return to CUSTOMER Menu"
  342.     DISPLAY "Press ESC to enter new customer data or CTRL-C to abort entry"
  343.     INPUT BY NAME p_customer.*
  344.     AFTER FIELD state
  345.         CALL statehelp()
  346.     ON KEY (F1, CONTROL-F)
  347.             CALL customer_help()
  348.     ON KEY (F2, CONTROL-Z)
  349.             CLEAR FORM
  350.             RETURN
  351.     END INPUT
  352. .2007
  353. The following is the INFORMIX-4GL source code that opens a window in the
  354. customer entry screen, displays the list of valid state names and codes, saves 
  355. the index into the p_state array for the selected state, closes the window, and
  356. returns the index to the calling routine.
  357.  
  358.     OPEN WINDOW w_state AT 8,40
  359.         WITH FORM "state_lis"
  360.         ATTRIBUTE (BORDER, RED, FORM LINE 2)
  361.  
  362.     CALL set_count(state_cnt)
  363.     DISPLAY ARRAY p_state TO s_state.*
  364.     LET idx = arr_curr()
  365.  
  366.     CLOSE WINDOW w_state
  367.     RETURN (idx)
  368. .2008
  369. The following is the INFORMIX-4GL source code that allows the user to browse
  370. through the rows returned by a "scroll" cursor.
  371.  
  372.     DECLARE customer_set SCROLL CURSOR FOR
  373.     SELECT * FROM customer
  374.         ORDER BY lname
  375.     OPEN customer_set
  376.     FETCH FIRST customer_set INTO p_customer.*
  377.     IF status = NOTFOUND THEN
  378.     LET exist = FALSE
  379.     ELSE
  380.         LET exist = TRUE
  381.     DISPLAY BY NAME p_customer.*
  382.     MENU "BROWSE"
  383.         COMMAND "Next" "View the next customer in the list"
  384.         FETCH NEXT customer_set INTO p_customer.*
  385.         IF status = NOTFOUND THEN
  386.             ERROR "No more customers in this direction" 
  387.             FETCH LAST customer_set INTO p_customer.*
  388.         END IF
  389.         DISPLAY BY NAME p_customer.*  
  390.         COMMAND "Previous" "View the previous customer in the list"
  391.         FETCH PREVIOUS customer_set INTO p_customer.*
  392.         IF status = NOTFOUND THEN
  393.             ERROR "No more customers in this direction" 
  394.             FETCH FIRST customer_set INTO p_customer.*
  395.         END IF
  396.         DISPLAY BY NAME p_customer.*  
  397.         COMMAND "First" "View the first customer in the list"
  398.         FETCH FIRST customer_set INTO p_customer.*
  399.         DISPLAY BY NAME p_customer.*  
  400.         COMMAND "Last" "View the last customer in the list"
  401.         FETCH LAST customer_set INTO p_customer.*
  402.         DISPLAY BY NAME p_customer.*  
  403.         COMMAND "Select" "Exit BROWSE selecting the current customer"
  404.         LET chosen = TRUE
  405.         EXIT MENU
  406.         COMMAND "Quit" "Quit BROWSE without selecting a customer"
  407.         LET chosen = FALSE
  408.         EXIT MENU
  409.     END MENU
  410.     END IF
  411.     CLOSE customer_set
  412.  
  413.