Page 1 of 2

any other former gfabasic programmers out there?

Posted: Thu Oct 02, 2003 4:37 pm
by blueznl
with the 'fadeout' of gfa i would expect more programmers to turn to pure, but is that the case? anybody out there who was an active gfabasic user and made a succesfull switchover?

Posted: Thu Oct 02, 2003 5:00 pm
by freedimension
Yes me.

I used to program in GFA Basic when I was about 10, back in 87-89 on an ATARI ST 1040
It was one of my first programming languages next to Omicron Basic.

But with the buying of my first own 386 I soon lost touch with it. Since then I tried a lot of languages including Java, Pascal, BlitzBasic, C ...
PureBasic is the first one since then I'm really addicted to.

Posted: Thu Oct 02, 2003 7:16 pm
by Berikco
Yup, as a former GB32 betatester, i switched to PureBasic in june 2002
It's all here :) http://users.pandora.be/berikco/biography.htm

Posted: Fri Oct 03, 2003 12:17 pm
by blueznl
yep, i've been on your site :)

can't you convince fred that we need a little more gfa syntax to make life easeir? syntax, mind you, not business practices :(

i think i'm going to set up a page for converts... there are a few things in pure that absolutely puzzled me, and the documentation is sadly inadequate... i would be tempted to volunteer on that department, but my knowledge of the language is not yet good enough to handle the more 'esoteric' commands so i'll settle for some sort of beginners faq for now... i'll post it when it's done

Posted: Fri Oct 03, 2003 12:19 pm
by Berikco
blueznl wrote:yep, i've been on your site :)

can't you convince fred that we need a little more gfa syntax to make life easeir? syntax, mind you, not business practices :(
No, it's me who sugested the strange syntax to Fred :twisted:

Posted: Fri Oct 03, 2003 1:18 pm
by LarsG
Berikco wrote:
blueznl wrote: yep, i've been on your site

can't you convince fred that we need a little more gfa syntax to make life easeir? syntax, mind you, not business practices

No, it's me who sugested the strange syntax to Fred :twisted:
LOL @ Berikco.. :lol:

Personally, I like the syntax as it is now.. Please don't mess it up :!:

-Lars

Posted: Fri Oct 03, 2003 1:59 pm
by blueznl
well, to be honest, it's not that bad, it's more getting used to

some things are weird though, but properly documented things get easier (ah, there's the catch :) )

strange syntax? to be honest, not much :oops:

but i'll post some here if i notice them, okay? :wink:

GFA lost soul

Posted: Fri Oct 03, 2003 4:34 pm
by einander
I'm another shipwrecked from GFA's sinking.

I've been using GFA since 1986, first on the AtariST, and then with GFAwin16, mainly programming MIDI routines.

Never liked GFA32.
Now I'm VERY happy with PB.

Please, can somebody translate this GFA MIDI IN code to PB?
Thanks in advance and Greetings from Spain!
Einander

_____________________________________________

Code: Select all

@prepare_midi
hMidiIn& = 1
IdMidiIn& = 1
~@@midiInOpen(V:hMidiIn&,IdMidiIn&,WIN(1),0,CALLBACK_WINDOW%)
~@@midiInStart(hMidiIn&)
PROCEDURE prepare_midi
  DLL #1, "mmsystem.dll"
    DECL LONG timeSetEvent(w,w,l,l,w)
    DECL LONG timeKillEvent(w)
    DECL LONG midiOutShortMsg(w,l)
    DECL LONG midiOutOpen(l,w,l,l,l)
    DECL LONG midiOutClose(w)
    DECL LONG timeGetDevCaps(l,w)
    DECL LONG timeBeginPeriod(w)
    DECL LONG timeEndPeriod(w)
    DECL WORD midiInGetNumDevs()
    DECL WORD midiInGetDevCaps(w,l,w)
    DECL LONG midiInOpen(l,w,l,l,l)
    DECL LONG midiInStart(w)
    DECL LONG midiInStop(w)
    DECL LONG midiInClose(w)
    DECL WORD midiOutGetNumDevs()
    DECL WORD midiOutGetDevCaps(w,l,w)
    DECL WORD midiOutGetErrorText(w,l,w)
  ENDDLL
  LET CALLBACK_WINDOW% = $10000
  LET CALLBACK_FUNCTION% = $30000
  LET MM_MIM_DATA& = $3C3
  LET  MMSYSERR_ERROR&        = 1 /* unspecified error */
  LET  MMSYSERR_BADDEVICEID&  = 2  /* device ID out of range
  LET  MMSYSERR_NOTENABLED&   = 3  /* driver failed enable
  LET  MMSYSERR_ALLOCATED     = 4  /* device already allocated /*
  RETURN

Posted: Tue Oct 07, 2003 2:59 am
by griz
GFA on the ST was great!

IMO Pure Basic is a natural migration and much more powerful and fully featured.

Posted: Tue Oct 07, 2003 8:11 am
by blueznl
if i have the time i'll have a look at the midi stuff tonight

btw, the first ostrowski product i saw was turbobasic on the atari xl :-)

the gfa on an st, gfa on amiga, gfa on dos, gfa on windows, but although i purchased it i never used gfa32... all 16 bit versions made sense, the 32bit did not

i guess more and more gfa users will end up using either purebasic or darkbasic

GFA2PB

Posted: Tue Oct 07, 2003 11:55 am
by einander
My dreams come true: working GFA16 commands in PB! :D
CLS,GET,PUT,STRETCH,GRAB ;(grab is a PUT for part of image)

;Edited - added ReleaseDC_

Code: Select all

;Binary raster operation - october 7 - 2003 - by Einander 
;Combines the bits from the selected pen with the bits in the destination bitmap. 
;(Bit-block transfer of color Data from source DC into a destination DC) 

; -********Choose your BitMap on line 48************* 
;With Debugger option Off, gets your BitMap; else, only part of debug window 

; 15 combination modes: 
;#BLACKNESS, #DSTINVERT, #MERGECOPY, #MERGEPAINT, #NOTSRCCOPY, #NOTSRCERASE ;#PATCOPY 
; #PATINVERT, #PATPAINT, #SRCAND, #SRCCOPY, #SRCERASE, #SRCINVERT, #SRCPAINT, #WHITENESS 

Procedure Get(X,Y,Wi,He)    ; Get source image - returns image handle 
   SRC=GETDC_(WindowID()) 
   DEST = CreateCompatibleDC_(SRC) 
   SelectObject_(DEST,CreateImage(0,Wi,He))  
   BitBlt_(DEST,0,0,Wi,He,SRC,X,Y,#SRCCOPY) 
   ReleaseDC_(WindowID(),Src)
   ProcedureReturn DEST 
EndProcedure 

Procedure Put(X,Y,IMG,MODE) ; Draws image from IMG TO DEST (DEST = GetDC_(SrcID))  
    hDC=GETDC_(WindowID())
    BitBlt_(hDC,X,Y,ImageWidth(),ImageHeight(),IMG,0,0,MODE) 
    ReleaseDC_(WindowID(),hDC)
EndProcedure 

Procedure Stretch(X,Y,Wi,He,IMG,MODE)  ; draws stretched image  
     hDC=GETDC_(WindowID())
     StretchBlt_(hDC,X,Y,Wi,He,IMG,0,0,ImageWidth(),ImageHeight(),MODE) 
     ReleaseDC_(WindowID(),hDC)
EndProcedure 

Procedure Grab(StartX,StartY,Wi,He,IMG,X,Y,MODE)  ; draws part of image 
    hDC=GETDC_(WindowID())
    BitBlt_(hDC,X,Y,Wi,He,IMG,StartX,StartY,MODE) 
    ReleaseDC_(WindowID(),hDC)
EndProcedure 

Procedure CLS(COLOR)   ; clear screen 
    StartDrawing(WindowOutput()) 
    Box(0,0,WindowWidth(),WindowHeight(),COLOR) 
    StopDrawing() 
EndProcedure 
;__________________________ 

IMAGE$="**************CHOOSE  HERE YOUR BMP******************************" 

LoadImage(1,Image$) 
WIMG=100 : HIMG=100 
ResizeImage(1,WIMG,HIMG)  ; STARTING  WITH 100 X 100 PIXS 

id=OpenWindow(0,0,0,WIMG,HIMG,#PB_Window_BorderLess  ,"")    
StartDrawing(WindowOutput()) 
DrawImage(UseImage(1),0,0) 
IMG=Get(0,0,WIMG,HIMG) 
StopDrawing() 
CloseWindow(0) 

_X=GetSystemMetrics_(#SM_CXSCREEN) : _Y=GetSystemMetrics_(#SM_CYSCREEN) 
hWnd=OpenWindow(0,0,0,_X,_Y,#WS_OVERLAPPEDWINDOW | #WS_MAXIMIZE,"") 
CLS(#blue)      

;Testing some modes 

PUT(220,100,IMG,#SRCCOPY) 
PUT(350,100,IMG,#SRCPAINT) 

STRETCH(20,200,200,200,IMG,#NOTSRCERASE) 
x=0 : y=_Y-150 

Repeat 
   GRAB(0,0,50,50,IMG,20+i,y,#SRCINVERT) 
   i+50 
   GRAB(50,50,50,50,IMG,20+i,y,#SRCINVERT) 
   y-50 
Until  y<50 

Repeat 
Until WaitWindowEvent()= #PB_Event_CloseWindow  

End  
  

Posted: Tue Oct 07, 2003 12:24 pm
by blueznl
aw yes, are you developing a gfa library? :-)

Posted: Tue Oct 07, 2003 12:27 pm
by blueznl
i don't know if this is of any use...

pb sometimes forces me to use 'pb handles', unique numbers, now if multiple people use the same numbers on a large project or over different libs, conflicts arise easily...

here's what i do:

Procedure x_init()
;
; *** initialize variables, constants and parameters
;
Global x_enum.l , x_enum_n.l
x_enum_n = 1000 ; arbitrary value, first unique number given out
NewList x_enum_list.l() ; see x_number() for more details
;
EndProcedure

Procedure.l x_enum()
Global x_enum.l
;
; *** generates a new unique number
;
; in: none
; out: x_enum.l
;
; pure sometimes uses 'numbers' to identify elements instead of windows handles
; these numbers are arbitrary and fully defined by the user, this can cause trouble
; when using multiple libraries or code from different people as they might be reusing
; these unique numbers, for this purpose, i've added a x_pbh procedure that returns
; a new unique number on every call
;
; you decide yourself if you want to free them or not :-)
; i would suggest doing so if you don't 'recycle' them...
;
If CountList(x_enum_list()) > 0 ; which means there's some stuff on the list
x_enum = x_enum_list()
DeleteElement(x_enum_list())
Else
x_enum = x_enum_n
x_enum_n = x_enum_n+1
EndIf
ProcedureReturn x_enum
EndProcedure

Procedure x_enumfree(n.l)
;
; put this number into the 'free numbers' list so it can be reused by x_enum()
;
AddElement(x_enum_list())
x_enum_list()=n
;
EndProcedure

Posted: Tue Oct 07, 2003 1:31 pm
by einander
blueznl wrote:aw yes, are you developing a gfa library? :-)
We don't need to do it for all GFA commands, but for the more popular seems a good idea.

PB is very flexible, and allows this kind of tweakings with very good results.
I'm looking for some place to start a GFA2PB dictionary.

Einander

Posted: Tue Oct 07, 2003 2:08 pm
by blueznl
i created a short 'survival' guide to make it easier for converts to convert... euh... :-)

but it's not specifically targetted at gfabasic users... did you have some sort of list or doc in mind?