How to Get some text from the variable in ZPL Command - zebra-printers

i have created a simple zpl program. My program Using call a variable, connect with database and uploading in web, this program example:
^XA
^JMA
^PR2
^~SD20
^BY3
^LH20,10
^FO155,152^BY2^BCN,40,N,N,N^FD$USIM$^FS
^A0N,30,30^FO155,197^CI0^FH_^FDNo.SimCard:$USIM$^FS
^PQ1,0,1,Y
^XZ
And result after printing is like
*"Barcode"*
No.Simcard:123456789
My case is how to take just a few numbers in the variable at $USIM$, like a function on the LET that can take several digits from a variable, for example
LET A$="Zebra Quality Printers"
LET B$=A$(1:13)
PRINT B$
Zebra Quality
I want to be able to in my program is only take last 3 digits at $USIM$
*"BARCODE"*
No.Simcard:789
I read the Zebra documentation and it only can in ZBL command, how to convert or make it work in ZPL command ?
Please Help me,
Thank you in advance

Related

How to see the graphical representation of emoji codepoints in R Studio Windows?

I have in a data frame a column with code points corresponding to emoji.
They look something like this:
1F1E8
I am using the remoji library, but as you can see my code points do not have \U in front of them, which is necessary for the methods of this library, as far as I know.
Example:
#This works
message (sub_emoji ("This is silly \U1f626"))
#this does not work
message (sub_emoji ("This is silly 1f626"))
The most I've managed to do is transform the code points to \\U1f626 but it doesn't work either.
Thanks in advance
The solution I was trying was to paste the string "\U" at the beginning of the code points, but being the \ an escape character I couldn't do it. But with some "tricks" it can be done:
I transformed all the code points to the following structure (8 hex digits):
\\U000xxxxx (000 if 5 hex digits in the original code point)
\\U0000xxxx (0000 if 4 hex digits in the original code point)
I have not delved into their implication ("fill" with 0), but the truth is that they work the same way, as far as I've tried:
message(sub_emoji("This is silly \U0001f626"))
This is silly 🤦
and
message(sub_emoji("This is silly \U1f626"))
#This is silly 🤦
I "filled" with 0 because I used the function stri_unescape_unicode() to un-escape the code points \\Uxxxxxxxx and get the desired result \Uxxxxxxxx (one \) to pass it to sub_emoji()
And this function, stri_unescape_unicode(), only gives this result (one \) if the code point has 8 hex digits, I did not study why, I only noticed this by messing around. I also noticed that if the u is lowercase it has another effect.
For example:
#it does not work
stri_unescape_unicode("\\U1F926")
#[1] NA
#Warning message: .....
stri_unescape_unicode("\\U1F926\\U1F3FB")
#[1] NA
#Warning message: .....
#it works
stri_unescape_unicode("\\U0001F926")
#[1] "\U0001f926"
stri_unescape_unicode("\\U0001F926\\U0001F3FB")
# [1] "\U0001f926\U0001f3fb"
A complete example:
em = stri_unescape_unicode("\\U0001f626")
message(sub_emoji(paste("This is silly", em)))
#This is silly 🤦
emc = stri_unescape_unicode("\\U0001F926\\U0001F3FB")
message(sub_emoji(paste("This is silly", emc)))
#This is silly 🤦🏻
Pay attention to this last emoji, it has a different skin and hair color, there is the effect of ZWJ Sequence.

Other options to resize barcode for zebra printer using ZPL?

I want to print a Code 128 barcode with a Zebra printer. But I just can't get exactly where I want because the barcode is either too small or too big for the label size of 40x20 mm. Is there anything else I can try besides using the ^BY (Bar Code Field Default) module width and ratio?
^XA^PQ2^LH0,0^FS
^MUM
^GB40,20,0.1,B^FS
^FO1.5,4
^BY0.2
^BCN,10,N,N
^FD*030493LEJCG002999*^FS
^FO8,15
^A0N,3,3
^FD*030493LEJCG002830*^FS
^MUD
^XZ
Above script gives me a label that looks like this:
But when I just decrease the module width to 0.1 (which is the lowest) the barcode becomes too small and may be problematic to scan with a hand scanner:
Code-128 is a fixed-ratio code, so you would appear to have the choice of two sizes. You may be able to solve the problem by using a 300dpi printer in place of a 200.
If you can change the format (and I'm intrigued by the barcode and readable being different values) then you could save a little by printing one number-sequence and one alpha-sequence, as an even count of numerics will be encoded as alphabet C so you'd save one change-alphabet element.
Do you really need the * on each end?
Otherwise, perhaps code 39 (which prints the * if you use the print-interpretation-line option) would suit your purposes better.
Another Possibility is to do on the fly code-set changes, Try something like
^XA^PQ2^LH0,0^FS
^MUM
^GB60,20,0.1,B^FS
^FO1.5,4
^BY0.2
^BCN,10,N,N
^FD>:*>5030493>6LEJCG>5002830>6*^FS
^FO8,15
^A0N,3,3
^FD*030493LEJCG002830*^FS
^MUD
^XZ
This will allow less symbols to encode your data
If you can structure content to have all the alpha chars a one end or the other.
or (Depending on your firmware) you could use auto ^BCN,10,N,N,N,A

Ruby script for RPG Maker Ace VX, case sensitive ID is octal number

I have inserted a script to make a Journal Quest written by Modern Algebra. It works perfectly but when I tried to input an Item ID, 128, I get an error telling me that the number is an octal. I tried converting the number into a string "128" but the program crashes. This is part of the code:
q[:name] = "Fish for the Inn"
q[:icon_index] = 028
I'm very new to Ruby.
Can you please tell me how to solve this problem?
Thanks!

Increment Serial Number using EXIF

I am using ExifTool to change the camera body serial number to be a unique serial number for each image in a group of images numbering several hundred. The camera body serial number is being used as a second place, in addition to where the serial number for the image is in IPTC, to put the serial number as it takes a little more effort to remove.
The serial number is in the format ###-###-####-#### where the last four digits is the number to increment. The first three groups of digits do not change for each batch I run. I only need to increment that last group of digits.
EXAMPLE
I if I have 100 images in my first batch, they would be numbered:
811-010-5469-0001, 811-010-5469-0002, 811-010-5469-0003 ... 811-010-5469-0100
I can successfully drag a group of images onto my ExifTool Shortcut that has the values
exiftool(-SerialNumber='001-001-0001-0001')
and it will change the Exif SerialNumber Tag on the images, but have not been successful in what to add to this to have it increment for each image.
I have tried variations on the below without success:
exiftool(-SerialNumber+=001-001-0001-0001)
exiftool(-SerialNumber+='001-001-0001-0001')
I realize most likely ExifTool is seeing these as numbers being subtracted in the first line and seeing the second line as a string. I have also tried:
exiftool(-SerialNumber+='1')
exiftool(-SerialNumber+=1)
just to see if I can even get it to increment with a basic, single digit number. This also has not worked.
Maybe this cannot be incremented this way and I need to use ExifTool from the command line. If so, I am learning the command line/powershell (Windows), but am still weak in this area and would appreciate some pointers to get started there if this is the route I need to take. I am not afraid to use the command line, just would need a bit more hand holding then normal for a starting point. I also am learning Linux and could do this project from there but again, not afraid to use it, just would need a bit more hand holding to get it done.
I do program in PHP, JavaScript and other languages so code is not foreign to me. Just experience in writing it for the command-line.
If further clarification is needed, please let me know in the comments.
Your help and guidance is appreciated!
You'll probably have to go to the command line rather than rely upon drag and drop as this command relies upon ExifTool's advance formatting.
Exiftool "-SerialNumber<001-001-0001-${filesequence;$_=sprintf('%04d', $_+1 )}" <FILE/DIR>
If you want to be more general purpose and to use the original serial number in the file, you could use
Exiftool "-SerialNumber<${SerialNumber}-${filesequence;$_=sprintf('%04d', $_+1 )}" <FILE/DIR>
This will just add the file count to the end of the current serial number in the image, though if you have images from multiple cameras in the same directory, that could get messy.
As for using the command line, you just need to rename to remove the commands in the parens and then either move it to someplace in the command line's path or use the full path to ExifTool.
As for clarification on your previous attempts, the += option is used with numbers and with lists. The SerialNumber tag is usually a string, though that could depend upon where it's being written to.
If I understand your question correctly, something like this should work:
1..100 | % {
$sn = '811-010-5469-{0:D4}' -f $_
# apply $sn
}
or like this (if you iterate over files):
$i = 1
Get-ChildItem 'C:\some\folder' -File | % {
$sn = '811-010-5469-{0:D4}' -f $i
# update EXIF data of current file with $sn
$i++
}

How to view complete print output in a terminal?

I'm currently working with a software called CleGo , which is written in O'Caml and I use it in the Toplevel mode. This program computes all Clebsch-Gordan coefficients for a given group representation. Unfortuantely, I can't get the complete output in the terminal. I get:
[[[("-1", ("(0,0,0,0,0,0,1,0,)1", "(0,0,0,0,0,0,-1,0,)1"));
("1", ("(0,0,0,0,0,1,-1,0,)1", "(0,0,0,0,0,-1,1,0,)1"));
("-1", ("(0,0,0,0,1,-1,0,0,)1", "(0,0,0,0,-1,1,0,0,)1"));
...]]]
and I need the complete output that is indicated by "..." in the output. Is there some terminal restrictions that restricts the output to a certain length or is this a special problem of the software?
Any ideas or suggestions would be awesome!

Resources