jordi
Full Member
A simple solution is the smarter one.
Posts: 106
|
Post by jordi on Dec 1, 2020 8:56:20 GMT -5
Hi,
It would be great to have a list of the new features that Liberty Basic 5.0 has over the 4.5.1 version. Not bug fixes, but a list of new features that LB 5 has.
I don't know if it is somewhere, I did not find it. If it exists, please tell.
|
|
|
Post by Stefan Pendl on Dec 1, 2020 13:39:20 GMT -5
At first LB 5 will resemble the following features: - multiple platforms supported
- command strings replaced by functions
- GUI commands
- graphics commands
[/ul] Initially LB 5 will mostly resemble compatibility with LB 4 to make the transition easier. Sorry, since LB 5 is still in the alpha phase not much to tell about Carl's vision.
|
|
|
Post by Carl Gundel on Dec 1, 2020 14:27:53 GMT -5
At first LB 5 will resemble the following features: - multiple platforms supported
- command strings replaced by functions
- GUI commands
- graphics commands
[/ul] Initially LB 5 will mostly resemble compatibility with LB 4 to make the transition easier. Sorry, since LB 5 is still in the alpha phase not much to tell about Carl's vision.[/quote]-Support for Windows, Mac OS, Linux, Raspberry Pi -32-bit and 64-bit versions (only 32-bit for RPi) -Faster (for most things) -Tabbed editor -Ability to work with JPEG and PNG files -Built in database accessors for ODBC and SQLite3 (possibly also Postgres and MySQL) -Code reusability with LIBRARY command -The ability to pass objects into subroutines -Added support for file encoding. The default is ISO8859_1. ASCII, UTF_8 and MS_CP_1252 can also be specified. -New syntax for controlling GUI controls and drawing graphics e.g. #win "doSomething here" becomes #win doSomething(here)
|
|
jordi
Full Member
A simple solution is the smarter one.
Posts: 106
|
Post by jordi on Dec 1, 2020 15:11:01 GMT -5
At first LB 5 will resemble the following features: - multiple platforms supported
- command strings replaced by functions
- GUI commands
- graphics commands
[/ul] Initially LB 5 will mostly resemble compatibility with LB 4 to make the transition easier. Sorry, since LB 5 is still in the alpha phase not much to tell about Carl's vision.[/quote]-Support for Windows, Mac OS, Linux, Raspberry Pi -32-bit and 64-bit versions (only 32-bit for RPi) -Faster (for most things) -Tabbed editor -Ability to work with JPEG and PNG files -Built in database accessors for ODBC and SQLite3 (possibly also Postgres and MySQL) -Code reusability with LIBRARY command -The ability to pass objects into subroutines -Added support for file encoding. The default is ISO8859_1. ASCII, UTF_8 and MS_CP_1252 can also be specified. -New syntax for controlling GUI controls and drawing graphics e.g. #win "doSomething here" becomes #win doSomething(here)[/quote] That sounds great! It would also be great to have a sticky post in the forum with the new features as they are added. I am sure everybody would appreciate it.
Please never drop the support for 32 bits. Although most desktops are 64 bits, laptops and small netbooks use often 32 bits too. I use to do my programs in LB and other languages on my mini laptop, and it uses 32 bits OS.
|
|
|
Post by Carl Gundel on Dec 1, 2020 15:21:26 GMT -5
Please never drop the support for 32 bits. Although most desktops are 64 bits, laptops and small netbooks use often 32 bits too. I use to do my programs in LB and other languages on my mini laptop, and it uses 32 bits OS.
I will try to continue 32-bit support, but there are things that are outside my control including what the OS vendors do and what my tools vendor does.
|
|
jordi
Full Member
A simple solution is the smarter one.
Posts: 106
|
Post by jordi on Dec 4, 2020 13:23:29 GMT -5
Carl, how do I use the LIBRARY command? Is there documentation or help file about it? It sounds great.
|
|
|
Post by Chris Iverson on Dec 4, 2020 14:03:14 GMT -5
The LIBRARY command is still in early-working state due to it being unknown how it will work with compiled code, but it can be used in a similar way as Run BASIC's overloaded "RUN" command for now.
Make a file with the name "addlib.bas", with the following contents:
Function add(a, b) add = a + b End Function
Make another file with the following contents:
library "addlib.bas", #lib
print #lib add(2, 3)
See how it lets you call functions that are stored within the other file?
Globals can be utilized in the other file, as well, although they can't be referenced outside of the file.
Adjust the library code(addlib.bas) to this:
Global addVar addVar = 5
Function add(a, b) add = a + b End Function
Function addGlobal(a) add = a + addVar End Function
And try to call both functions from LB.
library "addlib.bas", #lib
print #lib add(2, 3) print #lib addGlobal(10)
|
|
jordi
Full Member
A simple solution is the smarter one.
Posts: 106
|
Post by jordi on Dec 4, 2020 14:18:49 GMT -5
The LIBRARY command is still in early-working state due to it being unknown how it will work with compiled code, but it can be used in a similar way as Run BASIC's overloaded "RUN" command for now. Make a file with the name "addlib.bas", with the following contents: Function add(a, b) add = a + b End Function Make another file with the following contents: library "addlib.bas", #lib
print #lib add(2, 3) See how it lets you call functions that are stored within the other file? Globals can be utilized in the other file, as well, although they can't be referenced outside of the file. Adjust the library code(addlib.bas) to this: Global addVar addVar = 5
Function add(a, b) add = a + b End Function
Function addGlobal(a) add = a + addVar End Function And try to call both functions from LB. library "addlib.bas", #lib
print #lib add(2, 3) print #lib addGlobal(10) Thank you Chris, I will try this.
|
|
jordi
Full Member
A simple solution is the smarter one.
Posts: 106
|
Post by jordi on Dec 4, 2020 14:27:26 GMT -5
I like this improvement very much. With the tabs too, it's very useful. I also noticed the undo works well.
|
|
|
Post by tsh73 on Dec 4, 2020 14:42:17 GMT -5
It looks like one could create controls with handle variables (I opened something like rolodex example - changed on button creation line button handle to handle variable - and it still worked So finally one could create buttons in a loops ;p
|
|
jordi
Full Member
A simple solution is the smarter one.
Posts: 106
|
Post by jordi on Dec 4, 2020 14:53:47 GMT -5
It looks like one could create controls with handle variables (I opened something like rolodex example - changed on button creation line button handle to handle variable - and it still worked So finally one could create buttons in a loops ;p That could be used to create a tab control maybe.
|
|
|
Post by Carl Gundel on Dec 4, 2020 19:17:01 GMT -5
It looks like one could create controls with handle variables (I opened something like rolodex example - changed on button creation line button handle to handle variable - and it still worked So finally one could create buttons in a loops ;p That could be used to create a tab control maybe. Liberty BASIC 5 will probably have a tab control built in, but I can't promise it at this time. It already has several new controls. These still need some work but there are example programs. -datespinner -timespinner -grid -toolbar
|
|
|
Post by Carl Gundel on Dec 4, 2020 19:22:04 GMT -5
Globals can be utilized in the other file, as well, although they can't be referenced outside of the file. You can write a function to get the value of a library global, and to set it if you want. I haven't decided exactly how globals will be treated across files like that. I'm open to suggestions but I'm partial to thinking that values should only be shared by calling a function. SUBs will also be callable at some point, perhaps not in the first release of LB5.
|
|
|
Post by Chris Iverson on Dec 4, 2020 19:33:30 GMT -5
Honestly, I prefer it like that. Gives it a semblance of encapsulation from OO programming, and it makes sense. Each "module" is responsible for it's own stuff, and the other modules can't interfere.
The only time I can think of it being useful to have globals accessible outside of the module itself is for named constants, so people using the module won't have to change their code if constant values get changed in the module.
I like that the main body still executes, too, and can be used like a library initializer. That does bring up one question, and feature request, from me: will there be some way to tell, in the executing code, whether or not the code is running stand-alone or being loaded as a module? That way we can do things like have a debug mode or a demo mode if you run the module directly, and skip all of that if it's loaded by another program.
|
|
|
Post by Carl Gundel on Dec 4, 2020 20:54:44 GMT -5
That does bring up one question, and feature request, from me: will there be some way to tell, in the executing code, whether or not the code is running stand-alone or being loaded as a module? That way we can do things like have a debug mode or a demo mode if you run the module directly, and skip all of that if it's loaded by another program. Good idea. Perhaps a program can have variable set if it is being used as library.
|
|