Karl Blessing
Programmer
Hello, I would like some assistance reversing this subroutine I have already written for a custom tree component. Right now users could add sets with pictures/descriptions being child nodes of the set nodes. Whenever the tree is updated it generates a string property which is the delimited string that is stored in the MySQL database (I plan on using this as a clientside control to auto-generate the strings for the users on the publishing interfaces) , I wish to take this function and reverse it so that if I loaded a pre-existing gallery delimited string that the treeview could be populated from the saved information and allow for editing. Future thanks for any assistance provided.
a better understanding of the string is as such.
Image#OptionalDescription^Image^Image^Image|Image^Image#optionaldescription^Image^Image|Image
where | seperates the sets
^ seperates each images in a set
and # seperates image from optional description (which is seperated by a comma in the tree as it shares a node)
Thanks again for any assistance. Karl Blessing aka kb244{fastHACK}
Code:
Public Sub update_gallery()
Gal_Text = ""
For Each ObjNode In TreeView1.Nodes
If ObjNode.Children > 0 Then
If Gal_Text <> "" Then
Gal_Text = Gal_Text & "|" & vbCrLf
End If
Set_str = ""
N = ObjNode.Child.FirstSibling.Index
Set_str = ""
While N <> ObjNode.Child.LastSibling.Index
If Set_str <> "" Then
Set_str = Set_str & "^"
End If
Set_str = Set_str & Replace(TreeView1.Nodes(N).Text, ",", "#")
N = TreeView1.Nodes(N).Next.Index
Wend
If Set_str <> "" Then
Set_str = Set_str & "^"
End If
Gal_Code = Gal_Code & Set_str & Replace(TreeView1.Nodes(N).Text, ",", "#")
End If
Next
End Sub
a better understanding of the string is as such.
Image#OptionalDescription^Image^Image^Image|Image^Image#optionaldescription^Image^Image|Image
where | seperates the sets
^ seperates each images in a set
and # seperates image from optional description (which is seperated by a comma in the tree as it shares a node)
Thanks again for any assistance. Karl Blessing aka kb244{fastHACK}
