home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 6 / 06.iso / a / a610 / 6.ddi / DEMO / FGL / PROSPECT.4GL < prev    next >
Encoding:
Text File  |  1989-12-08  |  751 b   |  30 lines

  1. DATABASE leads
  2. GLOBALS "globals.4gl"
  3.  
  4. FUNCTION prospect(uflag)
  5. {
  6. The prospect function displays the f_prospect form.
  7. Depending on the calling argument, it either inserts or
  8. updates a row in the prospect table.
  9.  
  10. uflag = 1 to add a new prospect,
  11. uflag = 2 to update an existing prospect
  12. }
  13. DEFINE   uflag          SMALLINT
  14.  
  15. OPEN FORM f_prospect FROM "f_prospect"
  16. DISPLAY FORM f_prospect
  17.  
  18. INPUT BY NAME pr_prospect.fname THRU pr_prospect.source WITHOUT DEFAULTS
  19. IF (uflag = 1) THEN
  20.    LET pr_prospect.ref = 0
  21.    INSERT INTO prospect VALUES (pr_prospect.*)
  22.    LET pr_prospect.ref = SQLCA.SQLERRD[2]
  23. ELSE
  24.    UPDATE prospect
  25.       SET prospect.* = pr_prospect.*
  26.       WHERE ref = pr_prospect.ref
  27. END IF
  28. CLEAR SCREEN
  29. END FUNCTION
  30.