Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • 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.

Students Click Here

Convert Formula to String (in solvable)

Convert Formula to String (in solvable)

Convert Formula to String (in solvable)

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)

I tried every character in :


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)

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

should read

RETURN = "ABC - 123"

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

"RETURN = ABC - 123"

should read

"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.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

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:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close