No Image
No Image

Login Form






Lost Password?

Who's Online

No Image
Updating SQLiter
Wednesday, 18 April 2007
SQLite is receiving a lot of extra attention these days, mainly due to its welcome introduction to PHP. It was really only a matter of time, as SQLite's no-nonsense database handling is simply too good to be ignored. This extra attention is great, as it means the code-base is also getting extra attention - meaning SQLite as a product is becoming stronger by the month.

Blitzmax users are lucky to have access to the excellent SQLiter module by René . This makes SQLite about as accessible as you can hope to have it. I have been, however, a little concerned about keeping SQLiter up to date, as the original wrapper by Tea Monkey is quite old now and Tea Monkey's site is down. And if you check on the SQLite updates page, you'll see a lot of bugs have been caught since the Tea Monkey release. 

Fortunately, the makers of SQLite have completely spoiled us by providing, not only the latest source, but the latest source in a single file. Updating the tm.mod is now simple and easy. Just:

  • Download the latest source code as a single file. Currently it is (link removed, find it on the SQLite downloads page ):

sqlite-source-3_3_15.zip
(574.56 KiB)
This ZIP archive contains pure C code for the SQLite library. Unlike the tarballs below, all of the preprocessing and automatic code generation has already been done on these C code files, so they can be converted to object code directly with any ordinary C compiler.

  • Open your tm.mod folder and delete everything except sqlite.bmx (back it up first!).
  • Copy sqlite3.c and sqlite3.h to the tm.mod folder
  • Edit sqlite.bmx, commenting out all the "Import .c's" within a Rem End Rem
  • Insert a simple Import "sqlite3.c" in their place
  • Open terminal, steer to your blitzmax bin folder and type
  • bmk makemods -a tm
  • And remake your SQLiter project.

I should add my usual disclaimer. The above worked fine for me in OS X. I am certainly no authority on the matter - I'm just a guy trying to get a set of tools to do what he needs. How does the saying go: If you let the blind lead the blind, we'll all end up in the ditch?

Good luck! Smile

 
Akasa source code released
Sunday, 18 March 2007

I've finally found time to release the full source for Akasa . I hope it is of some use to someone out there. If so, please let me know?

 DIgging through old screenshots, I found a snap of the secret Zinc level that I'll wager no one has found...

 Active Image

 
Mac OS X, SQLiter and Blitzmax
Saturday, 03 March 2007

The saga begins...

Here's the situation. You've been programming PC's for years and you've been lured to Apple for all the really good reasons that are out there to make the switch. Suddenly you're in an environment where everything looks great - but even simple things like installing an application suddenly need brain work or a decent Google search. That's me right now and if that's you as well - read on.

1. Installing and updating Blitzmax

  • Download and install XCode tools from the Apple developer site . Joining is free by the way, so don't stress!
  • Download the latest Blitzmax from the home site. Make sure you remember to select the correct processor version. It will in all likelihood be 'Intel OS X'. Complete Newcomer's Hint: to install, download, open the Blitzmax virtual drive on your desktop, drag the contained folder to your Applications folder. Then download and apply the latest Blitzmax patches (just double click on them to execute the installer). Unmount the Blitzmax virtual drive when done.
  • Syncmods and remake all modules from the IDE as per usual

2. Compiling modules

  • Open a Terminal (Applications>Utilities>Terminal) and add your Blitzmax bin folder to your PATH environment.

This for me resulted in a painful struggle with Vim (the new vi) - a struggle you really don't need to go through. Instead, try:

echo 'export PATH="$PATH:/Applications/Blitzmax/bin"' >> ~/.bash_profile

The idea is that you are redirecting the output of the echo straight to the end of the .profile file, sidestepping the need for an editor at all. Exit then restart your Terminal (I think you need to do this as the Terminal loads your profile each time it starts) and type

echo $PATH

to see if that worked.

If not, try:

echo 'export PATH="$PATH:/Applications/Blitzmax/bin"' >> ~/.profile

as I'm not too sure which is the correct profile filename for bash (someone let me know)? [Edit: René informs me that .profile is the global setting and .bash_profile is your individual user setting] If neither of these works and you are justifiably scared of vi and its clones, try TextWrangler

3. Compiling SQLiter 

Download and place the pyropixel.mod and tm.mod folders in your Blitzmax/mod folder. To do this you may need an Unrar application such as StuffIt . I used the imaginatively named UnRar.

You should now be able to type

bmk makemods -a tm

bmk makemods -a pyropixel

without the world coming crashing down on your head. Well, in theory... Because in fact, in all likelihood you will get an error complaining that "Timeout" in line 301 of tm's main.c is undefined. And guess why? Because it really is undefined!

To fix this, we have to get our hands dirty under tm's bonnet. Digging through the main.c code you'll find a compiler #ifdef #else switch that explains the error. On the PC, HAVE_USLEEP (and hence SQLITE_MIN_SLEEP_MS) is defined differently than on the Mac. Thus on the PC, the switch sees to it that this offending section of code is never compiled. 

My fix is to guess that Timeout was once a global that changed into a function argument somewhere along the line. Tea Monkey if you are still out there, feel free to step in and set me straight on this! Thus simply replace the evil line

//int timeout = (int)Timeout;

with (copied from just above)

int timeout = ((sqlite3 *)ptr)->busyTimeout;

and rebuild. Good luck!

 
<< Start < Prev 1 2 3 4 5 6 7 8 Next > End >>

Results 13 - 16 of 29
No Image
No Image No Image No Image
No Image
© 2008 Gibbon Games
No Image