Saltar al contenido principal

Búsqueda

Búsqueda

String Padding Values In Vbscript

Comentarios

4 comentarios

  • Avatar
    Michael Toupin (mtoupin

    To validate and pad leading zeroes, you'll want to use a VB script like this:

     

    If len(value) < 8 then 
    Do Until len(value) = 8
    value = "0" & value
    Loop 
    End if
    0
  • Avatar
    Legacy Poster

    I had to change it to multi-line script but I was able to get it working properly.The attached shows the final code in case it might help others. 

     

    FYI I did have several of these sub-strings to update and I found that the Bartender program frequently crashed during the process on the Script Assistant window. I had to exit and reopen the file, re-do the changes with the same exact code and it let me save. These crashes happened quite often. I think there might be a few bugs with the Script Assistant part of BarTender. Anyhow I was able to go through it carefully and slowly and I was able to produce the label I needed.

     

    Thank you for your assistance. 

    0
  • Avatar
    Moinabegum Biradar

    Hello I have a simple question.
     
    I have Quantity field on my label, this field must be left padded with zeros when printed in a 2D barcode, but when displayed in human readable, the padded zeros must not be there for Quantity.

    Please suggest how to satisfy the above requirement in BarTender template.

    0
  • Avatar
    Peter Thane

    The simplest way would be to make the field to be padded an Object Value field and then connect that to the none padded field. After that use the Transforms>Number of Characters to add your padding

     

    0

Iniciar sesión para dejar un comentario.