2 Different Date Format, One Prompt For The User S’abonner

0
Avatar
Legacy Poster

Morning all,

On al specific labelformat, we need to enter the dates in the following formats:

DD MMM
JJMMDD

So, for example:

11 JAN (note that the month needs to be uppercase)
130111

However, I would like the user only to be prompted to insert one date and a script will generate the other format based on the input.

Is this possible ?

Thanks in advance,

Erik

7 commentaires

0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

What version/build of BarTender is in use? Yes this will make a huge difference to the answer.
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Hi Ian

We are using BarTender Automation - Version 9.4 SR1 Build 2760

Kind regards,,

Erik
0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

I suggest you upgrade to the latest service release for starters:

http://www.bartenderbarcodesoftware.com/label-software/fixes_94.aspx

Unfortunately, there were many changes in v10 to make handling dates much easier, therefore we will need to do this the old way by VB script.

In my example we will assume that the date prompt is under a sub-string share name of "btDate" which we can then reference in code:

Value = DatePart("d", Format.NamedSubStrings("btDate").Value) & UCase(MonthName(DatePart("m", Format.NamedSubStrings("btDate").Value), True))

Value = DatePart("y", Format.NamedSubStrings("btDate").Value) & DatePart("m", Format.NamedSubStrings("btDate").Value) & DatePart("d", Format.NamedSubStrings("btDate").Value)

Note that instead of concatenating these VB script expressions into a single line, you could split them up into separate sub-strings to specify validation rules such as minimum number of digits padding on the left with zero when needed.
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Thanks for your help so far Ian,

I just tested this and this seems to work, however I need to do quite some with truncation and combining fields, but works.

Thanks again,

Erik
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

I also would like some help with this type of problem.

I need the date in the barcode and barcode human readable to be YYMMDD (SSCC format) and a 2nd text field to be DD/MM/YYYY from one user input.

 

Any help

Thanks

David

0
Avatar
Canguita
Actions pour les commentaires Permalien

Hello David P.

 

Thank you very much for your post.

 

In this case that you can do is:

 

  1. Create a text in your label and provided it with a shared name (for example MyDate)
  2. Link this text with a Text Input Box
  3. In your BarCode add a VBscript as datasource with "Event Control Scripts" as Script Type. This VBscript should have this code in OnPostPrompt event

          Value = Format.NamedSubStrings("MyDate").Value 

 

After on each object you will need to format the Date as you need.

 

I've attached you a very simple file where you will find that you need.

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Thanks for the demo file - That works for me

Vous devez vous connecter pour laisser un commentaire.