Tag: ascii

Ascii helper routines, part 1

Posted by on June 11, 2008

Whenever I have to manipulate strings in PB, on a low-level (ie. per-character basis) I find it almost imperative to have the following routines included in my project:

 is_alpha(); is_numeric(); is_symbol();

They are amongst the most basic routines out there, however, they are still useful nonetheless.

You can grab the include/source from here: http://gushh.net/dev/?file=pb/ascii_helpers.pb

If you’re working on a Lexer, Parser, or similar… this will come in handy in case you don’t have it already.

Cheers.

Faster ways of finding a character inside a string, in PureBasic.

Posted by on March 3, 2008

For those of you who either prototype or work with PureBasic on a daily basis, if you ever found yourself looking for faster ways of performing string manipulation, while still using the string system this language provides, be glad for I’ll be posting a few of my solutions to speed up the process.

My first entry is the FindChar() routine. Unlike the official FindString(), this one only searches for a single character. In situations where you’ll be dealing with single character string searches rather than multi-character, this routine will give you up to 2x speed increase in both Ascii and Unicode modes. Worst case scenario, you’ll get equal results speed-wise.

The FindChar() code can be found at > here <

Continue reading “Faster ways of finding a character inside a string, in PureBasic.” »