News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Strings.lib

Started by donkey, March 05, 2006, 04:53:01 PM

Previous topic - Next topic

donkey

There was a small bug reported in my Strings.lib library, the lszToken function had no real way to tell if you were at the end of the string or just an empty token. I have corrected this and uploaded a new version to my website. It will now return -1 when the end of the string is reached so the following will now work..

TokenString DB ",,This,,Is,A,Test,of,Tokens,,here",0

Giving empty strings for fields that are not filled in and returning -1 after "here" is returned. This code snippet was used to test it.

invoke lszToken,offset TokenString,","
:
PrintStringByAddr(eax)
invoke lszToken,0,","
test eax,eax
jns <


With the following results

Line 216: eax =
Line 216: eax =
Line 216: eax = This
Line 216: eax =
Line 216: eax = Is
Line 216: eax = A
Line 216: eax = Test
Line 216: eax = of
Line 216: eax = Tokens
Line 216: eax =
Line 216: eax = here
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable