11-22-2023, 09:37 PM
OK, I actually tested out the following code:
First it prints 4 then 8. The "test" variable inside the subprogram is "protected", of type INTEGER which is two bytes. Although there is a variable named just like it which is supposed to be accessible inside that subprogram which is twice as large.
Without STATIC declaration line the second PRINT test would give 10.
On Spiral Linux KDE (Debian "Bullseye" clone), I compile this program:
to get this executable file:
Commenting out "setmyfont" line just below SCREEN statement will not do anything about it. Must remove "setmyfont" call and definition entirely from the program, if that's the only thing that will have anything to do with fonts.
Code: (Select All)
DIM SHARED test AS LONG
test = 4
PRINT test
callthisthing test
PRINT test
PRINT "End of my tests!"
END
SUB callthisthing (u AS LONG)
STATIC test AS INTEGER
test = test + 1
u = u * 2
END SUB
First it prints 4 then 8. The "test" variable inside the subprogram is "protected", of type INTEGER which is two bytes. Although there is a variable named just like it which is supposed to be accessible inside that subprogram which is twice as large.
Without STATIC declaration line the second PRINT test would give 10.
On Spiral Linux KDE (Debian "Bullseye" clone), I compile this program:
Code: (Select All)
SCREEN _NEWIMAGE(640, 480, 12)
setmyfont
PRINT "Print this for me in different letters!"
END
SUB setmyfont ()
DIM afont AS STRING, han AS LONG
afont = "/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf"
han = _LOADFONT(afont, 24)
_FONT han
END SUB
to get this executable file:
Code: (Select All)
-rwxr-xr-x 1 fc fc 1734368 Nov 22 16:33 nd22-2
Commenting out "setmyfont" line just below SCREEN statement will not do anything about it. Must remove "setmyfont" call and definition entirely from the program, if that's the only thing that will have anything to do with fonts.