Difference between revisions of "EXECSCRIPT()"
From Recital Documentation Wiki
Helengeorge (Talk | contribs) (→Class) |
Yvonnemilne (Talk | contribs) (→Syntax) |
||
(2 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Function to run multiple lines of code | Function to run multiple lines of code | ||
Line 7: | Line 4: | ||
==Syntax== | ==Syntax== | ||
− | EXECSCRIPT(< | + | EXECSCRIPT(<expC>) |
− | + | ||
==See Also== | ==See Also== | ||
Line 42: | Line 38: | ||
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:SQL]] | [[Category:SQL]] |
Latest revision as of 16:57, 2 March 2012
Purpose
Function to run multiple lines of code
Syntax
EXECSCRIPT(<expC>)
See Also
Description
The EXECSCRIPT() function runs multiple lines of code. The lines of code are contained in <expC>, which can be a text constant, a character variable, or a character or memo field. The EXECSCRIPT() function, unlike EXEC() can handle blocks of code, such as FOR...NEXT or DO WHILE...ENDDO loops. Individual lines of code must be separated by a CHR(13) carriage return character.
The EXECSCRIPT() function returns a logical true (.T.) unless its contents specifically return false (.F.).
Example
// Character field set sql on set sql to VFP create table scripts (script char(200)) use scripts append blank replace script with "for i=1 to 10" + CHR(13) + "?i" + CHR(13) + "endfor" + CHR(13) execscript(script) // Text constant execscript("for i=1 to 10" + CHR(13) + "?i" + CHR(13) + "endfor" + CHR(13)) // Memory variable m_script = "do while .T." + CHR(13) + "inkey(0)" + CHR(13) + "if lastkey() = ctrl('G')" + CHR(13) ; + "exit" + CHR (13) + "endif" + CHR(13) + "enddo" execscript(m_script)
Products
Recital Server, Recital