Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox disabling items with \\ in list
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Combobox disabling items with \\ in list
Miscellaneous
Thread ID:
00609037
Message ID:
00609037
Views:
47
I'm populating a combox with all the available printers on a machine. The printers are sharenames and look like "\\MyServer\MyPrinter".

The comboxbox rowSourceType = 5 - Array, and the rowsource = this.aList.

In the requery of the combo I put:
m.numOfPrinters = Aprinters(printerList)

If m.numOfPrinters  > 0
	Dimension This.alist[Alen(printerlist, 1), 2]
	Local i
	For m.i = 1 To Alen(printerList, 1)
		Local printerName
                ** Double all the backslashes so the items are not disabled.
		m.printerName = Strtran(printerList[m.i, 1], "\", "\\")
		This.alist[m.i, 1] = m.printerName
	Next
endif
The printers with "\\\\" in the beginning of the string are still showing up as disabled.

If I change the combo rowSourceType to 0 and use .addItem(m.printerName) they are NOT disabled.

Anyone know why it works differently depending on the rowSourceType?

tia
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Next
Reply
Map
View

Click here to load this message in the networking platform