home *** CD-ROM | disk | FTP | other *** search
/ Amiga Computing 57 / ac057a.adf / Demos / LVersion.bas < prev    next >
BASIC Source File  |  1989-03-16  |  891b  |  38 lines

  1.  
  2. ' a program to show various info about any library
  3. ' if run from the CLI then can specify library name on command line
  4. ' else prompted; .library not required
  5.  
  6. ' when compiling to disk, un-comment the next two lines
  7. 'REM $option y
  8. 'IF PEEKL(SYSTAB+8) THEN WINDOW 1,"LibVersion"
  9.  
  10. LIBRARY "exec.library"
  11. DECLARE FUNCTION OpenLibrary&(ptr&,ver&) LIBRARY
  12. DECLARE SUB CloseLibrary(lptr&) LIBRARY
  13.  
  14. PRINT "Compiled with HiSoft BASIC"
  15.  
  16. lib$=COMMAND$
  17. IF LEN(lib$)=0 THEN INPUT "Library name";lib$
  18. lib$=lib$+".library"+CHR$(0)
  19. l&=OpenLibrary(SADD(lib$),0)
  20. IF l&=0 THEN
  21.     PRINT "Library not found"
  22. ELSE
  23.     PRINT "Library: ";LEFT$(lib$,LEN(lib$)-1)," $";HEX$(l&)
  24.     PRINT "Version:";PEEKW(l&+20);"rev";PEEKW(l&+22)
  25.     id&=PEEKL(l&+24)
  26.     IF id& THEN
  27.         PRINT "ID     : ";
  28.         WHILE PEEKB(id&)>=32
  29.             PRINT CHR$(PEEKB(id&));
  30.             INCR id&
  31.         WEND
  32.         PRINT
  33.     END IF
  34.     PRINT "OpenCnt:";PEEKW(l&+32)
  35.     CloseLibrary l&
  36. END IF
  37.  
  38.