Re: Extracting a variable array from a split string (please help)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Dan Watson (staticfish_at_tiscali.co.uk)
Date: 07/06/04


Date: Tue, 06 Jul 2004 23:33:06 +0100

Russ Holsclaw wrote:

>>I'm going to rephrase my original question so its easy to understand
>>without all of the waffle
>>
>>say I have this string
>>
>>NICK¤¶£DanNICK¤¶£PeteNICK¤¶£JoanNICK¤¶£Bill
>>
>>I can split this up at the moment, but only the first one... so i get
>
> "Dan"
>
>>How do i put them in a variable array so that when it comes to adding
>>them to the treeview I get:
>>
>>Treeview1.Nodes.Add "MAIN", tvwChild, , (dat), 2, 2
>>
>>-Names
>>-Dan
>>-Pete
>>-Joan
>>-Bill
>>
>>I guess some clever splitting and looping needs to be done but im not
>>sure what.. Please help!
>
>
> Looking at your original post, that showed that this crazy string
> originates from a misuse of TCP/IP protocol, I'd suggest that the fix
> should be applied in the server software: put a proper delimiter (such as
> vbCrLf) at the end of each string that you send. From what you said, you
> had applied a "workaround" of using a time-delay as a kind of "delimiter".
> The basic problem is that you didn't understand that consecutive
> ".SendData" invocations would pack the strings into the same packet. Since
> you did this without an ending delimiter, the program at the receiving end
> had that much more difficulty picking the needles out of the haystack.
>
> My three-plus decades as a programmer tell me that the best place to fix a
> bug is the place where the bug is, not downstream of it.
>
> I'm not even going to ask where you got the idea of using the "¤¶£" string
> as a delimiter in your off-the-wall protocol.
>

Whats wrong with the "¤¶£" splitter?



Relevant Pages

  • please pull from the trivial tree
    ... Fix spelling in E1000_DISABLE_PACKET_SPLIT Kconfig description ... +- Finding patch that caused a bug ... +Always try the latest kernel from kernel.org and build from source. ... Length of input string in bytes ...
    (Linux-Kernel)
  • Re: [EGN] Variable hoisting
    ... Re: The Data Quality Act ... In the process I found a SERIOUS bug in the C code. ... CS> The allocated string has no room for the trailing nul. ... An mature adult programmer would have taken it for what ...
    (comp.programming)
  • Re: Comment on trim string function please
    ... I think you have a bug. ... but does it fly past the terminating null character? ... initial space scan) then this writes outside the string. ... ASIDE FROM THE CAST "ISSUES", ...
    (comp.lang.c)
  • Weekly Python Patch/Bug Summary
    ... Patch / Bug Summary ... most missing from Windows distribution ... http://python.org/sf/1541585 closed by gbrandl ... Compiler command percent-sign causes format string error ...
    (comp.lang.python)
  • Re: A critique of test-first...
    ... one nasty bug. ... Now we have a string that has been output to stdout. ... Maybe we don't need to exercise the whole compiler, ... Well, again ex hypothesi, I wrote it ...
    (comp.programming)