home *** CD-ROM | disk | FTP | other *** search
AmigaBASIC Source Code | 1991-08-16 | 1.5 KB | 70 lines |
- REM - This demo program shows how to
- REM - call Amiga system routines from
- REM - AmigaBasic.
- REM - Difference to program Library:
- REM - also disk resident fonts can
- REM - be activated.
-
- DECLARE FUNCTION AskSoftStyle& LIBRARY
- DECLARE FUNCTION OpenDiskFont& LIBRARY
- DECLARE FUNCTION Execute& LIBRARY
-
- LIBRARY "graphics.library"
- LIBRARY "diskfont.library"
-
- enable%=AskSoftStyle&(WINDOW(8))
- Font "topaz.font",8,0,0
- FOR i=0 TO 4
- SetStyle CINT(2^i)
- NEXT i
-
- PRINT :PRINT
-
- Font "opal.font",12,0,0
- enable%=AskSoftStyle&(WINDOW(8))
- FOR i=0 TO 4
- SetStyle CINT(2^i)
- NEXT i
-
- SetStyle 0
- Font "topaz.font",8,0,0
- Font "",0,0,0 ' closes last font
-
- REM --- Next line only works, if
- REM --- AmigaBasic was called from
- REM --- CLI and not from Workbench.
- ' DosLibDemo
- LIBRARY CLOSE
- END
-
- SUB Font(fontName$, height%, style%, prefs%) STATIC
- SHARED pFont&
- ' Herewith every font (also form disk) useable.
- IF pFont&<>0 THEN CALL CloseFont(pFont&)
- fontName0$=fontName$+CHR$(0)
- textAttr&(0)=SADD(fontName0$)
- textAttr&(1)=height%*65536 + style%*256 + prefs%
- pFont&=OpenDiskFont&(VARPTR(textAttr&(0)))
- IF pFont& <> 0 THEN SetFont WINDOW(8),pFont&
- END SUB
-
- SUB SetStyle(mask%) STATIC
- SHARED enable%
- SetSoftStyle WINDOW(8),mask%,enable%
- PRINT "SetSoftStyle(";mask%;")"
- END SUB
-
- SUB DosLibDemo STATIC
- LIBRARY "dos.library"
- ' This activates the function Execute from dos.library.
- x=Execute&(SADD("list >RAM:temp"+CHR$(0)), 0, 0)
- OPEN "RAM:temp" FOR INPUT AS 1
- WHILE NOT EOF(1)
- LINE INPUT #1,a$
- PRINT a$
- WEND
- CLOSE
- KILL "RAM:temp"
- END SUB
-
-