Solved

Variable Declaration

Posted on 2003-10-22
9
198 Views
Last Modified: 2010-05-03
I wrote an application that converts text to SGML.  VB application and it works great.

BUT:

I use an array to hold the various tags for the SGML.  

Ex.

varData(13) = "<title>" & Title & "</title>"
varData(14) = "<tgroup cols='4' colsep='1' rowsep='1' align='left' charoff='50'>"
varData(15) = "<colspec colname='col1' colwidth='0.55in'><colspec colname='col2'

PROBLEM: The sgml editor "Arbor Text"  encloses attributes with a " not a '

Ideally:  My array's should not alter the syntax.  cols='4' should be cols="4", colsep='1' should be colsep="1"

Question:  Is there a way to code a variable as strCols = "cols="4" " or  strFour = ""4""

bp



0
Comment
Question by:brianpowell
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 2

Expert Comment

by:-Bender-
ID: 9598193
Try strFour = """4"""

-Bender-
0
 
LVL 9

Accepted Solution

by:
Dang123 earned 102 total points
ID: 9598198
If you put two " together in a sttring the compiler will give you one in the srting

for example:

varData(14) = "<tgroup cols=""4"" colsep=""1"" rowsep=""1"" align=""left"" charoff=""50"">"
0
 
LVL 9

Expert Comment

by:Dang123
ID: 9598213

  Guess I typed a little to slowly     ; )
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:brianpowell
ID: 9598249
Dang123

really...  

i'll do the test.


pretty fast response.  thanks


bp
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9598283
You can also use

Chr$(34)


ie

strFour = Chr$(34) & "4" & Chr$(34)
0
 
LVL 1

Author Comment

by:brianpowell
ID: 9598284
pretty straight forward.  

varData(14) = "<tgroup cols=""4"" colsep=""1"" rowsep=""1"" align=""left"" charoff=""50"">"

After looking at it a second time why wouldn't work...


bp
0
 
LVL 1

Author Comment

by:brianpowell
ID: 9598297
EDDYKT

I also like your response.

but the points have been assigned.

bp
0
 
LVL 2

Expert Comment

by:-Bender-
ID: 9598310
Retry: try """4""" instead of ""4""

;-)
0
 
LVL 2

Expert Comment

by:grnathan
ID: 9598420
Is there a way to code a variable as strCols = "cols="4" " or  strFour = ""4""

Ya we can do that

If you want doubquotes in a variable value you have to use that in 2 times

e.g. (strcols = """cols=""4""") and strfour = """4"""

rams
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question