Is FreeBasic A Decent Alternative To VisualBasic 6?
Is FreeBasic A Decent Alternative To VisualBasic 6?
Hello all. I used Visual Basic 6.0 for a few years until about 2016. Now I need a decent alternative that isn't dying (*cough* VB.Net). Is FreeBasic a good choice, or should I use a different language?
Re: Is FreeBasic A Decent Alternative To VisualBasic 6?
Hi BadLarry,
since the term 'decent' is freely interpretable, I'm unwilling to open this 'can of worms'.
Please specify, as cosely as you can manage, your interpetation of 'decent'.
AFAIK, VB is all OOP with lots of predefined classes ...
FB has none of that, without external libraries (its pretty low-level, similar to C).
since the term 'decent' is freely interpretable, I'm unwilling to open this 'can of worms'.
Please specify, as cosely as you can manage, your interpetation of 'decent'.
AFAIK, VB is all OOP with lots of predefined classes ...
FB has none of that, without external libraries (its pretty low-level, similar to C).
Re: Is FreeBasic A Decent Alternative To VisualBasic 6?
If you're looking for a language with a built-in GUI form system and an integrated, rapid development designer, then no, FreeBASIC is definitely not an alternative to VB 6. Something like gambas is more equivalent to VB6, but not a direct drop-in replacement.
All that said, with external GUI libraries, FB can do everything VB 6 did and much more in the hands of an experienced programmer.
All that said, with external GUI libraries, FB can do everything VB 6 did and much more in the hands of an experienced programmer.
Re: Is FreeBasic A Decent Alternative To VisualBasic 6?
Basically, I need a language that is easy to use, is similar to vb6, and can be run on Windows and Mac OS. Support for object Oriented programming would be nice, but it isn't required in my case. Support for game creation and text-to-speech functionality would be nice as well (I used to write games for the blind in my spare time, when I wasn't writing more serious applications.)
Re: Is FreeBasic A Decent Alternative To VisualBasic 6?
If you are speaking about BASIC-like syntax, but more advanced then, you're on the right track.BadLarry wrote:I need a language that is easy to use, is similar to vb6, ...
Limited OOP support is there, but no multiple inheritance (you'll write the 'boilerplate-code' yourself).
Some members have 'diddled' with game-engines (don't know if they're any good).game creation
Seems to call for external library ...text-to-speech functionality
Re: Is FreeBasic A Decent Alternative To VisualBasic 6?
Freebasic can handle vbscripts very easily if that is a half way step.
A gui, seems that the winapi would suit fine, that is what vb uses behind the scenes.
The windows section is mainly win api.
I assume you have freebasic to run this script stuff.
A gui, seems that the winapi would suit fine, that is what vb uses behind the scenes.
The windows section is mainly win api.
I assume you have freebasic to run this script stuff.
Code: Select all
function pipeout(byval s as string="") byref as string
var f=freefile
dim as string tmp
Open Pipe s For Input As #f
s=""
Do Until EOF(f)
Line Input #f,tmp
s+=tmp+chr(10)
Loop
close #f
return s
end function
function runscript(text as string) as string
Dim As long n=freefile
If Open ("Tmp.vbs" For Binary Access Write As #n)=0 Then
Put #n,,text
Close
end if
function= pipeout ("cscript.exe /Nologo "+ "Tmp.vbs") ' or wscript.exe
kill "Tmp.vbs"
end function
sub speak(text as string)
dim as string x="mshta vbscript:Execute(""CreateObject(""""SAPI.SpVoice"""").Speak("""""+text+""""")(window.close)"")"
print text
shell x
end sub
dim as string s="Set h = CreateObject(""Scripting.Dictionary"")"+ chr(13,10)
s+="h.Add ""A"", 1" + chr(13,10)
s+="h.Add ""B"", 2" + chr(13,10)
s+="h.Add ""C"", 3" + chr(13,10)
s+="Wscript.Echo h.Item(""A"")" + chr(13,10)
s+="h.Item(""C"") = 4" + chr(13,10)
s+="h.Key(""C"") = ""D""" + chr(13,10)
s+="Wscript.Echo h.exists(""C"")" + chr(13,10)
s+="h.Remove ""B""" + chr(13,10)
s+="Wscript.Echo h.Count"+ chr(13,10)
s+="h.RemoveAll" + chr(13,10)
s+="Wscript.Echo h.Count"
speak("example from rosetta code, v b a linked lists, converted to v b script")
print runscript(s)
speak "Bye"
sleep
Re: Is FreeBasic A Decent Alternative To VisualBasic 6?
@dodicat, since when is WinApi compatible with Mac-OS? (without emulators, that is)
OP clearly wrote:... can be run on Windows and Mac OS.
Re: Is FreeBasic A Decent Alternative To VisualBasic 6?
Mac, I forgot about that.
member srvaldez can help with fb code on Macintosh.
Probably more like Linux. I didn't realise that VB6 ran on mac, I know Microsoft word can, but sorry, don't know much about Mac.
member srvaldez can help with fb code on Macintosh.
Probably more like Linux. I didn't realise that VB6 ran on mac, I know Microsoft word can, but sorry, don't know much about Mac.
Re: Is FreeBasic A Decent Alternative To VisualBasic 6?
VB6 was never released on Macintosh, but I purchased a macBook last year and support for Macintosh would be useful.
-
- Posts: 2958
- Joined: Jun 02, 2015 16:24
Re: Is FreeBasic A Decent Alternative To VisualBasic 6?
Hi BadLarry,BadLarry wrote:Hello all. I used Visual Basic 6.0 for a few years until about 2016. Now I need a decent alternative that isn't dying (*cough* VB.Net). Is FreeBasic a good choice, or should I use a different language?
I would say yes you can use Freebasic as an alternative where you will be abe to use a lot of Microsoft Basic well known stuff (like DIR etc..), and the winapi is handled the same way (importing functions is done in a similar way). However Freebasic doesn't support natively Variant, or VB6 classes. Also there is not an equivalent visual designer like the visual basic ones.
When you need more control of the memory (with pointers) , cross-plateform portability, and can afford to code without something like the visual basic editor (or visual studio like stuff), then you really can have great efficiency with FB. FB is also a good strategy if you think you'll need someday to use C libraries because FB then will interface with such lib rather naturally.
You also can use other languages anyway. In my opinion you may well find them not tasting very "basic", whereas Freebasic definitely does.
Re: Is FreeBasic A Decent Alternative To VisualBasic 6?
@BadLarry
if you want a cross-platform solution that has the functionality of VB6 then I recommend Lazarus, it's Pascal but it's GUI designer works similar to VB6
alternately, you could give QB64 + Inform a try
if you want a cross-platform solution that has the functionality of VB6 then I recommend Lazarus, it's Pascal but it's GUI designer works similar to VB6
alternately, you could give QB64 + Inform a try
Re: Is FreeBasic A Decent Alternative To VisualBasic 6?
A Gui library that looks 'native' on Win/Lin (and, should run on Mac too)
is IUP, for Win = WinApi backend, for UNIXy OS's = GTK backend.
The exposed programming interface is always the same, OS independant.
It links easily to FB, because it's native C (not C++ which requires wrappers).
Both static or dynamic linking is possible.
Headers are available in FB, albeit being pretty dated (approx. 5 years old).
is IUP, for Win = WinApi backend, for UNIXy OS's = GTK backend.
The exposed programming interface is always the same, OS independant.
It links easily to FB, because it's native C (not C++ which requires wrappers).
Both static or dynamic linking is possible.
Headers are available in FB, albeit being pretty dated (approx. 5 years old).
-
- Posts: 538
- Joined: Dec 02, 2011 22:51
- Location: France
Re: Is FreeBasic A Decent Alternative To VisualBasic 6?
@BadLarry. TT wrote :
I agree. As you re looking for "Spirit of Basic", I m convinced here is probably the right place. Welcome.In my opinion you may well find them not tasting very "basic", whereas Freebasic definitely does.