Compare commits

...
12 Commits
14 changed files with 201 additions and 299 deletions

No files matched your search

+4 -1
View File
@@ -1,4 +1,7 @@
*.o *.o
*~ *~
jet-2.0 jet-2.0
docs/JetCore.aux
docs/JetCore.dvi
docs/JetCore.log
docs/JetCore.toc
+113 -10
View File
@@ -9,7 +9,7 @@
namespace jet { namespace jet {
Operand::Operand(coreutils::ZString &in, Tag &tag) { Operand::Operand(coreutils::ZString &in, Tag &tag, bool stop) : in(in), tag(tag) {
doubleValue = 0; doubleValue = 0;
@@ -64,6 +64,11 @@ namespace jet {
Operand op(parm1.string, tag); Operand op(parm1.string, tag);
string = op.string; string = op.string;
isNumber = op.isNumber; isNumber = op.isNumber;
if(isNumber) {
doubleValue = op.doubleValue;
string = std::format("{:.12f}", doubleValue);
string.removeTrailingZeros();
}
boolean = op.boolean; boolean = op.boolean;
} else } else
throw coreutils::Exception("Expecting ) at end of EXPR expression."); throw coreutils::Exception("Expecting ) at end of EXPR expression.");
@@ -146,9 +151,63 @@ namespace jet {
} else } else
throw coreutils::Exception("Expecting ) at end of ABS expression."); throw coreutils::Exception("Expecting ) at end of ABS expression.");
} else if(in.ifNextIgnoreCase("MAX")) { } else if(in.ifNextIgnoreCase("MAX")) {
if(!in.ifNext("("))
throw coreutils::Exception("Expecting ( for MAX parameters.");
Operand *parm = new Operand(in, tag);
string = parm->string;
doubleValue = parm->doubleValue;
isNumber = parm->isNumber;
delete parm;
while(in.ifNext(",")) {
parm = new Operand(in, tag);
if(isNumber != parm->isNumber)
throw coreutils::Exception("All parameters in MAX expression must be same type.");
if(isNumber) {
if(parm->doubleValue > doubleValue) {
doubleValue = parm->doubleValue;
string = parm->string;
}
} else {
if(parm->string > string) {
doubleValue = parm->doubleValue;
string = parm->string;
}
}
delete parm;
}
if(!in.ifNext(")")) {
throw coreutils::Exception("Expecting ) at end of MAX expression.");
}
string.removeTrailingZeros();
} else if(in.ifNextIgnoreCase("MIN")) { } else if(in.ifNextIgnoreCase("MIN")) {
if(!in.ifNext("("))
throw coreutils::Exception("Expecting ( for MIN parameters.");
Operand *parm = new Operand(in, tag);
string = parm->string;
doubleValue = parm->doubleValue;
isNumber = parm->isNumber;
delete parm;
while(in.ifNext(",")) {
parm = new Operand(in, tag);
if(isNumber != parm->isNumber)
throw coreutils::Exception("All parameters in MIN expression must be same type.");
if(isNumber) {
if(parm->doubleValue < doubleValue) {
doubleValue = parm->doubleValue;
string = parm->string;
}
} else {
if(parm->string < string) {
doubleValue = parm->doubleValue;
string = parm->string;
}
}
delete parm;
}
if(!in.ifNext(")")) {
throw coreutils::Exception("Expecting ) at end of MIN expression.");
}
string.removeTrailingZeros();
} else if(in.ifNextIgnoreCase("POW")) { } else if(in.ifNextIgnoreCase("POW")) {
if(!in.ifNext("(")) if(!in.ifNext("("))
throw coreutils::Exception("Expecting ( for POW parameters."); throw coreutils::Exception("Expecting ( for POW parameters.");
@@ -274,9 +333,27 @@ namespace jet {
} else } else
throw coreutils::Exception("Expecting ) at end of TRUNC expression."); throw coreutils::Exception("Expecting ) at end of TRUNC expression.");
} else if(in.ifNextIgnoreCase("CEIL")) { } else if(in.ifNextIgnoreCase("CEIL")) {
if(!in.ifNext("("))
throw coreutils::Exception("Expecting ( for CEIL parameters.");
Operand parm1(in, tag);
if(in.ifNext(")")) {
doubleValue = ceil(parm1.doubleValue);
isNumber = true;
string = std::format("{:.12f}", doubleValue);
string.removeTrailingZeros();
} else
throw coreutils::Exception("Expecting ) at end of CEIL expression.");
} else if(in.ifNextIgnoreCase("FLOOR")) { } else if(in.ifNextIgnoreCase("FLOOR")) {
if(!in.ifNext("("))
throw coreutils::Exception("Expecting ( for FLOOR parameters.");
Operand parm1(in, tag);
if(in.ifNext(")")) {
doubleValue = floor(parm1.doubleValue);
isNumber = true;
string = std::format("{:.12f}", doubleValue);
string.removeTrailingZeros();
} else
throw coreutils::Exception("Expecting ) at end of FLOOR expression.");
} else if(in.ifNextIgnoreCase("UNIXTIME")) { } else if(in.ifNextIgnoreCase("UNIXTIME")) {
if(!in.ifNext("(")) if(!in.ifNext("("))
throw coreutils::Exception("Expecting ( for UNIXTIME."); throw coreutils::Exception("Expecting ( for UNIXTIME.");
@@ -287,7 +364,21 @@ namespace jet {
int unixtime = seconds_since_epoch.count(); int unixtime = seconds_since_epoch.count();
string << unixtime; string << unixtime;
} else } else
throw coreutils::Exception("Expecting ) at end of UNIXTIME."); throw coreutils::Exception("Expecting ) at end of UNIXTIME.");
}
else if(in.ifNextIgnoreCase("DATEDIFF")) {
if(!in.ifNext("("))
throw coreutils::Exception("Expecting ( for DATEDIFF.");
Operand parm1(in, tag);
if(!in.ifNext(","))
throw coreutils::Exception("Expecting , in DATEDIFF expression.");
Operand parm2(in, tag);
if(in.ifNext(")")) {
// TODO: Implement DATEDIFF.
} else
throw coreutils::Exception("Expecting ) at end of DATEDIFF expression.");
} else if(in.ifNextIgnoreCase("true")) { } else if(in.ifNextIgnoreCase("true")) {
boolean = true; boolean = true;
string = "true"; string = "true";
@@ -306,7 +397,15 @@ namespace jet {
throw coreutils::Exception("operand is not valid."); throw coreutils::Exception("operand is not valid.");
in.skipWhitespace(); in.skipWhitespace();
if(!stop)
parseOperator();
return;
}
int Operand::parseOperator() {
if(in.ifNext("!=") || in.ifNext("<>")) { if(in.ifNext("!=") || in.ifNext("<>")) {
Operand op(in, tag); Operand op(in, tag);
if(isNumber && op.isNumber) { if(isNumber && op.isNumber) {
@@ -451,6 +550,8 @@ namespace jet {
} }
} }
} }
if(in.ifNext("+")) { if(in.ifNext("+")) {
if(isNumber) { if(isNumber) {
Operand op(in, tag); Operand op(in, tag);
@@ -475,28 +576,30 @@ namespace jet {
throw coreutils::Exception("operand is not a number."); throw coreutils::Exception("operand is not a number.");
} else if(in.ifNext("*")) { } else if(in.ifNext("*")) {
if(isNumber) { if(isNumber) {
Operand op(in, tag); Operand op(in, tag, true);
if(op.isNumber) { if(op.isNumber) {
doubleValue *= op.doubleValue; doubleValue *= op.doubleValue;
string = std::format("{:.12f}", doubleValue); string = std::format("{:.12f}", doubleValue);
string.removeTrailingZeros(); string.removeTrailingZeros();
parseOperator();
} else } else
throw coreutils::Exception("operand is not a number."); throw coreutils::Exception("operand is not a number.");
} else } else
throw coreutils::Exception("operand is not a number."); throw coreutils::Exception("operand is not a number.");
} else if(in.ifNext("/")) { } else if(in.ifNext("/")) {
if(isNumber) { if(isNumber) {
Operand op(in, tag); Operand op(in, tag, true);
if(op.isNumber) { if(op.isNumber) {
doubleValue /= op.doubleValue; doubleValue /= op.doubleValue;
string = std::format("{:.12f}", doubleValue); string = std::format("{:.12f}", doubleValue);
string.removeTrailingZeros(); string.removeTrailingZeros();
parseOperator();
} else } else
throw coreutils::Exception("operand is not a number."); throw coreutils::Exception("operand is not a number.");
} else } else
throw coreutils::Exception("operand is not a number."); throw coreutils::Exception("operand is not a number.");
} else }
return; return true;
} }
} }
+6 -1
View File
@@ -10,8 +10,11 @@ namespace jet {
class Operand { class Operand {
public: public:
Operand(coreutils::ZString &in, Tag &tag); Operand(coreutils::ZString &in, Tag &tag, bool stop = false);
coreutils::ZString &in;
Tag &tag;
bool isNumber; bool isNumber;
/// ///
@@ -23,6 +26,8 @@ namespace jet {
coreutils::MString string = ""; coreutils::MString string = "";
double doubleValue; double doubleValue;
int parseOperator();
}; };
-86
View File
@@ -1,86 +0,0 @@
\relax
\@writefile{toc}{\contentsline {chapter}{\numberline {1}Introduction}{5}{}\protected@file@percent }
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{toc}{\contentsline {section}{\numberline {1.1}Use Cases}{5}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {1.1.1}World Wide Web Site}{5}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {1.1.2}API Handling}{5}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {1.1.3}Asterisk Dial Plan Generator Tool}{5}{}\protected@file@percent }
\@writefile{toc}{\contentsline {chapter}{\numberline {2}Tags and Attributes}{7}{}\protected@file@percent }
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{toc}{\contentsline {chapter}{\numberline {3}User Defined Tags and Tag Libraries}{9}{}\protected@file@percent }
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{toc}{\contentsline {chapter}{\numberline {4}Variables and Variable Types}{11}{}\protected@file@percent }
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{toc}{\contentsline {section}{\numberline {4.1}Global Variables}{11}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {4.2}Local Variables}{12}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {4.3}Keyword Variables}{12}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {4.4}Environment Variables}{12}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {4.5}CGI Variables}{12}{}\protected@file@percent }
\@writefile{toc}{\contentsline {chapter}{\numberline {5}Expressions}{13}{}\protected@file@percent }
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{toc}{\contentsline {section}{\numberline {5.1}Operators}{13}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.1}Arithmetic Operators}{13}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.2}Boolean Operators}{13}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {5.2}Function Reference}{13}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {5.3}Date Functions}{13}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.1}unixtime}{13}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {5.4}Math Functions}{13}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.1}abs}{13}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.2}acos}{13}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.3}asin}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.4}atan}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.5}cos}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.6}max}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.7}min}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.8}pow}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.9}random}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.4.10}sin}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {5.5}String Functions}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.1}concat}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.2}integer}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.3}left}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.4}reverse}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.5}right}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.6}round}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.7}substring}{14}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.8}tolower}{15}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.9}toupper}{15}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.10}trim}{15}{}\protected@file@percent }
\@writefile{toc}{\contentsline {subsection}{\numberline {5.5.11}expr}{15}{}\protected@file@percent }
\@writefile{toc}{\contentsline {chapter}{\numberline {6}Common Gateway Interface Features}{17}{}\protected@file@percent }
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{toc}{\contentsline {section}{\numberline {6.1}Session Control}{17}{}\protected@file@percent }
\@writefile{toc}{\contentsline {chapter}{\numberline {7}Tag Reference}{19}{}\protected@file@percent }
\@writefile{lof}{\addvspace {10\p@ }}
\@writefile{lot}{\addvspace {10\p@ }}
\@writefile{toc}{\contentsline {section}{\numberline {7.1}call}{19}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.2}comment}{19}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.3}cookie}{20}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.4}dump}{20}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.5}exclude}{20}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.6}expr}{20}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.7}for}{20}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.8}header}{20}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.9}if/else}{20}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.10}ifrow/else}{21}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.11}include}{21}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.12}jet}{21}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.13}mysql}{21}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.14}read}{21}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.15}set}{22}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.16}sql}{22}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.17}stream}{22}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.18}system}{22}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.19}tag}{22}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.20}until}{23}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.21}while}{23}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.22}whiledir}{23}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.23}whilerow}{23}{}\protected@file@percent }
\@writefile{toc}{\contentsline {section}{\numberline {7.24}write}{23}{}\protected@file@percent }
\gdef \@abspage@last{23}
BIN
View File
Binary file not shown.
-126
View File
@@ -1,126 +0,0 @@
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) (preloaded format=pdflatex 2024.11.17) 11 NOV 2025 10:01
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**JetCore.tex
(./JetCore.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-01-22>
(/usr/share/texlive/texmf-dist/tex/latex/base/book.cls
Document Class: book 2023/05/17 v1.4n Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/bk10.clo
File: bk10.clo 2023/05/17 v1.4n Standard LaTeX file (size option)
)
\c@part=\count187
\c@chapter=\count188
\c@section=\count189
\c@subsection=\count190
\c@subsubsection=\count191
\c@paragraph=\count192
\c@subparagraph=\count193
\c@figure=\count194
\c@table=\count195
\abovecaptionskip=\skip48
\belowcaptionskip=\skip49
\bibindent=\dimen140
)
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2024-01-04 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count196
\l__pdf_internal_box=\box51
)
(./JetCore.aux)
\openout1 = `JetCore.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <12> on input line 9.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line 9.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line 9.
[1
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2
]
(./JetCore.toc
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 2.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 2.
[3])
\tf@toc=\write3
\openout3 = `JetCore.toc'.
[4]
Chapter 1.
[5
] [6
]
Chapter 2.
[7] [8
]
Chapter 3.
[9] [10
]
Chapter 4.
[11{/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-ts1.enc}] [12]
Chapter 5.
[13
] [14] [15] [16
]
Chapter 6.
[17] [18]
Chapter 7.
[19
] [20] [21] [22] [23] (./JetCore.aux)
***********
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-01-22>
***********
)
Here is how much of TeX's memory you used:
508 strings out of 474222
9280 string characters out of 5748732
1936975 words of memory out of 5000000
22826 multiletter control sequences out of 15000+600000
564392 words of font info for 57 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
35i,6n,50p,280b,189s stack positions out of 10000i,1000n,20000p,200000b,200000s
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></us
r/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/shar
e/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texli
ve/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb></usr/share/texlive/texm
f-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb></usr/share/texlive/texmf-dist/
fonts/type1/public/amsfonts/cm/cmsl10.pfb></usr/share/texlive/texmf-dist/fonts/
type1/public/amsfonts/cm/cmtt10.pfb></usr/share/texmf/fonts/type1/public/cm-sup
er/sfrm1000.pfb>
Output written on JetCore.pdf (23 pages, 138298 bytes).
PDF statistics:
119 PDF objects out of 1000 (max. 8388607)
77 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)
BIN
View File
Binary file not shown.
Binary file not shown.
+30 -4
View File
@@ -1,4 +1,6 @@
\documentclass{book} \documentclass{book}
\usepackage{fontspec}
\setmainfont{Roboto}
\title{JET Extension Tags} \title{JET Extension Tags}
\author{Bradford Matthew Arant Sr.} \author{Bradford Matthew Arant Sr.}
@@ -166,15 +168,19 @@ operators, as follows:
\section{Date Functions} \section{Date Functions}
\subsection{datediff}
\subsection{unixtime} \subsection{unixtime}
\section{Math Functions} \section{Math Functions}
\subsection{abs} \subsection{abs}
Returns the absolute value of the given parameter.
\subsection{acos} \subsection{acos}
Returns to arc-cosine of the given parameter. Returns to arc cosine of the given parameter.
\subsection{asin} \subsection{asin}
@@ -182,10 +188,20 @@ Returns to arc-cosine of the given parameter.
\subsection{cos} \subsection{cos}
\subsection{floor}
\subsection{ceil}
\subsection{max} \subsection{max}
Returns the greatest value item from a list of comma seperated values in a
list.
\subsection{min} \subsection{min}
Returns the least value item from a list of comma seperated values in
a list.
\subsection{pow} \subsection{pow}
\subsection{random} \subsection{random}
@@ -196,11 +212,15 @@ Use the random function to return a random number between 0 and 1.
\section{String Functions} \section{String Functions}
String functions are provided to accelerate the building and parsing of strings passed into the expression. Numbers can be treated as a string or a number depending on the function called and the data state of the values being manipulated. String functions are provided to accelerate the building and parsing of
strings passed into the expression. Numbers can be treated as a string or
a number depending on the function called and the data state of the values
being manipulated.
\subsection{concat} \subsection{concat}
The concat tag is used to assemble a string by concatenating one or more values to formulate the resulting string. The concat function is used to assemble a string by concatenating one or
more values to formulate the resulting string.
@@ -208,6 +228,12 @@ The concat tag is used to assemble a string by concatenating one or more values
\subsection{left} \subsection{left}
Use the left function to return the number of characters specified in
the second parameter from the parameter passed as the first parameter.
If the number of characters to return is greater than the length of
the first parameter then the entire parameter is returned.
\subsection{reverse} \subsection{reverse}
\subsection{right} \subsection{right}
@@ -542,4 +568,4 @@ a container to process for each row retrieved by the sql statement.
Use the write tag to write data to the local file system. Use the write tag to write data to the local file system.
\end{document} \end{document}
-70
View File
@@ -1,70 +0,0 @@
\contentsline {chapter}{\numberline {1}Introduction}{5}{}%
\contentsline {section}{\numberline {1.1}Use Cases}{5}{}%
\contentsline {subsection}{\numberline {1.1.1}World Wide Web Site}{5}{}%
\contentsline {subsection}{\numberline {1.1.2}API Handling}{5}{}%
\contentsline {subsection}{\numberline {1.1.3}Asterisk Dial Plan Generator Tool}{5}{}%
\contentsline {chapter}{\numberline {2}Tags and Attributes}{7}{}%
\contentsline {chapter}{\numberline {3}User Defined Tags and Tag Libraries}{9}{}%
\contentsline {chapter}{\numberline {4}Variables and Variable Types}{11}{}%
\contentsline {section}{\numberline {4.1}Global Variables}{11}{}%
\contentsline {section}{\numberline {4.2}Local Variables}{12}{}%
\contentsline {section}{\numberline {4.3}Keyword Variables}{12}{}%
\contentsline {section}{\numberline {4.4}Environment Variables}{12}{}%
\contentsline {section}{\numberline {4.5}CGI Variables}{12}{}%
\contentsline {chapter}{\numberline {5}Expressions}{13}{}%
\contentsline {section}{\numberline {5.1}Operators}{13}{}%
\contentsline {subsection}{\numberline {5.1.1}Arithmetic Operators}{13}{}%
\contentsline {subsection}{\numberline {5.1.2}Boolean Operators}{13}{}%
\contentsline {section}{\numberline {5.2}Function Reference}{13}{}%
\contentsline {section}{\numberline {5.3}Date Functions}{13}{}%
\contentsline {subsection}{\numberline {5.3.1}unixtime}{13}{}%
\contentsline {section}{\numberline {5.4}Math Functions}{13}{}%
\contentsline {subsection}{\numberline {5.4.1}abs}{13}{}%
\contentsline {subsection}{\numberline {5.4.2}acos}{13}{}%
\contentsline {subsection}{\numberline {5.4.3}asin}{14}{}%
\contentsline {subsection}{\numberline {5.4.4}atan}{14}{}%
\contentsline {subsection}{\numberline {5.4.5}cos}{14}{}%
\contentsline {subsection}{\numberline {5.4.6}max}{14}{}%
\contentsline {subsection}{\numberline {5.4.7}min}{14}{}%
\contentsline {subsection}{\numberline {5.4.8}pow}{14}{}%
\contentsline {subsection}{\numberline {5.4.9}random}{14}{}%
\contentsline {subsection}{\numberline {5.4.10}sin}{14}{}%
\contentsline {section}{\numberline {5.5}String Functions}{14}{}%
\contentsline {subsection}{\numberline {5.5.1}concat}{14}{}%
\contentsline {subsection}{\numberline {5.5.2}integer}{14}{}%
\contentsline {subsection}{\numberline {5.5.3}left}{14}{}%
\contentsline {subsection}{\numberline {5.5.4}reverse}{14}{}%
\contentsline {subsection}{\numberline {5.5.5}right}{14}{}%
\contentsline {subsection}{\numberline {5.5.6}round}{14}{}%
\contentsline {subsection}{\numberline {5.5.7}substring}{14}{}%
\contentsline {subsection}{\numberline {5.5.8}tolower}{15}{}%
\contentsline {subsection}{\numberline {5.5.9}toupper}{15}{}%
\contentsline {subsection}{\numberline {5.5.10}trim}{15}{}%
\contentsline {subsection}{\numberline {5.5.11}expr}{15}{}%
\contentsline {chapter}{\numberline {6}Common Gateway Interface Features}{17}{}%
\contentsline {section}{\numberline {6.1}Session Control}{17}{}%
\contentsline {chapter}{\numberline {7}Tag Reference}{19}{}%
\contentsline {section}{\numberline {7.1}call}{19}{}%
\contentsline {section}{\numberline {7.2}comment}{19}{}%
\contentsline {section}{\numberline {7.3}cookie}{20}{}%
\contentsline {section}{\numberline {7.4}dump}{20}{}%
\contentsline {section}{\numberline {7.5}exclude}{20}{}%
\contentsline {section}{\numberline {7.6}expr}{20}{}%
\contentsline {section}{\numberline {7.7}for}{20}{}%
\contentsline {section}{\numberline {7.8}header}{20}{}%
\contentsline {section}{\numberline {7.9}if/else}{20}{}%
\contentsline {section}{\numberline {7.10}ifrow/else}{21}{}%
\contentsline {section}{\numberline {7.11}include}{21}{}%
\contentsline {section}{\numberline {7.12}jet}{21}{}%
\contentsline {section}{\numberline {7.13}mysql}{21}{}%
\contentsline {section}{\numberline {7.14}read}{21}{}%
\contentsline {section}{\numberline {7.15}set}{22}{}%
\contentsline {section}{\numberline {7.16}sql}{22}{}%
\contentsline {section}{\numberline {7.17}stream}{22}{}%
\contentsline {section}{\numberline {7.18}system}{22}{}%
\contentsline {section}{\numberline {7.19}tag}{22}{}%
\contentsline {section}{\numberline {7.20}until}{23}{}%
\contentsline {section}{\numberline {7.21}while}{23}{}%
\contentsline {section}{\numberline {7.22}whiledir}{23}{}%
\contentsline {section}{\numberline {7.23}whilerow}{23}{}%
\contentsline {section}{\numberline {7.24}write}{23}{}%
+21
View File
@@ -24,3 +24,24 @@ mktextfm Bookman
mktextfm Bookman mktextfm Bookman
mktextfm Bookman mktextfm Bookman
mktextfm Bookman mktextfm Bookman
mktextfm Georgia
mktextfm Georgia
mktextfm Georgia
mktextfm Georgia/BI
mktextfm Georgia
mktextfm Georgia/B
mktextfm Georgia
mktextfm Georgia/I
mktextfm Georgia
mktextfm Georgia
mktextfm Georgia
mktextfm Georgia
mktextfm Georgia
mktextfm Georgia
mktextfm Georgia
mktextfm PadaukBook
mktextfm PadaukBook
mktextfm PadaukBook
mktextfm Gerramond
mktextfm URWBookman
mktextfm Bookman
+1 -1
View File
@@ -1,6 +1,6 @@
#!../jet-2.0 #!../jet-2.0
<jet cgi="true" name1="localname" filterblanklines="true" trimlines="true"> <jet cgi="true" name1="localname" filterblanklines="true" trimlines="true">
<mysql host="localhost" database="barant" user="barant" password="uversa" sessionid="1"> <mysql host="barant.com" database="barant" user="barant" password="uversa" sessionid="1">
<sql sessionid="1">select * from testdata</sql> <sql sessionid="1">select * from testdata</sql>
<whilerow name="index" count="10" sessionid="1"> <whilerow name="index" count="10" sessionid="1">
$[1.id] $[1.text] $[1.value] $[1.id] $[1.text] $[1.value]
+13
View File
@@ -12,4 +12,17 @@ $[righty]=56789
$[trim]=this is a test $[trim]=this is a test
<set name="integer" expr="integer(12430.54356546)" /> <set name="integer" expr="integer(12430.54356546)" />
$[integer]=12430 $[integer]=12430
<set name="result" expr="5 + 5 * 5" />
$[result]=30
<set name="result" expr="5 + 5 * 5 + 5" />
$[result]=35
<set name="result" expr="(5 * 2) + (5 * 5) + (5 * 2)" />
$[result]=45
<set name="fivexfive" expr="5 * 5" />
<set name="result" expr="5 * 2 + $[fivexfive] + 5 * 2" />
$[result]=45
<set name="result" expr="2 + 2 * 3 + 2" />
$[result]=10
<set name="result" expr="expr(2 + 2 * 3 + 2)" />
$[result]=10
</jet> </jet>
+13
View File
@@ -64,9 +64,22 @@
</for> </for>
<call error="rc" pgm="/usr/bin/ls" arg1="-al" name="ls" /> <call error="rc" pgm="/usr/bin/ls" arg1="-al" name="ls" />
$[rc] $[rc]
<set name="max" expr="max(1, 2, 3, 4, 5, 4, 3, 2, 1)" />
max=$[max]
<set name="max" expr="max('A', 'B', 'C', 'D', 'E', 'D', 'C', 'B', 'A')" />
max=$[max]
<set name="min" expr="min(1, 2, 3, 4, 5, 4, 3, 2, 1)" />
min=$[min]
<set name="min" expr="min('A', 'B', 'C', 'D', 'E', 'D', 'C', 'B', 'A')" />
min=$[min]
<set name="list" expr="'A', 'B', 'C', 'D', 'E', 'D', 'C', 'B', 'A'" />
<set name="minlist" expr="min($[list])" />
minlist=$[minlist]
<comment>
$[ls] $[ls]
<read file="../compile" name="file" /> <read file="../compile" name="file" />
$[file] $[file]
</comment>
<comment> <comment>
<whiledir path="/var/www" filename="file" fullpath="fullpath" filenamenoextension="noext" sort="true"> <whiledir path="/var/www" filename="file" fullpath="fullpath" filenamenoextension="noext" sort="true">
$[file] $[fullpath] $[noext] $[file] $[fullpath] $[noext]