Function order_query

This function allows the user to search for a specific order by entering criteria into the form (Query by Example). This CONSTRUCT statement is not a sub-dialog of a DIALOG statement. It is a stand-alone statement called by the action find, triggered when the user selects the corresponding menu item or toolbar icon on the form orderform.

Function order_query (orders.4gl):
01 FUNCTION order_query()
02   DEFINE where_clause STRING,
03         id INTEGER, name STRING
04
05   MESSAGE msg02
06   CLEAR FORM
07
08   WHILE TRUE
09     LET int_flag = FALSE
10     CONSTRUCT BY NAME where_clause ON
11       orders.store_num,
12       customer.store_name,
13       orders.order_num,
14       orders.order_date,
15       orders.fac_code 
16
17       ON ACTION zoom1
18         CALL display_custlist() RETURNING id, name 
19         IF id > 0 THEN
20           DISPLAY id TO orders.store_num 
21           DISPLAY name TO customer.store_name 
22         END IF
23
24       ON ACTION about 
25         CALL __mbox_ok(title1,msg18,"information")
26
27     END CONSTRUCT
28
29     IF int_flag THEN
30       MESSAGE msg03
31       IF arr_ordnums.getLength()==0 THEN
32         IF __mbox_yn(title1,msg15,"stop") THEN
33           EXIT PROGRAM
34         END IF
35         CONTINUE WHILE
36       END IF
37       RETURN
38     ELSE
39       IF order_select(where_clause) THEN
40         EXIT WHILE
41       END IF
42     END IF
43   END WHILE
44
45 END FUNCTION
Note: