Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using // in strings

Status
Not open for further replies.

poeijer

Programmer
May 29, 2002
69
0
0
NL
when i have a string in a textbox starting with //
and i put this txtbox.value to my listbox
it only takes one / instead of 2 /'s

i know that sometimes // expects another value and if not
found it wil correct himself orso, but how can i
get it to work??

any ideas?

thanks
 
poeijer

Is this a date value? Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
poeijer

Do you "pre-write" to slashes?
As in this example:
Code:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"
	ADD OBJECT text1 AS textbox WITH ;
		Height = 23, ;
		Left = 108, ;
		Top = 60, ;
		Width = 216, ;
		Name = "Text1"
	ADD OBJECT command1 AS commandbutton WITH ;
		AutoSize = .T., ;
		Top = 168, ;
		Left = 168, ;
		Height = 27, ;
		Width = 91, ;
		Caption = "Textbox value", ;
		Name = "Command1"
	PROCEDURE Init
		this.text1.Value = "\\"
		this.text1.SelStart=3
	ENDPROC
	PROCEDURE command1.Click
		MESSAGEBOX(thisform.text1.value)
	ENDPROC
ENDDEFINE
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
No,

because it can be a normal pathname e.g.:

c:\My documents\test.doc

or

\\fileserver\c\documents\test.doc

in the first case it puts the entire path in the listbox
in the 2nd case it puts \fileserver\c\documents\test.doc in the listbox
 
I believe this is a bug, I would just add the extra "/", unfortunately it may difficult to determine when to add it, but if you store the path to a variable first, it retains the full path and you could do a check on the second character and if in the variable its a "/", then add it to the value sent to the list box. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Yes,

that is my current solution..

2 bad it isnt fixed yet :(

thanks anyway!.
 
poeijer

BTW as a last word of warning, putting a "\" at the beginning of a line in a combobox and a listbox, normally disables the item. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top