hh:mm:ss input variable remove : symbol ?

Issues related to label design (working with databases, data processing, RFID encoding etc.) and printing (from NiceLabel Express, NiceLabel Pro, NiceForm and NicePrint)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
KLewisBPM
Enthusiast
Posts: 9
Joined: Mon Jun 11, 2007 12:21 pm

hh:mm:ss input variable remove : symbol ?

Post by KLewisBPM » Fri Jul 27, 2007 11:55 am

I have an input variable called f_RcptTime in format hh:mm:ss it needs to form part of a barcode but I can't seem to output it as hhmm removing the colon symbol. I also want to show the variable in its original format elsewhere on the label

All of the label comes from an monitored txt file using nicewatch

cheers

User avatar
lpatty
NiceLabel
NiceLabel
Posts: 60
Joined: Mon Sep 11, 2006 4:15 pm
Location: Milwaukee, WI
Contact:

Post by lpatty » Thu Aug 09, 2007 11:54 pm

Create an Expression in the field that you want to truncate that will take the left 4 characters after removing the colon characters (assumes Time1 is your variable name):

Left(Replace(Time1, ":", ""),4)

KLewisBPM
Enthusiast
Posts: 9
Joined: Mon Jun 11, 2007 12:21 pm

Post by KLewisBPM » Wed Aug 15, 2007 3:31 pm

Thanks for the response, however I do not understand where I should type this expression?

When I look at format tab, I can select the input hh:mm:ss and the output, however I need there to be hhmm in the list not hh:mm

I managed to create a variable so I could use the time more than once with different outputs but hhmm. Its driving me insane.

I did try to create a Visual Basic variable but that just give parenthesis errors

User avatar
jurk
Addict
Addict
Posts: 175
Joined: Wed Sep 27, 2006 1:10 pm
Location: Sencur, Slovenija
Contact:

Post by jurk » Mon Oct 08, 2007 11:57 am

Create a VBScript function (Data->Functions) and use f_RcptTime as input variable like this:

Result = Left(Replace(f_RcptTime, ":", ""),4)

Then use output variable of the function (tipicaly VBcript1) on the label.

This should do the trick 8)
NiceLabel Development

KLewisBPM
Enthusiast
Posts: 9
Joined: Mon Jun 11, 2007 12:21 pm

vb script

Post by KLewisBPM » Tue Oct 30, 2007 10:57 am

I have revisited this as a matter of urgency

I created a vb script as suggested and I get the following error when I run check script.

"Script Error:

Cannot use parentheses when calling a sub

Line number 1:"

The code I entered under detailed tab is..

Left(Replace(f_RcptTime, ":", ""),4)

Kind regards

EDIT: I updated the code to: Result = Left(Replace(f_RcptTime, ":", ""),4) and it now checks out ok!! will try and run the label through my system and see what happens.

Post Reply