December 22nd, 2012, 02:12 PM
Sort nodes in a Treeview or ASCII Tab file?
I have been asked to tackle a task in VB6 that is a little beyond my skills and am hoping someone here can help me out.
I have a treeview control and I need to scramble the level based on the last 4-8 digits(I have also figured out how to save this to an ASCII tab file. I don't know if that would be easier to manipulate) . The left side of the tree would stay the same, just the digits on the right side of the tree would be scrambled.
To briefly give you a view this is a sample of what the treeview might look like.
I need to start at the outer level and scramble based on the digits at the end. In this case the last 6 digits. So in this case I might get something like:
Then go up to the next level and then scramble it was well. Perhaps getting something like this:
Continue up the levels until you reach the upper most node.
I have worked on this and have these values sitting in a treeview called TreeView1 and have also been able to save this to an ASCII tab file. I am not sure if it would be easier to modify the ASCII file, then read into the control. Or make the updates directly to the tree.
The values in each node is one string so to figure out the number of numeric digits to the right, I assume you would have to read from the right until you hit a space. The length would be the same for all values within the tree. So if the first value is determined to be 6 digits long, then all the scrambling should be performed on six digits for all the nodes.
I have attached a copy of the ASCII tab file just in case it is easier to modify the file directly.
I realize this is a lot of ask and I really appreciate any help you can provide. I am not very familiar with VB so ideally something that I could just plug into the existing code would be much appreciated.
To add one more twist if the node starts with an asterick, it should be sorted to the bottom of the level. staying within the group. That is if the value is currently under AA, it should remaining within AA, just moved to the bottom. If this last part is too much to ask, I can work on it at another time. The main think right now is scrambling the values.
Thank you in advance. I donít know if we can offer payment for help, if so, that is a possibility.
Thanks again, and merry Christmas.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.