home *** CD-ROM | disk | FTP | other *** search
- DATABASE leads
- GLOBALS "globals.4gl"
-
- FUNCTION prospect(uflag)
- {
- The prospect function displays the f_prospect form.
- Depending on the calling argument, it either inserts or
- updates a row in the prospect table.
-
- uflag = 1 to add a new prospect,
- uflag = 2 to update an existing prospect
- }
- DEFINE uflag SMALLINT
-
- OPEN FORM f_prospect FROM "f_prospect"
- DISPLAY FORM f_prospect
-
- INPUT BY NAME pr_prospect.fname THRU pr_prospect.source WITHOUT DEFAULTS
- IF (uflag = 1) THEN
- LET pr_prospect.ref = 0
- INSERT INTO prospect VALUES (pr_prospect.*)
- LET pr_prospect.ref = SQLCA.SQLERRD[2]
- ELSE
- UPDATE prospect
- SET prospect.* = pr_prospect.*
- WHERE ref = pr_prospect.ref
- END IF
- CLEAR SCREEN
- END FUNCTION
-