Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


How to use double quotes in a text ?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-26-2008, 09:28 PM
Junior Member
 
Join Date: Apr 2008
Posts: 11
Default How to use double quotes in a text ?

Hi all,

I've got a quick and easy question :
How to use double quotes in a string ?

I tried the usual stuff (using backslash; using 2 doubles quotes), but it does not seems to be that.

Thank you very much for your help.

And congratulations to the developers for this great software !
Reply With Quote
  #2 (permalink)  
Old 04-27-2008, 06:24 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,335
Default

You should use chr(34):
Code:
"This is a " & chr(34) & "double quote" & chr(34)
Or:
q = chr(34)
"This is a " & q & "double quote" & q
Reply With Quote
  #3 (permalink)  
Old 04-27-2008, 07:24 AM
Junior Member
 
Join Date: Apr 2008
Posts: 11
Default

Thanks for your quick answer !
Reply With Quote
  #4 (permalink)  
Old 04-27-2008, 07:58 AM
Senior Member
 
Join Date: Mar 2008
Posts: 114
Default

Hello Origami and welcome !

If you are doing hoardes of quotes in strings, and want some tidy readable code ...

Quote:
' function to change apostrophe to quote
sub a2q(mystr)
a2q = strreplace (mystr," ' ", chr(34)) ' spaces for clarity of apostrophe
end sub

...

x = a2q("Hello 'World', this is your 'infamous' captain 'Jack Sparrow' speaking!")
y = a2q("Arrgh! So 'you' be that 'scurvy knave' they call 'captain jack?' ")
z = a2q("'Aye!' I be that 'scurvy knave' ... ")

Of course if you are using apostrophes as well, then simply use the reverse apostrophe ... ` ... normally found at the top left of your keyboard, like this...

Quote:
' function to change rvs apostrophe to quote
sub a2q(mystr)
a2q = strreplace (mystr,"`", chr(34))
end sub

...

x = a2q("Hello `World`, this is your `infamous` captain `Jack Sparrow` speaking!")
y = a2q("Arrgh! So `you` be that `scurvy knave` they call `captain jack?` ")
z = a2q("`Aye!` I be that `scurvy knave` ... ")

Last edited by badkarma : 04-27-2008 at 08:09 AM.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
StringSplit and double-quotes issue Cableguy Questions & Help Needed 2 07-24-2008 07:05 PM
Double clicks on a cell in a table list, possible? davidcoderlab Questions & Help Needed 3 06-01-2008 03:09 PM
Dim variable c% as Double colin9876 Basic4ppc Wishlist 8 05-28-2008 02:26 PM
Stock Quotes Viewer Alex812 Share Your Creations 2 11-17-2007 09:32 AM
preventing double application launch Put Claude Questions & Help Needed 3 10-02-2007 02:52 PM


All times are GMT. The time now is 06:34 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0