created INTEGER function on operand.

This commit is contained in:
Brad Arant committed 2025-02-04 09:28:28 -08:00
1 parent ce6b163d5d
commit 10db0e9c70
3 files changed
+12 -4

No files matched your search

+7 -1
View File
@@ -94,7 +94,13 @@ namespace jet {
} else if(in.ifNextIgnoreCase("CONCAT")) {
} else if(in.ifNextIgnoreCase("INTEGER")) {
if(!in.ifNext("("))
throw coreutils::Exception("Expecting ( for INTEGER parameters.");
Operand parm1(in, tag);
if(in.ifNext(")")) {
string = parm1.string.asInteger();
} else
throw coreutils::Exception("Expecting ) at end of INTEGER expression.");
} else if(in.ifNextIgnoreCase("ROUND")) {
} else if(in.ifNextIgnoreCase("RANDOM")) {
+3 -3
View File
@@ -9,7 +9,7 @@ namespace jet {
if(keywordDefined("cgi") && (resolveKeyword("cgi") == "true")) {
global.cgi = true;
cookies = getenv("HTTP_COOKIE");
// cookies = getenv("HTTP_COOKIE");
if(keywordDefined("sessiondir")) {
global.session = true;
@@ -20,7 +20,7 @@ namespace jet {
// else
// generate new session id.
// create session cookie in response.
char hashit[64];
/* char hashit[64];
char hash[32];
sprintf(hashit, "JETSESSION%ld", time(0));
SHA1(hashit, strlen(hashit), hash);
@@ -32,7 +32,7 @@ namespace jet {
if(keywordDefined("sessiontimeout")) {
time_t timeout = time(0) + keywords["sessiontimeout"].asInteger();
}
*/
// also save last activity time in session file.
}
+2
View File
@@ -10,4 +10,6 @@ $[lefty]=01234
$[righty]=56789
<set name="trim" expr="trim(' this is a test ')" />
$[trim]=this is a test
<set name="integer" expr="integer(12430.54356546)" />
$[integer]=12430
</jet>