Difference between revisions of "EXECJAVASCRIPT()"
From Lianjapedia
Barrymavin (Talk | contribs) (→See Also) |
Barrymavin (Talk | contribs) (→See Also) |
||
Line 6: | Line 6: | ||
==See Also== | ==See Also== | ||
− | [[COMPILE]], [[EXEC()]], [[EXECPHP()]], [[EXECPYTHON()]], [[EXECSCRIPT()]], [[JavaScript Server Pages]] | + | [[COMPILE]], [[EXEC()]], [[EXECPHP()]], [[EXECPYTHON()]], [[EXECSCRIPT()]], [[EXECJSSP()]], [[JavaScript Server Pages]] |
==Description== | ==Description== |
Latest revision as of 00:46, 19 April 2021
Contents
Purpose
Function to run multiple lines of JavaScript code
Syntax
EXECJAVASCRIPT(<expC>)
See Also
COMPILE, EXEC(), EXECPHP(), EXECPYTHON(), EXECSCRIPT(), EXECJSSP(), JavaScript Server Pages
Description
The EXECJAVASCRIPT() function runs multiple lines of JavaScript code. The lines of code are contained in <expC>, which can be a text constant, a filename, a character variable, or a character or memo field. The EXECJAVASCRIPT() function can handle blocks of code. Individual lines of code must be separated by a CHR(13) carriage return character. If a filename.js is specified it is loaded and executed.
Example
// Character field create table if not exists scripts (script char(200)) if not used("scripts") use scripts endif select scripts append blank replace script with 'for (var i=0; i<11; i++)' + CHR(13) + '{'; + CHR(13) + '// process commands;' + CHR(13) + '}' + CHR(13) execjavascript(script) // Text constant execjavascript('for (var i=0; i<11; i++)' + CHR(13) + '{'; + CHR(13) + '// process commands;' + CHR(13) + '}' + CHR(13)) // Memory variable m_script = 'for (var i=0; i<11; i++)' + CHR(13) + '{'; + CHR(13) + '// process commands;' + CHR(13) + '}' + CHR(13) execjavascript(m_script)