×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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!
  • Students Click Here

*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

Jobs

vbs and code128 string generator

vbs and code128 string generator

vbs and code128 string generator

(OP)
hi,

do you know if there are some vbs function that allows to encode a string in code128?

thanks

RE: vbs and code128 string generator

There is no standard VBS function to generate code128 or any other barcode. You'll have to brew your own. You will need a graphics package of some sort to generate the code. It is not clear whether you wish to

o display it on the screen, say in an HTML browser or wsh app
o generate a bmp/jpg/png
o generate the character sequence for encoding a string

RE: vbs and code128 string generator

(OP)
hi

thanks for your reply !!
I need to obtain the character sequence for encoding as string in a variable..
I've found several examples in vba but nothing in vbs :(

RE: vbs and code128 string generator

It would be quite simple to translate from VBA to VBS: just remove the types.

RE: vbs and code128 string generator

(OP)
yessss
but even if I modify the code as you said..I get error

Mmmm ;(

RE: vbs and code128 string generator

You also need to remove the $ and % signs. In VBA i, i% and i$ are 3 different variables of type real, integer and string. In VBScript, they are typeless

RE: vbs and code128 string generator

Unfortunately the vbscript help files contain following:

"Visual Basic for Applications Features Not In VBScript"
Select Case
Expressions containing Is keyword or any comparison operators
Expressions containing a range of values using the To keyword.
But Case is not really needed here anyway. So simply replace the Case loop with:

CODE

    Dim result
    For i = 1 To Len(chaine)
        result = Asc(Mid(chaine, i, 1))
        If result < 33 Or result > 126 And result <> 203 Then
            i = 0
            Exit For
        End If
    Next 

In addition you'll need to restore a number of &s that you appear to have removed by mistake. And IIF is another VB/VBA statement not supported by VBScript

(all of which shows that translating VB to VBScript isn't quite as simple as removing types and type postfixes winky smile )

RE: vbs and code128 string generator

(OP)
thanks for your big help!!!
:)
I try!

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!

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