amarqueetest.pas 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Program amarqueetest;
  2. {FPC Pascal test program that uses amarquee.library. Doesn't do much...}
  3. {just connects and sets a variable, then disconnects.}
  4. {
  5. Translated from PCQ pascal to FPC Pascal
  6. 25 Aug 2000.
  7. Update for fpc 1.0.7
  8. 30 Nov 2002.
  9. [email protected]
  10. }
  11. uses amarquee, utility;
  12. Var
  13. session : pQSession;
  14. setOpVal : longint;
  15. freeSessionVal : longint;
  16. const
  17. errid : longint = 0;
  18. begin
  19. {Connect to localhost}
  20. session := QNewSessionTags('localhost', 2957, 'pascal test',[QSESSION_ERRORCODEPTR,
  21. @errid,TAG_DONE]);
  22. if session = nil then begin
  23. writeln('Could not create connection to localhost/2957');
  24. writeln('the error was ',QErrorName(errid));
  25. halt(20);
  26. end;
  27. {Set a variable}
  28. setOpVal := QSetOp(session, 'testVal',pchar('just a test'#0), 12);
  29. if setOpVal = 0 then begin
  30. writeln('Warning, QSetOp failed.');
  31. end;
  32. {Close the connection}
  33. freeSessionVal := QFreeSession(session);
  34. end.