Windoze 3.0 Advice
Windoze 3.0 Advice
Hi All,
can someone help me about a bit. I am trying to get a simple Windzoe application to work but I am not having any
luck.
this is the errors I am getting when I try to run the example WIN3.BAS File
FbTemp.bas(480) error 74: Var-len arrays cannot be initialized, before '{'
STATIC SHARED InternalFont(0 TO 318) AS SHORT => {-7937, -8199, -16480, -8199, -7937, -1, -16136, -16388, -15361, -16392,_
^
FbTemp.bas(1452) warning 11(0): Implicit variable allocation, DSPDataAvail
FbTemp.bas(2550) warning 11(0): Implicit variable allocation, bx
FbTemp.bas(2550) warning 11(0): Implicit variable allocation, cx
FbTemp.bas(2550) warning 11(0): Implicit variable allocation, dx
FbTemp.bas(2580) warning 11(0): Implicit variable allocation, bx
FbTemp.bas(4604) warning 11(0): Implicit variable allocation, bufferlen
FbTemp.bas(4616) warning 11(0): Implicit variable allocation, voff
can someone explain to me please what i am doing wrong
can someone help me about a bit. I am trying to get a simple Windzoe application to work but I am not having any
luck.
this is the errors I am getting when I try to run the example WIN3.BAS File
FbTemp.bas(480) error 74: Var-len arrays cannot be initialized, before '{'
STATIC SHARED InternalFont(0 TO 318) AS SHORT => {-7937, -8199, -16480, -8199, -7937, -1, -16136, -16388, -15361, -16392,_
^
FbTemp.bas(1452) warning 11(0): Implicit variable allocation, DSPDataAvail
FbTemp.bas(2550) warning 11(0): Implicit variable allocation, bx
FbTemp.bas(2550) warning 11(0): Implicit variable allocation, cx
FbTemp.bas(2550) warning 11(0): Implicit variable allocation, dx
FbTemp.bas(2580) warning 11(0): Implicit variable allocation, bx
FbTemp.bas(4604) warning 11(0): Implicit variable allocation, bufferlen
FbTemp.bas(4616) warning 11(0): Implicit variable allocation, voff
can someone explain to me please what i am doing wrong
Re: Windoze 3.0 Advice
Seems it already failed in 2010: http://www.freebasic.net/forum/viewtopic.php?t=15554Gablea wrote: can someone help me about a bit. I am trying to get a simple Windzoe application to work but I am not having any
luck.
There it says to use the fblite dialect, and it seems to be for the dos target, so use the dos compiler (the 16-bit ax/bx/cx/dx references already indicate that)
Re: Windoze 3.0 Advice
You have to use -lang fblite (as far as I recall, you already used windoze 3.0 in the past... you also sent me some mail about it)
Windoze should work on other targets, not only dos: the 16 bit ax/bx references are not used, they're only leftovers of the 16 bit version (windoze is a rough port of a 16 bit qbasic program)
Windoze should work on other targets, not only dos: the 16 bit ax/bx references are not used, they're only leftovers of the 16 bit version (windoze is a rough port of a 16 bit qbasic program)
Re: Windoze 3.0 Advice
Well I put that project on the back burner as I moved my systems into Windows.
Now I want to make a DOS version (mainly to pass the time when I am not working)
i am now getting this error message when i changed the language option
C:\Program Files\FreeBASIC\fbc -lang fblite "WIN3.BAS"
WIN3.BAS(758) error 74: Var-len arrays cannot be initialized, before '{'
STATIC SHARED InternalFont(0 TO 318) AS SHORT => {-7937, -8199, -16480, -8199, -7937, -1, -16136, -16388, -15361, -16392,_
^
Build error(s)
I have no idea what this means
Now I want to make a DOS version (mainly to pass the time when I am not working)
i am now getting this error message when i changed the language option
C:\Program Files\FreeBASIC\fbc -lang fblite "WIN3.BAS"
WIN3.BAS(758) error 74: Var-len arrays cannot be initialized, before '{'
STATIC SHARED InternalFont(0 TO 318) AS SHORT => {-7937, -8199, -16480, -8199, -7937, -1, -16136, -16388, -15361, -16392,_
^
Build error(s)
I have no idea what this means
-
- Site Admin
- Posts: 6323
- Joined: Jul 05, 2005 17:32
- Location: Manchester, Lancs
Re: Windoze 3.0 Advice
I suspect you have Option Dynamic or '$DYNAMIC in your code somewhere. That means your array, despite having constant bounds, is dynamic, and dynamic arrays can't be initialised.
Re: Windoze 3.0 Advice
do i still need the winfont.bas file? if so where would i get it from.
i have not changed anything in the code.
also can i mix xfont with the windoze code?
i have not changed anything in the code.
also can i mix xfont with the windoze code?
Re: Windoze 3.0 Advice
The font is embedded in the InternalFont array (all these numbers between curly brackets), you don't need external files.
I never tried xfonts with windoze, and I doubt anybody else tried, so I don't know if it works.
I never tried xfonts with windoze, and I doubt anybody else tried, so I don't know if it works.
Re: Windoze 3.0 Advice
A quick and dirty way to get win3.bas compiled.
Add #lang "fblite" before defint a-z
Change the line
static shared internalfont (0 to 318) as short => { .....
into
static shared internalfont (0 to 318) as short : data ....
Remove the curly bracket at the end of the data block (}).
Insert at the end of the data block the following lines
for i = 0 to 318
read internalfont(i)
next
And the program will compile without error messages.
The program has a slow response to mouse-clicks and it complained that it could not find the Sound Blaster settings. The first window it produced showed the data and time but the window was to small so a part was printed outside the window.
Have fun.
Add #lang "fblite" before defint a-z
Change the line
static shared internalfont (0 to 318) as short => { .....
into
static shared internalfont (0 to 318) as short : data ....
Remove the curly bracket at the end of the data block (}).
Insert at the end of the data block the following lines
for i = 0 to 318
read internalfont(i)
next
And the program will compile without error messages.
The program has a slow response to mouse-clicks and it complained that it could not find the Sound Blaster settings. The first window it produced showed the data and time but the window was to small so a part was printed outside the window.
Have fun.
-
- Site Admin
- Posts: 6323
- Joined: Jul 05, 2005 17:32
- Location: Manchester, Lancs
Re: Windoze 3.0 Advice
Actually, now I think about it, it'd probably be enough just to put Option Static before the Static Shared line, and Option Dynamic again after it.
Re: Windoze 3.0 Advice
Thanks Guys
it Complies Now SO I shall be having a play with it over the next few hours
it Complies Now SO I shall be having a play with it over the next few hours
Re: Windoze 3.0 Advice
That works, thanks.counting_pine wrote:Actually, now I think about it, it'd probably be enough just to put Option Static before the Static Shared line, and Option Dynamic again after it.
Re: Windoze 3.0 Advice
@angros47
DO you know if i can use XFont with windoze 3.0? I or can the built in text be made bigger?
DO you know if i can use XFont with windoze 3.0? I or can the built in text be made bigger?
Re: Windoze 3.0 Advice
Built in text cannot be made any bigger, at least not easily, because it's achieved with the PUT command for every character. Actually, there are some ways to allow PUT to scale/rotate an image, but it would be slow (and, if you are using a DOS machine, usually it's an old computer, with poor performances... and FreeBasic graphics is not really optimized for DOS, too).
Even if you managed to use a scaling PUT, default font data are stored as 6x8 pixels per character... so if you upscale them you'd get an horribly pixelated result.
I haven't tried XFonts, but its documentation states that it's OOP, so it should be used in -lang FB, and windoze runs in -lang fblite, so they cannot be used at the same time without some rewrite.
Even if you managed to use a scaling PUT, default font data are stored as 6x8 pixels per character... so if you upscale them you'd get an horribly pixelated result.
I haven't tried XFonts, but its documentation states that it's OOP, so it should be used in -lang FB, and windoze runs in -lang fblite, so they cannot be used at the same time without some rewrite.