The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: donkey on March 05, 2006, 04:53:01 PM

Title: Strings.lib
Post by: donkey on March 05, 2006, 04:53:01 PM
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