WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: kdmoyers on February 01, 2018, 05:04:42 AM

Title: suggestion for the BinaryTagInit function, start-tag parameter
Post by: kdmoyers on February 01, 2018, 05:04:42 AM
I have an enhancement suggestion for the BinaryTagInit function, start-tag parameter:

Presently, start-tag is not permitted to be an empty string.

I suggest that empty string be permitted, and be interpreted to mean "match immediately, zero length start-tag". 

So, on the first Find operation, it matches the first character in the buffer.  On subsequent Finds, it matches the character following the last end-tag.

This would allow the BinaryTag method to work on buffers that are simple delimited strings, like LF terminated text files, without any fussing about with inserting start-tags.

Yes, there are other ways to do this of course, but the BinaryTag family of functions is so tidy and fast, it would be nice to use it here also.

I would rank this suggestion as "only if bored."  (smile)

-Kirby
Title: Re: suggestion for the BinaryTagInit function, start-tag parameter
Post by: JTaylor on February 01, 2018, 07:20:11 AM
I will second that one.

Jim
Title: Re: suggestion for the BinaryTagInit function, start-tag parameter
Post by: td on February 01, 2018, 09:41:44 AM
Thanks for the suggestion.  It gets around the problem of having to modify the binary buffer to simulate reading linefeed delimited records.
Title: Re: suggestion for the BinaryTagInit function, start-tag parameter
Post by: JTaylor on February 01, 2018, 10:33:33 AM
If you do start making changes on that front please remember this thread...

http://forum.winbatch.com/index.php?topic=1908.msg9637#msg9637

Jim