• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

Variable Declaration

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
brianpowell
Asked:
brianpowell
  • 3
  • 2
  • 2
  • +2
1 Solution
 
-Bender-Commented:
Try strFour = """4"""

-Bender-
0
 
Dang123Commented:
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
 
Dang123Commented:

  Guess I typed a little to slowly     ; )
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
brianpowellAuthor Commented:
Dang123

really...  

i'll do the test.


pretty fast response.  thanks


bp
0
 
EDDYKTCommented:
You can also use

Chr$(34)


ie

strFour = Chr$(34) & "4" & Chr$(34)
0
 
brianpowellAuthor Commented:
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
 
brianpowellAuthor Commented:
EDDYKT

I also like your response.

but the points have been assigned.

bp
0
 
-Bender-Commented:
Retry: try """4""" instead of ""4""

;-)
0
 
grnathanCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now