Tag: Programming

(PB) String Between Characters

Posted by on April 26, 2011

This is a small purebasic function used to retrieve a string between two known characters, it also allows you to provide a starting position.

Example use:

If you’re working on a parser or similar project this will sure come in handy.

Away from the IDEs.

Posted by on September 12, 2009

I had in mind to share a bunch of my libraries throughout the course of this week, however real life kicked-in and prevented me from doing any of it. In a few days I will hopefully start posting the promised code. Keep in mind though, I’ve been studying electronics lately (I find it fascinating) so any spare time is likely to be spent on that as well.

Let’s see if I can get some well deserved rest now…

TimeLapse lib

Posted by on August 5, 2009

This little lib is used to keep track of time using the low resolution timer provided by the OS (in Windows “GetTickCount”). The goal of this type of library is to encapsulate timing actions. It was originally designed for game development in mind but needless to say you can use it and adapt it to your own needs.

Basically you define a time interval as you create the “timelapse” instance. Every time you call the update function a simple check determines whether the time was reached or not. This is trivial, but encapsulating it makes sense. Specially if you plan to create an animation system in the future!


Centered MessageRequester() / MessageBox()

Posted by on July 2, 2009

As usual, I was browsing the PureBasic forums to see what was new, nothing much (heh…) but something caught my attention, the fact that some user requested for the IDE’s message dialogs to be “centered” ( because he had multiple displays and the messages would appear in between them ) just to get shit-faced by an actual staff member!

You can’t just say “it’s Microsoft’s fault” — Are you in some sort of mac-only cleanse?, What’s your #%&%#$ problem?!

Those who “pass the ball” (as the user suggested) are part of the problem. You, being a programmer can certainly code a simple CBT hook, right?. Are you against hooks, perhaps – you are a purist, I hear… Sorry, but sometimes solutions are “dirty” and you have to live with them.

Just for the record, I too use a split-screen and I find it annoying that dialog boxes are not centered to their parent.

Just for the record, I too use a split-screen and I find it annoying that dialog boxes are not centered to their parent.


Going from Basic to the real world.

Posted by on March 6, 2009

You’ve been coding in *Basic for a while now, you feel you know it all and there’s nothing else to get from it. Well, that wouldn’t be a strange scenario, it happens to anyone who has been misled into the programming world to begin with!

The problem with the Basic languages is that they were conceived as a learning step and nothing else. Some of them try to stretch the bar, failing miserably in the process.

Now, don’t get me wrong I like them, But they’re not a world-class programming environment nor language nor compiler. Why else do you think that no one hires for *Basic?, because it practically doesn’t exist in the real world.

As a learning tool if it served it’s purpose then applaud and make yourself a favor: move on.