home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / BEERMAT / BEERMAT1.MSA / BITS.STB / GFAPROB3.LST < prev    next >
File List  |  1994-07-22  |  873b  |  27 lines

  1. ' (C) Terry King / ST Beermat 1994
  2. '
  3. PROCEDURE save_icons
  4.   OPEN "O",#1,"icons.dat"      ! Open a new file
  5.   OUT% #1,no_icons&            ! Store number of icons
  6.   FOR a&=0 TO no_icons&-1      ! Number of icons
  7.     OUT& #1,40                 ! Store width
  8.     OUT& #1,20                 ! Store height
  9.     length%=LEN(i$(a&))        ! Get string length
  10.     OUT% #1,length%            ! Store length of string
  11.     BPUT #1,V:i$(a&),length%   ! Store the string
  12.   NEXT a&
  13.   CLOSE #1
  14. RETURN
  15. PROCEDURE load_icons
  16.   OPEN "R",#1,"icons.dat"
  17.   no_icons&=INP%(#1)
  18.   FOR a&=0 TO no_icons&-1
  19.     w&=INP&(#1)                ! Get width
  20.     h&=INP&(#1)                ! Get height
  21.     GET 1,1,w&,h&,i$(a&)       ! Create string
  22.     length%=INP%(#1)           ! Get length
  23.     BPUT #1,V:i$(a&),length%   ! Store icon in empty string
  24.   NEXT a&
  25.   CLOSE #1
  26. RETURN
  27.