new(basic.gblib): Fix in SAVE xlsx version.

This commit is contained in:
Rodrigo Rodriguez 2023-11-27 13:24:15 -03:00
parent 8a61d1f0a1
commit 66ea211dd5

View file

@ -1063,13 +1063,6 @@ export class KeywordsExpressions {
}
];
keywords[i++] = [
/^\s*save\s*(\w+\$*)\s*as\s*(.*)/gim,
($0, $1, $2, $3) => {
return `await sys.saveFile({pid: pid, file: ${$2}, data: ${$1}})`;
}
];
keywords[i++] = [
/^\s*(save)(\s*)(.*\.xlsx)(.*)/gim,
($0, $1, $2, $3, $4) => {
@ -1080,6 +1073,13 @@ export class KeywordsExpressions {
}
];
keywords[i++] = [
/^\s*save\s*(\w+\$*)\s*as\s*(.*)/gim,
($0, $1, $2, $3) => {
return `await sys.saveFile({pid: pid, file: ${$2}, data: ${$1}})`;
}
];
keywords[i++] = [
/^\s*(save)(\s*)(.*)(.*)/gim,
($0, $1, $2, $3, $4) => {
@ -1087,6 +1087,17 @@ export class KeywordsExpressions {
$3 = $3.replace(/\"/g, '');
let fields = $3.split(',');
const table = fields[0].trim();
if (table.indexOf('.xlsx') !== -1)
{ // Same as SAVE above.
$3 = $3.replace(/\'/g, '');
$3 = $3.replace(/\"/g, '');
$4 = $4.substr(2);
return `await sys.save({pid: pid, file: "${$3}", args: [${$4}]})`;
}
fields.shift();
const fieldsAsText = fields.join(',');