-=|GO7|=- Posted February 19, 2005 Share Posted February 19, 2005 Hello ! I'd like to have a combobox with some items containing the pipe (|) caracter. For example : $exp_combo = GUICtrlCreateCombo("",90,38,100,-1,$CBS_DROPDOWNLIST+$WS_VSCROLL) GUICtrlSetData(-1,"semicolon [; ]|comma [ , ]|pipe [ | ]|tab [ tab ]|Other","semicolon [; ]") The problem is that the GUICtrlSetData use also "|" to separate the items in Combo, List & ListViewItem How can i do this ? Link to comment Share on other sites More sharing options...
Holger Posted February 19, 2005 Share Posted February 19, 2005 No chance. But what about using a big "i"? Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
Valik Posted February 19, 2005 Share Posted February 19, 2005 No chance.But what about using a big "i"?<{POST_SNAPBACK}>You're kidding right? You mean nobody wrote an escape for the pipe character like || or something? Link to comment Share on other sites More sharing options...
-=|GO7|=- Posted February 19, 2005 Author Share Posted February 19, 2005 No chance.But what about using a big "i"?<{POST_SNAPBACK}>That's not the same : | - II tried || but that doesn't work. The only way if you have ONLY ONE ITEM with a pipe character is to place it in the GUICtrlCreateCombo first parameter Link to comment Share on other sites More sharing options...
Holger Posted February 19, 2005 Share Posted February 19, 2005 (edited) Hmmm...maybe it should be build in the support for using "||" like "\\".So long...HolgerEdit: I know it looks ugly, but I would use it like (if I had no possible solution for this):GUICreate("test") Dim $names[4] $names[0] = "Brown|Peter" $names[1] = "Black|Mr" $names[2] = "White|Dr" $names[3] = "Man|Super" $precomboval = "" For $i = 0 To 2 $precomboval = $precomboval & StringReplace($names[$i],"|"," I ") & "|" Next $precomboval = $precomboval & StringReplace($names[$i],"|"," I ") Msgbox(0,"precomboval",$precomboval) $combo = GUICtrlCreateCombo("",10,10,150,100) GUICtrlSetData(-1,$precomboval) GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop If $msg = $combo Then Msgbox(0,"Item selected:",StringReplace(GUICtrlRead($combo)," I ","|")) WEnd Edited February 19, 2005 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 19, 2005 Share Posted February 19, 2005 That's not the same : | - II tried || but that doesn't work. The only way if you have ONLY ONE ITEM with a pipe character is to place it in the GUICtrlCreateCombo first parameter<{POST_SNAPBACK}>Lowercase "L" | (pipe) = l ("L") Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
SlimShady Posted February 19, 2005 Share Posted February 19, 2005 You're kidding right? You mean nobody wrote an escape for the pipe character like || or something?<{POST_SNAPBACK}>That's sucks allright.I think using || is a good idea. Link to comment Share on other sites More sharing options...
MHz Posted February 19, 2005 Share Posted February 19, 2005 (edited) || is an empty selection. It cannot have a double meaning. It is not possible? Edit: I was going to mention, use semi-colons, to replace pipes in source, but the 1st post example is using special characters. How do you fix that? one way or another, impossible to cover, every scenerio? Not too many OS commands use semi-colons much though, if that is the direction, for a new separator. Edited February 19, 2005 by MHz Link to comment Share on other sites More sharing options...
Valik Posted February 19, 2005 Share Posted February 19, 2005 There should either be user-defineable seperators or there should be a way to escape the hard-coded seperator. We can't just simply forbid a particular character because we want to use it as a delimiter. Switching to some other character as a seperator is just skirting the real issue. Link to comment Share on other sites More sharing options...
MHz Posted February 19, 2005 Share Posted February 19, 2005 user-defineable seperatorsPerhaps the best solution, it is now up to the individual's choice, to make it work. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now