asltest.pas 926 B

123456789101112131415161718192021222324252627282930313233
  1. PROGRAM AslTest;
  2. uses Exec, Utility, Asl;
  3. {$I tagutils.inc}
  4. VAR
  5. fr : pFileRequester;
  6. dummy : BOOLEAN;
  7. thetags : array [0..3] of tTagItem;
  8. BEGIN
  9. AslBase := OpenLibrary(AslName,37);
  10. IF AslBase <> NIL THEN BEGIN
  11. thetags[0] := TagItem(ASLFR_InitialPattern,Longint(PChar('#?'#0)));
  12. thetags[1] := TagItem(ASLFR_TitleText,Longint(PChar('Test av ASL-Requester by NS'#0)));
  13. thetags[2] := TagItem(ASLFR_DoPatterns,1);
  14. thetags[3].ti_Tag := TAG_DONE;
  15. fr := AllocAslRequest(ASL_FileRequest,@thetags);
  16. IF fr <> nil THEN BEGIN
  17. dummy := AslRequest(fr,NIL);
  18. if dummy then begin
  19. writeln('The path is :',fr^.rf_Dir);
  20. writeln('And the file is :',fr^.rf_File);
  21. end else writeln('You canceled');
  22. FreeAslRequest(fr);
  23. END;
  24. CloseLibrary(AslBase);
  25. END else writeln('no asl.library');
  26. END.