Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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

Reply With Quote
  #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.


Reply With Quote
  #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
Reply With Quote
  #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

Reply With Quote
  #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.
Reply With Quote
  #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%>>



Reply With Quote
  #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
Reply With Quote
  #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..

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:56 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.