Quickbasic Cafe Forum

New to FreeBASIC? Post your questions here.
I Daniel
Posts: 43
Joined: May 13, 2010 10:34
Location: Centurion, South Africa

Quickbasic Cafe Forum

Postby I Daniel » Nov 15, 2014 7:27

If anyone is interested this forum is again on the air. The old passwords are also still valid.
their link is: http://qbasic-forum.qbasic.net/
FotonCat
Posts: 37
Joined: Nov 26, 2009 11:47
Location: Russia
Contact:

Re: Quickbasic Cafe Forum

Postby FotonCat » Nov 16, 2014 14:09

It displays an error 403 for now. :/
I Daniel
Posts: 43
Joined: May 13, 2010 10:34
Location: Centurion, South Africa

Re: Quickbasic Cafe Forum

Postby I Daniel » Nov 17, 2014 6:11

I have just now clicked on the link and it worked okay. (08:10 SA time)
bcohio2001
Posts: 556
Joined: Mar 10, 2007 15:44
Location: Ohio, USA
Contact:

Re: Quickbasic Cafe Forum

Postby bcohio2001 » Nov 17, 2014 15:20

Link does work, but last post was 2010?
Talk about a "dead" forum. This should have been in the grave 4 years ago.
I Daniel
Posts: 43
Joined: May 13, 2010 10:34
Location: Centurion, South Africa

Re: Quickbasic Cafe Forum

Postby I Daniel » Nov 19, 2014 8:14

That is when it went off the air.

Apparently it has been resurrected.

I think It still remains a good start for using Freebasic
dodicat
Posts: 6720
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Quickbasic Cafe Forum

Postby dodicat » Nov 19, 2014 11:06

Was it closed for four years?

I have used it within these last four years.
Here is a link I posted last year:
http://www.freebasic.net/forum/viewtopic.php?f=3&t=20868&p=184594&hilit=%2Acafe%2A#p184594
I Daniel
Posts: 43
Joined: May 13, 2010 10:34
Location: Centurion, South Africa

Re: Quickbasic Cafe Forum

Postby I Daniel » Nov 19, 2014 20:44

@ Dodicat
Oops you are quite right. It went off the air sometime in 2013. It could have been resurrected sooner but although I found references to it when doing a Google search I could not find the forum so I gave it up as a bad job. I see the last post was by me in Sept 2010.
(I haven't checked the german section of the QB Cafes forum)
MrSwiss
Posts: 3634
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Quickbasic Cafe Forum

Postby MrSwiss » Nov 20, 2014 13:10

I Daniel wrote:I think It still remains a good start for using Freebasic

I disagree strongly with above: NOOB's should learn FB syntax from the start,
NOT some "Stonehenge"-version of BASIC !!
(which gave BASIC a really BAD reputation, in times gone by, fortunately)

So: The ONE and ONLY usefull place is HERE, at freebasic.net !!
marcov
Posts: 3019
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: Quickbasic Cafe Forum

Postby marcov » Nov 20, 2014 14:00

Can you run QB and QB generated files under 64-bit windows at all, without resorting to dosbox?

Setting up emulators is not really newbie friendly.
I Daniel
Posts: 43
Joined: May 13, 2010 10:34
Location: Centurion, South Africa

Re: Quickbasic Cafe Forum

Postby I Daniel » Nov 20, 2014 15:20

@ MrSwiss
Now now, take it easy, no need to shout. QB4.5 is definitely not stonehenge . It is a well structured programming language. Using it as a stepping stone is as far as i am concerned still valid and apart from having to make some slight changes it does compile to 32-bit freebasic files.

QB is not 100% compatible because FB left some features off, but tell me why does FB support -lang qb and -lang fblite if it originally wasn't meant as an enhancement, advancement and an "upgrade" to use fb. V1ktor was as far as I know the pioneer and this appeared to be his aim. Using what he had and making it better. Then take Joshy with his sound routines. and bit by bit FB was extended by some darn hardworking programmers.
But hey does it's printer routines work any better than qb4.5. I haven't checked this lately but the last time I did it didn't work too well.
You don't teach someone to swim by throwing him in the deep-end. You take what he knows and then build upon it and that is how FB progressed.

My suggestion is not iro NOOBS to programming but Basic programmers who want to use the extra "goodies" of FB.

Then you have it that FB also has a DOS forum !! Why?

@ Marcov. Hi old friend long time I have not been here.
Qb is as you know 16 bit so it needs Dosbox to run on Vista and Windows 7 and up. Even FB 32-bit did not work well on Windows 7.
Last year Don and Theunis could not get it to work very well and choosing a printer was impossible. The colours on Windows 7 after compiling with Freebasic just went haywire or ended up as blank screens. But... Dosbox did not cater for the printers either.

To get fullscreen you had to put a shortcut on the Desktop, otherwise you ended up with a tiny screen.

I see there are still some posts concerning "LPT" and apparently the only thing that really works is to use "Shell Print data.dat" but it automatically chooses the default printer and thus not the one you wish to use if you are using more than one printer.

If I am phaffing a bit remember I am rather ancient (the same age as Theunis) and never used anything except Sharp Basic and QB4.5
Can't the guys who wrote FBIde be coerced or begged or honeyd to donate their printer routine to FB?
RockTheSchock
Posts: 232
Joined: Mar 12, 2006 16:25

Re: Quickbasic Cafe Forum

Postby RockTheSchock » Nov 20, 2014 16:39

I Daniel wrote:Can't the guys who wrote FBIde be coerced or begged or honeyd to donate their printer routine to FB?


As far as i know in DOS days you had to write your own PCL or PS routines for a specific printer or you had to write epson dot maxtrix compatible routines. So to print something pretty you had to know every detail.

Under windows you have some comfortable options.
- Create an HTML-Page, invoke it and send STRG+P to the browser
- Use WinAPI Printing Functions To Print Text or a raster image

Example by D.J.Peters
viewtopic.php?f=7&t=21896#p192811

Code: Select all

#include once "windows.bi"
#include once "win/wingdi.bi"
#include once "win/commdlg.bi"

sub PrintImage(p as any ptr=0, Stretched as integer=1)
   static as integer id=0
   if screenptr()=0 then return
   dim as HWND hWin : Screencontrol 2,cast(integer,hWin)
   id+=1
   'dim as string path = environ("Tmp")
   'if right(path,1)<>"\" then path += "\"
   'dim as string file = path & "printjob" & id & ".bmp"
   'BSave path, p
    dim as string file = "printjob" & id & ".bmp"
     BSave file, 0
   ' get printer DC
   dim as PRINTDLG pd
   with pd
      .lStructSize = sizeof(PRINTDLG)
      .hwndOwner = hWin
      .Flags = PD_RETURNDC
   end with
   PrintDlg(@pd)
   dim as HDC hDCPrinter =pd.hDC
   If hDCPrinter = 0 then
      WindowTitle "error:  hDCPrinter = NULL ! "
      beep : sleep : end 1
   end If
   if hDCPrinter then
      dim as HBITMAP hBitmap = LoadImage(NULL,File,IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION or LR_DEFAULTSIZE or LR_LOADFROMFILE)
      if hBitmap then
         dim as BITMAP bm
         GetObject(hBitmap,sizeof(BITMAP),@bm)
         dim as DOCINFO di
         with di
            .cbSize = sizeof(DOCINFO)
            .lpszDocName =strptr(file)
         end with

         dim as HDC hDCMemory = CreateCompatibleDC(hDCPrinter)
         dim as HBITMAP hOldBitmap = SelectObject(hDCMemory, hBitmap)
         StartDoc(hDCPrinter, @di)
         StartPage(hDCPrinter)
         if Stretched then
            dim as integer PrinterW = GetDeviceCaps(hDCPrinter, HORZRES)
            dim as integer PrinterH = GetDeviceCaps(hDCPrinter, VERTRES)
            dim as single MaxPixels = iif(bm.bmWidth>bm.bmHeight,bm.bmWidth,bm.bmHeight)
            dim as single RowDotsPerPixele = PrinterW/MaxPixels
            dim as single ColDotsPerPixele = PrinterH/MaxPixels
            if ColDotsPerPixele>RowDotsPerPixele then
               PrinterH=RowDotsPerPixele*bm.bmHeight
            else
               PrinterH=RowDotsPerPixele*bm.bmWidth
            end if
            SetMapMode (hDCPrinter, MM_ISOTROPIC)
            SetWindowExtEx(hDCPrinter, PrinterW,PrinterH, NULL)
            SetViewportExtEx(hDCPrinter, PrinterW, PrinterH,NULL)
            SetViewportOrgEx(hDCPrinter, 0, 0, NULL)
            StretchBlt(hDCPrinter,0,0,PrinterW,PrinterH, hDCMemory,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY)
         else
            BitBlt(hDCPrinter,0,0,bm.bmWidth,bm.bmHeight, hDCMemory,0,0,SRCCOPY)
         end If
         EndPage(hDCPrinter)
         EndDoc(hDCPrinter)
         SelectObject(hDCMemory, hOldBitmap)
         DeleteDC(hDCMemory)
         DeleteObject hBitmap
      end if
      DeleteDC(hDCPrinter)
   end if
end Sub



ScreenRes 640,480,32
Color 0,&HFFFFFFFF : Cls
circle (320,240),100
line (0,0)-(639,479)
line (0,0)-(639,479),,B

PrintImage

sleep
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Re: Quickbasic Cafe Forum

Postby Theunis Jansen » Nov 20, 2014 21:19

Don's problem was he could not choose between LPT1 and LPT2. He had two printers connected one for reports etc and the other for labels.
With QB you could print to either printer but his problem was and I think still is that the default printer is automatically selected.
If one uses something like the FBIde {Print] it opens a printer window and then you can choose the relevant printer.
We tried the Html, Rtf and other work-arounds for the fancy printing but it was no go because the problem remained that the required printer could not be selected.
His programs are commercial and the users did not want the hastle nor the time involved (mainly hospital use) of changing the paper before they could print.
He and Iare old "toppies" and still use QB4.5 so how to access the Windows print setup window where you can choose the printer from FB is a mystery to us.
marcov
Posts: 3019
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: Quickbasic Cafe Forum

Postby marcov » Nov 21, 2014 9:25

If still using 32-bit OS, (so no dosbox) I would see if I could interface some of the win3.x int (2F?) calls to set up some IPC to let the QB app communcate with a simple windows program for such issues.

I Daniel: I think QB's problems are bigger than its advantages for noobs, even if only to get a temporary start.

(please don't take the following to seriously:)

I saw that long ago(1991), and I solved that differently, I left my QB4.5 copy http://www.stack.nl/~marcov/qb.jpg shrinkwrapped. I migrated to Turbo Pascal 6.0 from qbasic, mostly because of graphics mode performance, and later to FPC and Delphi.
MrSwiss
Posts: 3634
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Quickbasic Cafe Forum

Postby MrSwiss » Nov 21, 2014 10:27

marcov wrote:I think QB's problems are bigger than its advantages for noobs, even if only to get a temporary start.

Similar with me: looked at Turbo-Basic / Turbo-Pascal and then (after Borland sold
the Turbo-Basic sources back to it's original developer Bob Zale, who re-launched it
as PowerBASIC V.2.0), I went with that, actually the version 2.1x.

Main reason was: it was simple to mix (link) with my own assembly routines (TASM).
It produced "lightning fast" .exe's for that time (mainly used CPU's still 8086/80286).

@I Daniel: to answer your questions: "backwards compatibility" in order to quickly
obtain a broader user base, but as further dev.-efforts prooved, never ment to stay
in the "dark ages" of BASIC.
marcov
Posts: 3019
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: Quickbasic Cafe Forum

Postby marcov » Nov 21, 2014 12:42

MrSwiss wrote:
marcov wrote:I think QB's problems are bigger than its advantages for noobs, even if only to get a temporary start.



I meant here the situation now. Just like TP now is increasingly less relevant for noobs for the same reasons (both IDE and products don't run on commonly used (read 64-bit) OSes anymore)

Turbo-Basic / Turbo-Pascal and then (after Borland sold
the Turbo-Basic sources back to it's original developer Bob Zale, who re-launched it
as PowerBASIC V.2.0), I went with that, actually the version 2.1x.


I came later. While I dabbled with TP4, I only started in honest with TP6, which was early nineties somewhere.

Main reason was: it was simple to mix (link) with my own assembly routines (TASM).
It produced "lightning fast" .exe's for that time (mainly used CPU's still 8086/80286).


I didn't know x86 assembler yet (did know 6502 and m68k, I came from the Commodore scene). But TP6 did all that, with assembler inline even. Though lighting fast is relative. If I look at the generated code now, I cry. Register variables are hardly used except in very simple functions. No SSA, only basic common subexpression elimination etc.

The recently developed 16-bit Free Pascal compiler generates better code. (time for 16-bit FB ? :-)

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 0 guests