Hello ,
Is there any documentation related to use JavaScript in a QAction , I know now we are using c# but there are some integrity mainly using JS ?
Thank you,
Hi Ahmed, all recent QActions in connectors/drivers are written in C#, which is why the documentation also mostly covers that specific section.
QActions do support JScript, which is different from JavaScript. It does however go back from the early days when QActions in connectors were just introduced. Initially, only JScript was supported back then, but the introduction of C# into QActions did surely make it less used. Nowadays, all QActions are written in C# code. As the C# also provides access to any other library, it provides much more possibilities.
Just for your reference, an example of JScript QAction below. This example walks through a memory table to calculate the used memory
// Calculate the used memory in percentage
var iUsedMem = 0;
var iFreeMem = 0;
var iIdRows = SLScript.RowCount(id:24);
for(i = 0; i < iIdRows ; i++)
{
var aRow = new VBArray(SLScript.Row(id:24,i));
var JSub = aRow.toArray();
iUsedMem += JSub[1];
iFreeMem += JSub[2];
}
id:12 = (iUsedMem / (iUsedMem + iFreeMem)) * 100;
Thanks a lot