any other former gfabasic programmers out there?

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

any other former gfabasic programmers out there?

Post 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?
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post 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.
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post 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
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post 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
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post 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:
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post 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

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post 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:
User avatar
einander
Enthusiast
Enthusiast
Posts: 744
Joined: Thu Jun 26, 2003 2:09 am
Location: Spain (Galicia)

GFA lost soul

Post 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
User avatar
griz
Enthusiast
Enthusiast
Posts: 167
Joined: Sun Jun 29, 2003 7:32 pm
Location: Canada

Post by griz »

GFA on the ST was great!

IMO Pure Basic is a natural migration and much more powerful and fully featured.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post 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
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
einander
Enthusiast
Enthusiast
Posts: 744
Joined: Thu Jun 26, 2003 2:09 am
Location: Spain (Galicia)

GFA2PB

Post 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  
  
Last edited by einander on Wed Nov 05, 2003 1:16 am, edited 3 times in total.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

aw yes, are you developing a gfa library? :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post 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
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
einander
Enthusiast
Enthusiast
Posts: 744
Joined: Thu Jun 26, 2003 2:09 am
Location: Spain (Galicia)

Post 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
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post 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?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply