Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 21st, 2007, 05:15 AM
Registered User
 
Join Date: May 2007
Location: Hyderabad, A.P, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Quotes in textbox

Hi,
I want to display 6" Torte in a text box (As it can be editted later) but the textbox displays only 6 and not the whole text. I have tried using """" and chr(34) but nothing works.
I would appriciate if someone would suggest me a way to do it..
Thanks

  #2 (permalink)  
Old May 21st, 2007, 05:36 AM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 txtName1.Text = "6" & """" & " Torte" should work.

Is it Vb2005.net?

I'm not sure it works in other versions of VB.


  #3 (permalink)  
Old May 21st, 2007, 06:00 AM
Friend of Wrox
Points: 687, Level: 9
Points: 687, Level: 9 Points: 687, Level: 9 Points: 687, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: Chennai, Tamilnadu, India.
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It works...

see...

create a text file, say "data.txt" that holds the content like 6" Torte
(just I used this for my ref to work...)

#1
Open App.Path & "\data.txt" For Input As 1
Input #1, dd
Close #1
MsgBox dd

#2
Dim fso As New FileSystemObject
Dim ts
Set ts = fso.OpenTextFile(App.Path & "\data.txt", ForReading)
dd = ts.ReadLine
ts.Close
MsgBox dd

if you are reading the data from the text file... and if you are using... #1 then it fails, try #2 it works, so the same, if you are trying to get the data from database.

(hope I got you right, if not explain still in detail and put that sample code in here, what you hav did)


With Regards,
Raghavendra Mudugal
  #4 (permalink)  
Old May 21st, 2007, 08:33 AM
Registered User
 
Join Date: May 2007
Location: Hyderabad, A.P, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its VB6
I have used "6" & "#34;" & "Torte" and it worked fine. Thanks a lot

  #5 (permalink)  
Old May 21st, 2007, 04:25 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Why make thigs so hard with something like
Code:
    txtName1.Text = "6" & """" & " Torte"
It is all one string, it is all literal. Why concatenate?
Code:
    txtName1.Text = "6"" Torte"
VB interprets every set of double quotes (by set, I mean two in a row) as a single double-quote in the resultant string.
  #6 (permalink)  
Old May 22nd, 2007, 01:35 AM
Registered User
 
Join Date: May 2007
Location: Hyderabad, A.P, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

please see the code below
----
<%
t="6"&""""&" Torte"
%>
<input type="Text" name="test" value=<%=t%>>



  #7 (permalink)  
Old May 22nd, 2007, 01:56 AM
Friend of Wrox
Points: 687, Level: 9
Points: 687, Level: 9 Points: 687, Level: 9 Points: 687, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: Chennai, Tamilnadu, India.
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Fixed...

<% t="6" & """" & "&nbsp;Torte" %>

<input type="Text" name="test" value=<%=t%>>

With Regards,
Raghavendra Mudugal
  #8 (permalink)  
Old May 22nd, 2007, 02:29 AM
Registered User
 
Join Date: May 2007
Location: Hyderabad, A.P, India.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey, Thanks a lot. Its solved..



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you get Rid of quotes hewstone999 Access VBA 1 April 15th, 2008 10:42 AM
double quotes MyronCope Classic ASP Basics 2 November 21st, 2006 09:31 AM
displaying single quotes and double quotes ren_123 Classic ASP Databases 2 February 22nd, 2006 02:17 PM
Double Quotes and Single Quotes Problem phungleon Classic ASP Basics 7 May 27th, 2004 01:44 PM
RE: Quotes in Arrays tp194 Beginning PHP 2 March 9th, 2004 11:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.