FreeBASIC Extended Library Release 0.2.2

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
Post Reply
Merick
Posts: 1038
Joined: May 28, 2007 1:52

Post by Merick »

Can you tell me why this isn't working? No matter what I use for the string or the delimiter, it always returns -1

Code: Select all

#include once "ext/ext.bi"

dim as string a = "a:b:c"
dim as string b()
dim as integer i, result

result = ext.strings.split(a,b(),":",0)

?result
for i = 0 to result -1
	?b(i)
next

sleep
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Post by sir_mud »

I'll take a look at why it isn't returning the correct number, it is splitting the string up, you can see it with this snippet:

Code: Select all

#include once "ext/ext.bi"

Dim As String a = "a:b:c"
Dim As String b()
Dim As Integer i, result

result = ext.strings.split(a,b(),":",0)

? result

for n as integer = lbound(b) to ubound(b)
	? b(n)
next
*EDIT*
Fixed the bug in SVN, the function was incorrectly setting the return parameter to true, not the count.
Imortis
Moderator
Posts: 1923
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Post by Imortis »

A small issue. I tried to use the FBMLD in an FB-ext program. When I did, it flagged some errors in console.bi.

It looks like a macro is having issues with the enum in console.bi
Merick
Posts: 1038
Joined: May 28, 2007 1:52

Post by Merick »

I just checked out the svn, when I try to run "build lib" from a winxp command prompt, it quits with this error:

c:\FreeBasic\bin\win32\ar.exe: scr\*.o: Invalid argument
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Post by sir_mud »

Merick: that's because the build.bat file is outdated, it honestly is very hard to maintain and make is the preferred way to build. It is very easy to build with MSYS, all you have to do is add your FreeBASIC directory to MSYS' path variable and it should build no problem.

Immortis: I haven't noticed that before, i'll take a look when i get home from work and see what i can find out about that.
Merick
Posts: 1038
Joined: May 28, 2007 1:52

Post by Merick »

how do I do that? although I've got it installed, I haven't really used msys very much yet
Dr_D
Posts: 2451
Joined: May 27, 2005 4:59
Contact:

Post by Dr_D »

ok, goto Control Panel/System and click the Advanced tab. Now click the Enviroment Variables button at the bottom. Now, in the bottom scroll window, find the Path entry. Highlight it and click the Edit button. You should see something like this:

Code: Select all

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:/FreeBASIC;C:\msys\1.0;C:\FreeBASIC\bin\win32;c:\wget;C:\Dev-Cpp\bin;
You'll just need to add the path to your msys binaries directory to the end of that string, and don't forget to add an ";" after it.
Merick
Posts: 1038
Joined: May 28, 2007 1:52

Post by Merick »

OK that did it, but I already knew how to add paths in windows, from what sir_mud said I had been thinking that I had to change something in msys itself
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Post by sir_mud »

yea, you have to do:

Code: Select all

export $PATH:C:/path/to/freebasic
inside MSYS, not sure if you'll have to do it everytime though. you can always use:

Code: Select all

make FBC=/path/to/freebasic/fbc.exe
that's how i build the windows release on linux :D
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Post by sir_mud »

Immortis: quick question, did you use FBMLD included with ext or a seperate version? to activate the built-in FBMLD simple do this:

Code: Select all

#define FBEXT_USE_MLD
#include once "ext/ext.bi"

'your code here
if that's not it or you're still having problems just let me know.
LukeL
Posts: 118
Joined: Mar 14, 2006 17:26

Post by LukeL »

Good job on this library, keep it up.
Also, I'd like to make a feature request for a load_mem function with jpg images.
Just like the png function =)
If you don't have the time please let me know and I'll give it a try.
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Post by anonymous1337 »

@LukeL: FB-ext can load bmp, jpg, and png by default via Load_Image
LukeL
Posts: 118
Joined: Mar 14, 2006 17:26

Post by LukeL »

Yes, I realize that. However the jpg image I want to load is not a file, it is embedded inside a ID3v2 tag for Mp3's.
So after I've loaded the entire ID3v2 tag into memory and parsed it, I'm left with an image in memory. Rather than save it to file and then load it. (which I've done in the past) It should be quite easy to add the function that I mentioned above =). Sorry for any confusion.
Dr_D
Posts: 2451
Joined: May 27, 2005 4:59
Contact:

Post by Dr_D »

Hmmm... the memory footprint you're describing for the jpeg is in uncompressed rgb format, right? If so, we could easily add a function for that. ;)
LukeL
Posts: 118
Joined: Mar 14, 2006 17:26

Post by LukeL »

I actually don't know much about jpeg formats. I'm pretty sure these are just standard, nothing unusual about them anyway. Just add a function that would be compatible with the load_jpg from file that you have now, I wouldn't expect you to code a whole new format for me, hehe. =)
I can provide an example of a jpeg I'm talking about if you want.
Post Reply