Files
MBS/TEST/MultipleDialogs/Folder/donations.4gl
T

49 lines
1.3 KiB
Plaintext

# Property of Four Js*
# (c) Copyright Four Js 1995, 2019. All Rights Reserved.
# * Trademark of Four Js Development Tools Europe Ltd
# in the United States and elsewhere
#
# Four Js and its suppliers do not warrant or guarantee that these
# samples are accurate and suitable for your purposes. Their inclusion is
# purely for information purposes only.
DEFINE donations DYNAMIC ARRAY OF RECORD
p_date DATE,
p_amount MONEY,
p_reason VARCHAR(250)
END RECORD
FUNCTION fill()
DEFINE i INT
FOR i=1 TO 5
LET donations[i].p_date = TODAY -10 +i
LET donations[i].p_amount = i+1
END FOR
END FUNCTION
DIALOG donations()
INPUT ARRAY donations FROM donations.*
AFTER FIELD p_amount
IF donations[arr_curr()].p_amount<2.0 THEN
ERROR "must be at least 2 dollar:-)"
NEXT FIELD CURRENT
END IF
AFTER ROW
IF arr_curr()<=arr_count() THEN
DISPLAY "AFTER ROW donations:check row and save to database"
END IF
END INPUT
END DIALOG
FUNCTION MAIN() -- This MAIN is for testing only.
OPEN FORM f FROM "donations"
DISPLAY FORM f
CALL FILL()
DIALOG
SUBDIALOG donations
ON ACTION ACCEPT
ACCEPT DIALOG
END DIALOG
END FUNCTION