Question about 4GL Programing
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi all, I am a beginner of the 4GL programing. One question about the Input Array, What's the difference of using "Input Array .... Without defaults" and the one without the "Without defualts"? Thanks Joe joekao@erols.com
Chih-Ming Kao: > > Hi all, > I am a beginner of the 4GL programing. One question about the Input Array, > What's the difference of using "Input Array .... Without defaults" and the > one without the "Without defualts"? > Thanks > Joe > joekao@erols.com When using the "WITHOUT DEFAULTS"-clause, any values assigned to Your program-array will be shown and, without changes, will reside in Your program-array. Without "WITHOUT DEFAULTS", the default values will be assigned to those rows in Your array, which will be shown on Your screen. A little example, suggested You have a form with a screen-record of 5 rows called fr. GLOBALS DEFINE sr ARRAY[5] OF CHAR(10), i INTEGER END GLOBALS MAIN OPEN WINDOW w1 AT 2, 2 WITH FORM "myform" FOR i = 1 TO 5 LET sr[i] = "Line: ", i USING "&" END FOR CALL SET_COUNT(5) INPUT ARRAY sr WITHOUT DEFAULTS FROM fr.* CLOSE WINDOW w1 END MAIN In the code above You will see "Line: 1", "Line 2" and so on. When leaving the INPUT-ARRAY with pressing Your ACCEPT KEY, in sr will be those values You entered in Your INPUT-ARRAY or, if You didn't change a row, the original value (Line: x). If You chose INPUT ARRAY sr FROM fr.* # ( no WITHOUT DEFAULTS ) You will see 5 rows with the default value "" or any value You assigned as default in Your database definiton. When leaving Your INPUT You will get the entered value or the default-value, but the one You assigned with the LET-statement. Wolfgang