Print

ELP provides a low level method to define and set variables, read variables from different sources and place them into the document. This works for any kind of data streams, so for example also for Postscript!

  1. ELP provides quite some methods of gathering variables
  2. ELP calculations with the key: Variable
  3. ELP calculations with the key: Counter
  4. Calculations with Trigger_variable

Identifiers of a variable must follow some rules:

Short summary what is described in details in this document:

Please note, that the limitation for finding the tags in the data streams is the same, as explained in the Search and Trigger key sections. If ELP is not able to find the key, then please send your local distributor (PPADIN info box) the print data, we will try to find the reason.

Tipps:

How Variables can be used:

1. ELP provides quite some methods of gathering variables

Variables can be used to collect information from various sources. See chapter 1. Later they can be used to automatically print then in forms or data streams, simply by putting the variable name in. if, for example, you did develop a form with the forms & filed installer and there the variable #DATENUM_US# is used, then the variable is replaced with "01/10/2010".

1.1. The predefined variables, available at start-up of the process:

A shortened list of the most popular variables.

Variables available on startup of each job, before any data stream bytes are read:

Value-Name Description
#ACTREADPAGECOUNTER# While reading the data stream into ELP, this key will hold the actual read page number. Please note, that you need to turn PreParsing=ON in the rule GLOBAL.
#ACCTOTALPAGES# total pages for accounting
#DRIVERLOCATION# Location field content of the printing windows queue
#DRIVERCOMMENT# Comment field content of the printing windows queue
#ELP_FORMS_PATH# Contains the forms path from the ELP command line argument. Backslash or slash (Unix) is added! It can be changed using the WKDIR command.
#ELPCOPYFACTOR_K# The amount of copies from the last defined K command in an ELP_Command.
For evaluations or usage of that variable in rules, the ELP_Command located in the data stream itself, e.g. <<K2;>> is NOT available at that time.
#ELP_PROG_PATH# Path to the ELP Software, In windows to the convert.exe file, usually C:\Program Files (x86)\welp\ with [back]slash at the end.
#ELP_STARTUPFORMS_PATH# On start same content as #ELP_FORMS_PATH# above, but fixed for ever to the initialization value.
#HOSTNAME# The variable is set to the content of start-up -Q7 operand. It contains the name of the Host without leading \\ like the #PCNAME# does have.
#IN_ELP_FILENAME# Contains the incoming file name, including the full path from W-ELP command line argument. Variable is mostly used by call commands.
IMPORTANT NOTE: In the versions of ELP (March 2011), this file could be the original print file located in the spooler. So do NOT use it for building additional file names.
#IN_ELP_FILENAMEWITHOUTPATH# Contains the incoming file name, without path from W-ELP command line argument. Variable is mostly used by call commands.
IMPORTANT NOTE: In the versions of ELP (March 2011), this file could be the original print file located in the spooler. So do NOT use it for building additional file names.
#OUT_ELP_FILENAME# Contains the outgoing file name, including the full path from W-ELP command line argument. Variable is mostly used by call commands.
#OUT_ELP_FILENAMEWITHOUTPATH# Contains the outgoing file name, without path from W-ELP command line argument. Variable is mostly used by call commands.
#PCNAME# The variable is set to the content of start-up -P2 operand, or read with a higher priority from the PJL ATTRIB Commands out of the data stream. In most cases the content is \\Hostname. Sometimes it is populated as \\<IP-v4-Address> or \\<IP-v6-Address>.
#PRINTDOCNAME# The variable is set to the content of start-up -P4 operand
#PRINTDOCNAME_UNI# The variable is set to the content of start-up -P4 operand (in Unicode)
#PRINTERDRIVERNAME# The variable is set to the content of start-up -Q1 operand
#PRINTERNAME# The variable is set to the content of start-up -P1 operand
#PRINTERSHARENAME# The printer share name is mainly for MS windows integration in order to resend the same job to the same queue using the expression: OutPort=\\#HOSTNAME#\#PRINTERSHARENAME#
#RANDOM# random number from file name
#USERNAME# The variable is set to the content of start-up -P3 operand, the user name of the Job Info from Spooler, or read with a higher priority from the PJL ATTRIB Commands out of the data stream.
#USERNAME_UNI# Same as above, but in Unicode notation for accounting the full document names in your local language.
#USERNAMECOMMANDLINE# The variable is set to the content of start-up -P3 operand, the user name of the Job Info from Spooler.
#USERNAMECOMMANDLINE_UNI# Same as above, but in Unicode notation for accounting the full document names in your local language.

 

Available date and time variables (Available at start up)

Value-Name Description Sample
#ACTTIME# Hours:Minutes:Seconds 15:45:55
#DATEDDMMYYYY# DDMMYYYY 01062004
#DATEMMDDYYYY# MMDDYYYY 06012004
#DATENUM# Day.Month.Year 01.6.2004
#DATENUM_US# Month/Day/Year 06/01/2004
#DATESERIAL# Serial number for date and time 20110423152822
#DATESERIALLONG# Serial number for date and time with millisecond 201104231528220157
#DATETEXT# Day Month Year text 6 June 2004
#DATETEXT_D# dito in German 06 August 2005
#DATETEXT_IT# dito in Italian 10 Settembre 2018
#DATETEXT_PL# dito in Polish  
#DATETEXT_SP# dito in Spanish 10 Septiembre 2018
#MILLISECONDS# Milliseconds of the start time 000 to 999
#MONTH# January, February, March etc September
#MONTH_D# dito in German Juni
#MONTH_IT# dito in Italian  
#MONTH_PL# dito in Polish  
#MONTH_SP# dito in Spanish  
#MONTHNUM# Month numerical 01-12 09
#TODAYNUM# The actual day of today 01, 02 .. 31
#WEEKDAY# Sunday, Monday, Tuesday etc. Sunday
#WEEKDAY_D# dito in German Montag
#WEEKDAY_IT# dito in Italian  
#WEEKDAY_PL# dito in Polish  
#WEEKDAY_SP# dito in Spanish Lunes
#YEARNUM# Year 2018

 

Variables which are generated on demand during the treatment of the data stream

Value-Name Description
#ACCTOTALPAGES# total pages for accounting
#COPYCOUNT# Only usable in conjunction with ELP_Command K for copy generation. Used in a macro with a macro number of larger then 25000, an automatic copy counter can be defined, like Copy 1, Copy 2 etc..
#EMAILERRORCODE# The variable is initialized with 0. If an error occurs when sending email via PowerShell, the variable is set to the error code 1 and the section [On_Error_Email] will be executed.
#EMAILSUBJECT# Holds the subject text, when sending out emails
#JOB_COUNTER# If key enabled, then jobs or even any single item can be counted. See description here: Counter
#LAST_ARCHIVE_FILE# Path and file name of the last created archive file, independent if in or out data are stored. Can be used in an reporting file if needed.
#LAST_ARCHIVE_FILE_PDF# Path and file name of the last created PDF archive file, independent if in or out data are stored. Can be used in an reporting file if needed.
#LAST_ARCHIVE_FILE_TIFF# Path and file name of the last created TIFF archive file, independent if in or out data are stored. Can be used in an reporting file if needed.
#OMR_.... The Tech Ref OMR does provide the full description of the OMR related variables
#PAGECOUNT# Use this variable to generate an automatic page counter, Example: Page counter
#PAGEPERCOPYCOUNT# Same as #PAGECOUNT#, but the page counter counts only within a copy. So with the beginning of every copy the counter is reset to page number 1
With ELP_Command usage of K factor the result is 123... 123... etc. with Q it will be 111... 222... 333...
#PREPARSEPAGECOUNT# page count as a result of preparsing, is automatically generated when key PreParsing=ON
#RESET_PAGECOUNT# VARIABLE=#RESET_PAGECOUNT#:0 Default: If an UEL is found in the PCL data stream, the page counter is reset to 1
VARIABLE=#RESET_PAGECOUNT#:1 If an UEL is found in the PCL data stream and the page counter is even and we are in duplex mode, the counter is incremented by 1.
This version should only be used in duplex printing to move to the next odd page number.
The same result could be achieved using the key ELP_Cont_Page_Counting.
#INIT_COMMANDFILE# Holds the path to the initial convert.ini file.
#VAR_ACTROWNO# Is automatically created by ELP when minimum one Search_RowNo command is defined in the configuration file. The Variable holds the actual processed row number can can be evaluated for example during a Search_Binary triggered rule using the keys: TriggerSectionAfterStore or TriggerSection. See Search_RowNo for an example.
#VAR_ACTCOLNO# Is automatically created by ELP when minimum one Search_RowNo command is defined in the configuration file. The Variable holds the actual processed column number can can be evaluated for example during a Search_Binary triggered rule using the keys: TriggerSectionAfterStore or TriggerSection. See Search_RowNo for an example.
#VAR_BARCODE_COUNTER# How many bar codes are converted during the job execution
#VAR_ELPCOMMAND_USED# TRUE/FALSE
#VAR_FORMSLOAD_COUNTER# How many forms are loaded during the job exe
#VAR_INFILESIZE# file size of input file, or how many bytes have been read (in Blocks of Max_ReadBuffer) when a search_ command was found.
#VAR_OUTFILESIZE# For accounting, the variable holds the total written amount of bytes. The volume nearly doubles if the job is reverse printed.
#VAR_TCPIP_PORT# Name of printer TCP/IP printer port
#VAR_ORIENTATION# Stores the print orientation (portrait, landscape, etc) of the data stream, if defined in the data stream.
#VAR_PAGESIZE# Stores the page size (A4, Legal, etc) of the data stream, if defined in the data stream.
#VAR_PAPERTRAY# Stores the PCL paper tray number of the first page
#VAR_RESOLUTION# Stores the resolution (300, 600, etc) of the data stream, if defined in the PJL section of the data stream.
#VAR_SIMPLEXDUPLEX# Stores the simplex/duplex function of the data stream, if defined in the data stream.
#VAR_UNICODE_CHAR_COUNTER#  
#VAR_UNICODE_CHARMISS_COUNTER#  
#VAR_UNICODE_DOLLAR_COUNTER#  
#VAR_UNICODE_USED# TRUE/FALSE

 

Additional variables for Accounting

#ACC_EDITTEXT# Special field generated by the accounting via Projects software. It contains standard editable text which can be placed on the print pages
#ACC_FILE# Filename usually from ACC_FILE key which contains the file name for the accounting file.
#ACC_PROJECT# Name of a project which can be stored into a the accounting file. (Project Accounting)
#ACC_STOREVALUES# Variable which holds all the variables, whose content should be stored into the accounting database or file.
#ACC_TYPE# Holds the value if the accounting information is written into a .dbf or [Unicode] CSV file.
#ACCTOTALPAGES# This is the amount of print pages, provided through the -p5 parameter (In MS Windows automatically done). For PCL data streams the counter is set to 0 and ELP does count all Form Feeds itself. *
#ACCTOTALCOLOREDPAGES# Not officially released variable, but does exist and does it best to separate colored from b/w pages.

 

Additional counters for Safe Monitored Printing:

#SNMP_TOTALPAGECOUNT# The actual page counter read back from the printer, before the job starts
#SNMP_TOTALDUPLEXPAGECOUNT# Same, but Duplex Page Counter if available
#SNMP_TOTALCOLORPAGECOUNT# Same, but Color Pages Counter if available
#SNMP_JOBPAGECOUNT# Contains the amount of the printed pages, either at the job end, or until the job is canceled.
#SNMP_JOBDUPLEXPAGECOUNT# Same for Duplex Page amount
#SNMP_JOBCOLORPAGECOUNT# Same for Color Page amount
#SNMP_JOBSTATUS# Contains a string if job was completed successfully or not

 

Additional values for Plotter Multiroll support:

#VAR_GL2MAX_X# Plot X size in mm
#VAR_GL2MAX_Y# Plot Y size in mm

Note: Variables can be overwritten any time, using any method like: Variable=, Variable_File= or StoreNextWordToVariable= etc. It is NOT recommended, but possible. maybe make an own variable in the rule Global and copy the startup variable like:

[Global]

Variable=#MyUSER_NAME#:#USER_NAME#

 

1.2. Variables can be defined using the key Variable=[#]name[#]:value

Use the ini-files to define any additional variables. This function is for example a perfect way, to differentiate between several companies. If each company prints fixed to the same queue, the printer sections can define the variables for each company, which are used in the forms.

The syntax in the ini-file is:

Variable=#VarName#:VarValue

Notes:

Example: VARIABLE=#COMPANY#:" My Company Ltd. \x22Germany\x22" From now on the variable #COMPANY# is searched in the data stream and is replaced with the ' My Company Ltd. "germany"' (without ').

Delete_Variable: This key deletes any, even ELP internal, variable from the memory. Missing # signs are added automatically.

Rename_Variable: Searches for a given variable by its accurate name and replaces the name to a new given one. Missing # signs are added automatically.
Note: The second parameter can be a new variable name as text or an existing variable where the variable value will be used as the new variable name.

It is recommended to initialize all own defined variables in the rule GLOBAL. They also can be generated from existing variables, using operators like LEFT, RIGHT, ... operators from existing variables. See further down chapter 2.

Often they are used in a Boolean way to set them e.g. to FALSE, then if some searches come true they are set to TRUE and then later key Trigger_Variable can be used to activate rules on the state of the variable.

1.3. With Search_xxx and StoreNextWordTo[Int]Variable can ELP extract / read nearly any information out of the data stream into variables.

StoreNextWordToVariable The function will read the next word[s] behind the searched item into an provided ELP variable. Enter a variable name: #MyVariableName#. It is recommended to initialize the variable in the rule GLOBAL with the key Variable. Optional you may enter the minimum length of the information: #MyVariableName#;Length. It can be used in any Search_xxx rule versions.

Without an optional length indication, ELP will store the next following word after the searched term into the provided value name. The word ends with any text character in the data stream which is below or equal ASCII 32, like blank or Carriage Return or Line Feed. The length added with ; is the minimum length. So any blanks below that minimum amount of characters will NOT end the storage.

The ELP key StoreNextWordToVariableMaxLen=## does end the storage after having ## characters read back from the data stream.

This stored variable can be used later in any form, even to generate variable HPS or archive index files. See chapter archive for further information.

The StoreNextWordToIntVariable reads the next number after the searched item.

If the searched section requests to delete the searched term using the Erase_Binary key, the found next word will also be erased.

Immediately after the variable is read from the data stream, the optional key TriggerSectionAfterStore is checked. Found in the same rule / section, ELP does call the provided rule name. So the variable content can be for example immediately analyzed, and actions taken.
But note, that the trigger analysis is always about Max_ReadBuffer Bytes behind the search analysis. So by default there will be no trigger available until the first 2048 bytes had been read and searched through. You may use the SetTrigger key in rule Global to activate a standard always true binary trigger in such a rule.
ADD_Binary can be used in those tested rules as well, but without ERASE_Binary. In that case the text added will be directly after the searched term and the searched term will contain the added information as well!

The key Add_BinaryAfterStore adds a provided text and/or print commands behind the information, which was read out of the stream. Erase_Binary can be used as well!
In conjunction with the TriggerSectionAfterStore the read information can be analyzed and direct new statements can be replaced or added.

The key TriggerSectionAfterStore can be used X times in the executed Search_xxx rule. E.g. in rule GLOBAL to analyze at startup some already passed information, like print queue or document name etc.

It is recommended to start and end the variable name with the # sign, as otherwise you may lose a significant processing speed.

The optional length indicates the requested minimum length in bytes of the stored item. Requested means, that if the data ends before with an escape sequence (Search_Binary mode) or any other character below ASCII 32, the parser stops reading into variable. In Search_Windows mode the positioning sequences are skipped.

If the length ends in the middle of a word, ELP will continue reading until the end of that word.

[Global]

; init variable

Variable=#OrderName#:Nothing found

[Search for address Line 1]

; After this text in the printed document

Search_Windows=Ordered by:

; There is the name of the person who have ordered the parts we need to store the name to a variable, which may read over all blanks for minimum 20 characters

StoreNextWordToVariable=#OrderName#;20

; Should be only read on time

Search_Only_Once=ON

; Speed up process

ReadOnlySearchKeys=ON

; perform a special rule for Order Name stethos GmbH

TriggerSectionAfterStore=Check for OrderName

[Check for OrderName]

; Primary trigger always true if more than Max_ReadBuffer was read.

Trigger_binary=1

; Now if order name was stethos Systemhaus GmbH

Trigger_Variable=stethos Systemhaus GmbH:#OrderName#

; Do not print

NoPrinting=ON

StoreNextWordToIntVariable= same as above, but Information is supposed to be a valid number, otherwise 0 is stored.

 

Notes for using the keys StorenextWordTo[Int]variable with Search_Windows_New or Search_Text_New triggered rules:

1.4. They can be loaded from ASCII files

The key Variable_File can read any defined variables from an ASCII file. It is recommended to store the files into the Workpath folder (e.g. c:\ProgramData\WELP) and open them with this key argument: #ELP_FORMS_PATH#ELP_VarsIn.var. You may recognize, that the filename definition of the Variable_File key may contain any previously defines variables. The file name maybe followed by a semicolon and the separator character between the variable name and variable value. Character must be > ASCII 32 (Blank). Character # is not allowed. Default sign is = ASCII 61 (Hex 3D). So the file name can be for example user or printer specific: Variable_File=#ELP_FORMS_PATH##PRINTERNAME#MyVarFile.var.

Together with the key Variables_Store values and information like for example counter can even be passed from the actual data stream to the next one or the any one coming sometimes in, you need the information.

The syntax for reading variables out of an own defined file is:

Example: A plumping parts distributor has thousands of prices and a huge PageMaker based price list. For each new price list version he needed to sit down and compare 20.000 prices if they changed.
With ELP he just needed to

The ELP did such a good job, that the client even started to generate client specific price lists. Another example: Send automatically printed copies to a user list.

The key Variables_Store writes all or a pack of named variables back into the provided file name, which may contain any ELP collected variable.

1.5. Reading variables out of the active directory

See here for further details: Reading ELP Variables from Active Directory

1.6. Reading from system environment

The ELP key GetEnvVariable reads any available environment viable into a ELP variable. The variable name is set to uppercase and surrounded by the # characters.

GetEnvVariable=os may lead to an ELP Variable #OS# with the content Windows_NT.

But a #OS# may also be found in the data stream (graphical data) it is recommended to make the variable name longer with: GetEnvVariable=os;MyOSNumber

Type SET in a DOS command window to view the environment settings.

1.7. [Job-] Counters

ELP can also handle counter, which are normal variables. They can be increased or decreased by any amount, once executed in a rule, maybe triggered by a searched argument. A special counter is generated with the key: JobCounter.

An example where similar variables with an own internal counter have to be counted is here: Send automatically printed copies to a user list.

1.8. The Search_RowNo key

Only used in conjunction with ASCII based print files! The key is used to read form a specific page, row and start colon number a text with a certain length into a variable.

1.9. Database variables

After a database file is opened and a special record was searched and found, ELP will read automatically some predefined variables.

The key DB_Variable can then be used to reads a field content from the database.

Notes:

  1. ELP searches automatically for the names of the variables in the data stream, as well as in all loaded forms / macros. Once found they are automatically replaced with the current value. So for example a page counter can be inserted while writing the data stream out.
  2. A variable name starts and ends usually with the character "#". The name itself is searched case sensitive, in binary and windows mode.
  3. Please note, that the limitation for finding the tags in the data stream is the same, as explained in the Search and Trigger key sections.
  4. *To ensure, if your requested variables are available, you may also store their latest values at the end of the conversion run into a file. The function is activated if the ini file key VARIABLES_STORE was found in any activated section.
  5. You may use the same ELP PCL sequence in order to split a huge incoming data stream in the archive directly into its native documents. See Job Splitting for further details.

2. ELP calculations with the key Variable

Currently ELP supports the following none nestable functions for string manipulations. The Syntax of the case sensitive named functions are:

ASC(#CharVar#) Returns the ASCII value of the first character of a string
FILECOUNT(#Variable#)

Windows systems only!
Returns the amount of files in the directory named by the provided variable. Notes:
a) It is a must to use a variable as an operand, otherwise the function will NOT be executed.
b) You may use wildcards in the search expression.
Variable=#MyDir#:d:\pp\*.pdf
Variable=#MyFileCount#:FILECOUNT(#MyDir#)
FILEEXISTS(#Variable#) Returns YES or NO depending if the provided file does exist or not.Note: It is a must to use a variable as an operand, otherwise the function will NOT be executed.
Variable=#MyOrt#:d:\pp\test.pdf
Variable=#MyFileExists#:FILEEXISTS(#MyOrt#)
GETFILENAMES((#Variable#))

Windows systems only!
Returns a variable table based upon the name of the provided variable. Note: Like the list functions above, the operand must be an ELP variable.
The function creates a list of 3 columns: Each set is named like the variable with a counter.
The return value is the amount of found files.
Variable=#MyDir#:d:\pp\*.pdf
Variable=#MyFileListCounter#:GETFILENAMES(#MyDir#)
The example above does create those variables:
#MyDir# with the name of the searched directory and the file pattern
#MyFileListCounter# with the amount of found files for that pattern
This table:
#MyDir_1# for the first file name, The second is called #MyDir_2# etc.
#MyDir_1_path# for the first file name including the full path, The list is continued with _2_ etc.
#MyDir_1_old# time in seconds how old the file is between the actual date and time and the file creation time. Continued with _2_ as well.
LEFT(#StringVar#,Length)
LEFT(#StringVar#,#IntVar#)
The functions are only interpreted, if they are set direct in front of a variable and there is a comma direct after the variable followed by the length number and the closing parenthesis. The positive length represents the amount of bytes to be taken out of the provided variable. The amount can be represented another variable.
LOWER(#StringVar#) Turns all ASCII characters from the variable into lower case.
LTRIM not available, but use STRREP(#StringVar#, ) instead
MIDSTR(#StringVar#, Startpos,length)
MIDSTR(#StringVar#, #Startpos#, #IntVar#)
Returns a string with the length of Length bytes beginning at stringVariable offset defined in Startpos.
READVALUEFROMVARFILE("#VariableToFileName#",#StringVar#) This function reads the value of a named variable out of a variable file. The first operand defines the filename. The complete name needs to be surrounded by two "" double quotes. After the starting ", it is required to define an ELP variable. ELP uses the same routine as the key Variable_File does. So you may add also the option ;DelimiterChar at the end of the file name.
The name of the loaded variable is provided in the second parameter. You may use a search string or you can search for the content of a variable. Examples:
Variable=#MyEmailAddress#: READVALUEFROMVARFILE("#ELP_FORMS_PATH#eMail.var",Thomas)
The variable file content may be: Thomas=This email address is being protected from spambots. You need JavaScript enabled to view it.
Variable=#MyEmailAddress#: READVALUEFROMVARFILE("#ELP_FORMS_PATH#eMail.var;:",#USERNAME#)
The variable file content may be: Stefan:This email address is being protected from spambots. You need JavaScript enabled to view it.
RIGHT(#StringVar#,Length)
RIGHT(#StringVar#,#IntVar#)
The bytes are taken from the right side of the evaluated string.
RTRIM(#StringVar#) Eliminates all right handed blanks from the variable content.
STRLEN(#StringVar#) [-IntegerValue] +IntegerValue] [-#ELPVariable#] [+#ELPVariable#] Return the length of a string variable. You may add or subtract and constant value to the returned value by adding the value with plus or minus direct behind the ).
Examples: The content of the #Variable# is ?Hello World?
STRLEN(#Variable#) -> 11
STRLEN(#Variable#)-6 -> 5

STRPOS(#StringVar#, #SearchVar#) [-....][+....]


STRPOS(#StringVar#,Text) [-....][+....]


STRPOS(#StringVar#," ") [-....][+....]

Returns the first position minus 1 of the first character of the #SearchVar# string found in the #Variable# string. If the string could not be found then function returns zero.
Leading blanks can only be searched if the search text is surrounded be double quotes.
The command can follow a plus or minus calculation, without blanks! See STRLEN() command.
Examples: The content of the #Variable# is "Hello World"
STRPOS(#Variable#," ") -> 5
STRPOS(#Variable#,"World") -> 6
Assume content #SVar# is "World?"
STRPOS(#Variable#,#SVar#) -> 6
Assume content #SVar# is " " (a blank)
STRPOS(#Variable#,#SVar#) -> 0
Assume content #SVar# is " World"
STRPOS(#Variable#,#SVar#)+4 -> 10
STRREP(#SearchedStr#,
#SearchString#,
#ReplaceString#,
#StartPos#,
#Repeat#);

The function STRingREPlace is a very powerful function to search for substrings and replace or erase them completely complete.

#SearchedStr# is the String which is searched through for the SearchStr. This is always an ELP variable, as everything else does not make any sense.
#SearchStr# Is the string which is in SearchedStr searched for, It can be a variable or any other text not surrounded by ". Leading and following blanks will be searched for.
#ReplaceStr# The string which replaces the found searched string. If the searched text should be erased you need to enter the comma direct behind the last comma. A replace text can be entered instead of a variable.
#StartPos# The offset of the start search position within the #SearchedStr#.
#ReplaceTimes# Defines how often the term is searched and replaced for. The value zero or less will replace recursively all found substrings in the #SearchedStr# beginning at the #StartPos#.

For the example table below the searched string in variable #A# is always:abc1234abc 56 78abc
Command #B# #C# #D# #E# Result
STRREP(#A#,a) - - - - bc1234bc 56 78bc
STRREP(#A#, )
Blank after comma
Blank sign - - - abc1234abc5678abc
STRREP(#A#,#B#) " " - - - abc1234abc5678abc
STRREP(#A#,#B#,
#C#,#D#,#E#)
abc ABC 0 0 ABC1234ABC 56 78ABC
STRREP(#A#,abc,
ABC,0,0)
- - - - ABC1234ABC 56 78ABC
STRREP(#A#,#B#
,,0,0)
abc - - - 1234 5 678
STRREP(#A#,#B#
,,#D#,0)
abc - 5 - abc1234 56 78
STRREP(#A#,abc ,ABC,0,0) abc + Blank - - - abc1234ABC56 78abc
STRREP(#A#,#B#,
#C#,#D#,#E#)
abc Abc 5 1 abc1234Abc 56 78abc
UPPER(#StringVar#) Turns all ASCII characters from the variable into upper case.
Math calculations +;-;*;% are performed with the key Counter. Please note that in an activated rule first all variable keys are performed and after that the Counter key. Example:

Variable=#MyInteger#:10
Counter=#MyInteger#;*2
Variable=#MyResult#:#MyInteger#
; As a result the value #MyInteger# -> 20 but #MyResult# -> 10

To fix that:
[Calculation Part 1]
Trigger_Binary=1
Variable=#MyInteger#:10
Counter=#MyInteger#;*2

[Calculation Continued Part 2]
Trigger_Binary=1
Variable=#MyResult#:#MyInteger#
; Now #MyResult# -> 20
Indirect access to variable values Variable=#VariableName1#:Value of VariableName1
Variable=#Value of VariableName1#:Value of Value of VariableName1
Variable=#VariableName2#:##VariableName1##
As a result the value of #VariableName2# is treaded by the sover like this:
1st step: Variable=#VariableName2#:##VariableName1##
2nd step: Variable=#VariableName2#:#Value of VariableName1#
3rd step: Variable=#VariableName2#:Value of Value of VariableName1
Actually the same as using this definition: Variable=#VariableName2#:#Value of VariableName1#
Anyway, here the value of 1 could be read out of the data stream, and the real searched value for example can be loaded from a variabel file. E.g. A customer number is read from the stream and the needed amount of copies from an ascii file. (See also database examples)

 

Some examples:

String manipulation:

[GLOBAL]

; Whatever you need

; define the starting variables:

Variable=#MyStringVar#:1234abcdef GHIJKL56789
Variable=#MyIntVar#:5

; Examples:
; Result in #MyASCResul1t# is "49"

Variable=#MyASCResult1#:ASC(#MyStringVar#)

; Result in #MyLeftResul1t# is "1234"

Variable=#MyReftResult1#:LEFT(#MyStringVar#,4)

; Result in #MyRightResult2# is "98765"

Variable=#MyRightResult2#:RIGHT(#MyStringVar#,#MyIntVar#)

; Result in #MyDummy# is "10"

Variable=#MyDummy#:STRPOS(#MyStringVar#," ")

; Result in #MyLeftResult2# is "1234abcdef"

Variable=#MyLeftResult2#:LEFT(#MyStringVar#,#MyDummy#)

; Result in #MyStrLenMinus2# is "20"

Variable=#MyStrLenMinus2#:STRLEN(#MyStringVar#)-2

; Result in #MyStrLower# is "1234abcdef ghijkl56789"

Variable=#MyStrLower#:LOWER(#MyStringVar#)

; Result in #MyMidStr# is " GHIJKL56789" including blank

Variable=#MyDummy#:STRPOS(#MyStringVar#," ")
Variable=#MyMidStr#:MIDSTR(#MyStringVar#,#MyDummy#,100)

[Warranty Text printing]

; Find the place to print the info in the data stream

Search_Binary=!WarrantyStatement!

; Replace with text and variable #NextYear#

Replace_binary=This part has warranty up to end of #NextYear#

; Which was calculated from the date code dd.mm.yyyy

variable=#ThisYear#:RIGHT(#DATENUM#,4)

; And incremented by one

Counter=#ThisYear#

[Global]

; For that example preset a variable

Variable=#MyVar#:123

; Make sure a primary trigger is always true (Character 1 is always found in data stream)

SetTrigger=1:ON

[Make sure variable is 10 bytes long]

; Primary trigger always true

Trigger_Binary=1

; If secondary trigger variable length is less then 10 bytes

Trigger_Variable=STRLEN(#MyVar#)<10

; Then insert a leading zero

Variable=#MyVar#:0#MyVar#

; and redo the rule until the length is 10 or more

NextTriggerRule=Make sure variable is 10 bytes long

[Global]

; Preset the trigger variable to be empty

Variable=#MyVar#:""

; and make sure that the primary trigger (Character 1) is always marked as found

SetTrigger= 1:ON

[Search for a special text in the data stream]

Search_Binary=My specialtext

; Mark variable as found

Variable= #MyVar#:Found

[trigger when MyVar did change]

; Prinary Trigger always true

Trigger_Binary=1

; and if secondary is also true:

Trigger_Variable= 1<STRLEN(#MyVar#)

; The make 2 copies

ELP_Command= K2;

; Otherwise this ruleis becoming automatically true

ElseTriggerActivateSection= Do else Rule

[Do else Rule]

; is automatically becoming true when above rule is false
; make 3 copies

ELP_Command= K3;

[Global]

ELP_Command= K3;

[Search for a special text in the data stream]

Search_Binary=My specialtext

ELP_Command= K2;

 

Notes:

Hint:


3. Performing mathematical calculations using the key: Counter

Counter Every time a section/rule is activated through a SEARCH_ key (not Search_RowNo) and this COUNTER key is defined, the provided variable is incremented by default by 1 or any other positive/negative value which can be added after as semicolon

Counter=#VariableName#;*5 Does multiply the value of the variable: #VariableName#

Examples: Counter and generate a counter loop. Perform math calculations.


4. Calculations with Trigger_variable

Trigger_Variable

Compare any collected ELP variable to a given value. The value and the variable name is separated by
: equal
! not equal
> greater (numeric expressions)
< less (numeric expressions)

Trigger_VariableSubString Like the Trigger_Variable Operator :. But instead of an equal comparison, the key becomes true, if the right argument can be found in the left string. The search is case in-sensitive performed.

See for an counter loop example right here.

 

5. Calculations with Check_TelNo

This function does erase all non digit characters out of the content of the named variable. A + at the beginning is turned into 00. Example: +49 (7031) 860910 is turned into 007031860910

How Variables can be used:

 

Related articles: Rule assistant, Search within data stream, Special keys for Searched rules, Trigger Rules, Special keys for triggered rules, Triggering rules with hierarchy