×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Convert Formula to String (in solvable)

## Convert Formula to String (in solvable)

(OP)
I found an in solvable issue, I use AutoCAD MEP and this support VBS v3.0 if I remember correctly, everything work good but ...

... When I try convert create a tag for my object like "ABC-123", VBS read this like a formula, and I already tried everything in the internet to convert this Tag/Formula to String but is unsolvable...

I just found a trick, to convert "ABC-123" in a String I need add a invisible character in the end, like this:

"ABC-123(Chr28)" = "ABC-123 "

... and this was a temporal solution until I tried print and use Adobe Acrobat and other PDF readers, this las character is interpreted as "/" or "|".

So, my last hope is request for help to the Tek-TIPS gurus.

Any suggestion or help?

### RE: Convert Formula to String (in solvable)

Why do you use Chr(28)? It is FS = File Separator.
Why don't you prefer to use Chr(32), which is a normal space?

### RE: Convert Formula to String (in solvable)

(OP)
I tried every character in :

https://www.vbsedit.com/html/c60e2712-20e6-40f2-8f...

just 28, 29, (I already do not remember if 30) works, other character convert "ABC-123" in number Integer and leave "0.000"

probably "ABC-123" mean variable "ABC" minus (-) value "123"

edit: I also tried CStr(ABC-123)

### RE: Convert Formula to String (in solvable)

"ABC-123" is string in vbscript.

Unfortunately I've never seen the software you mentioned and I don't understand well how Autocad MEP, VBscript and PDF are related: As I understood VBscript is a scripting language of Autocad MEP. But how do you get from Vbscript to PDF?

### RE: Convert Formula to String (in solvable)

(OP)
AutoCAD have a PLOT command, this command put the TAG-OBJECT than contain the VBS with "RETURN = ABC-123" to pdf, and I am not sure why happen this issue only here.

Also Cstr(ABC-123) should work or maybe I did anything wrong.

Any suggestion? Or is there another command to convert a Formula to String?

### RE: Convert Formula to String (in solvable)

Really need to see some of the actual code you are using, but from what you have shown here if actually representative then

RETURN = ABC - 123

RETURN = "ABC - 123"

Or, if that line is really in quotes as per your post, then:

"RETURN = ABC - 123"

"RETURN = ""ABC - 123"""

### RE: Convert Formula to String (in solvable)

>Also Cstr(ABC-123) should work

In the sense that it will attempt to evaluate ABC - 123 first, then convert the result into a string

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!