Solved

Variable Declaration

Posted on 2003-10-22
9
201 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month4 days, 21 hours left to enroll

636 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