home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a044 / 3.ddi / MISC / DDECLIEN.PRG < prev    next >
Encoding:
Text File  |  1993-08-31  |  2.3 KB  |  75 lines

  1. * This is the Client Application.
  2. * This does all of the work.  It gets all of the variables both
  3. * from the DBF in the Server application and from the memory
  4. * variables in the Server application.
  5.  
  6. STORE SECONDS() TO MSEC
  7. STORE .F. TO ContactMade
  8. ? "Trying to establish contact with DDESAMP.DBF...."
  9. DO WHILE SECONDS()-MSEC<10 && try to contact the DBF for 10 SECONDS
  10.    TALK TO DDESERVE ABOUT DDESAMP        && Setup the link
  11.    IF CONTACT()                            && if we made contact
  12.      STORE .T. TO ContactMade
  13.      ?
  14.      ? "Contact established..."
  15.      EXIT
  16.    ENDIF
  17.    CHKEVENT()                && always check for any events
  18. ENDDO
  19. IF .not. ContactMade        && contact not established--give up
  20.    ?
  21.    ? "CONTACT WAS NEVER MADE WITH THE DBF!"
  22.    WAIT
  23. ELSE     && If we get to this point, we have made contact
  24.    EXECUTE "GO TOP"            && execute this command in the server app.
  25.    STORE REQUEST("FIELD1") TO VAR1   && get data
  26.    STORE REQUEST("FIELD2") TO VAR2
  27.    STORE REQUEST("FIELD3") to VAR3
  28.    ?
  29.    ? "FIELD 1 DATA (Character Field): "
  30.    ?? VAR1
  31.    ? "FIELD 2 DATA (Date Field): "
  32.    ?? VAR2
  33.    ? "FIELD 3 DATA (Numeric Field): "
  34.    ?? alltrim(VAR3)
  35.    EXECUTE "SKIP"         && go to the next record in DDESAMP
  36.    STORE REQUEST("FIELD1") TO VAR4            && get more data
  37.    STORE CTOD(REQUEST("FIELD2")) TO VAR5
  38.    ?
  39.    ? "FIELD 1 DATA FROM RECORD 2 (Character Field): "
  40.    ?? VAR4
  41.    ? "FIELD 2 DATA FROM RECORD 2 (Date Field): "
  42.    ?? VAR5
  43.    TERMINATE            && cut the link
  44. ENDIF
  45.  
  46. STORE SECONDS() TO MSEC
  47. STORE .F. TO ContactMade
  48. ?
  49. ? "Trying to establish contact with MEMORY..."
  50. DO WHILE SECONDS()-MSEC<10 && Try to contact MEMORY for 10 SECONDS
  51.    TALK TO DDESERVE ABOUT MEMORY        && setup the link
  52.    IF CONTACT()                            && check for contact
  53.      STORE .T. TO ContactMade
  54.      ?
  55.      ? "Contact established..."
  56.      EXIT
  57.    ENDIF
  58.    CHKEVENT()                    && always check for windows events
  59. ENDDO
  60. IF .not. ContactMade            && contact not made
  61.    ?
  62.    ? "CONTACT WAS NEVER MADE WITH MEMORY!"
  63.    WAIT
  64. ELSE     && If we get to this point, we have made contact
  65.    STORE VAL(REQUEST("RECORDNO")) TO VAR6        && get data
  66.    STORE REQUEST("CHARVAR") TO VAR7
  67.    ?
  68.    ? "NUMERIC VARIABLE: "
  69.    ?? alltrim(str(VAR6))
  70.    ? "CHARACTER VARIABLE: "
  71.    ?? VAR7
  72.    TERMINATE                    && cut the link
  73. ENDIF
  74.  
  75. WAIT "DONE!!!"