Author Topic: suggestion for the BinaryTagInit function, start-tag parameter  (Read 323 times)

kdmoyers

  • Full Member
  • ***
  • Posts: 213
suggestion for the BinaryTagInit function, start-tag parameter
« 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
The mind is everything; What you think, you become.

JTaylor

  • Pundit
  • *****
  • Posts: 858
    • Data & Stuff Inc.
Re: suggestion for the BinaryTagInit function, start-tag parameter
« Reply #1 on: February 01, 2018, 07:20:11 am »
I will second that one.

Jim

td

  • Tech Support
  • *****
  • Posts: 2440
    • WinBatch
Re: suggestion for the BinaryTagInit function, start-tag parameter
« Reply #2 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.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


JTaylor

  • Pundit
  • *****
  • Posts: 858
    • Data & Stuff Inc.
Re: suggestion for the BinaryTagInit function, start-tag parameter
« Reply #3 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