Recital 10 introduced the REQUIRE() and REQUIRE_ONCE() statement.
The REQUIRE() statement includes and executes the contents of the specified file at the current program execution level.
When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables, procedures, functions or classes declared in the included file will be available at the current program execution level.
The REQUIRE_ONCE() statement is identical to the REQUIRE() statement except that Recital will check to see if the file as already been included and if so ignore the command.
The full syntax is:
REQUIRE( expC )
REQUIRE_ONCE( expC )
e.g.
REQUIRE_ONCE( "myapp/myglobals.prg" )
|
|
Recital 10 introduced a FOREACH command, much like PHP and some other languages. This simply gives an easy way to iterate over arrays. foreach works on arrays and objects, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable. There are two syntaxes; the second is a minor but useful extension of the first:
FOREACH array_expression AS value
statements...
ENDFOR
FOREACH array_expression AS key => value
statements...
ENDFOR
The first form loops over the array given by array_expression. On each loop, the value of the current element is assigned to value and the internal array pointer is advanced by one (so on the next loop, you'll be looking at the next element).
The second form does the same thing, except that the current element's key will be assigned to the variable key on each loop. This form works only on associative arrays and objects.
|
|
Awk is an powerful text processing language that allows you to manipulate files containing columns of data and strings. Awk is extremely useful, both for general operation of Unix commands, and for data transformation.
Introduced in Recital 10 is the PIPETOSTR() function (as well as backticks `` inside strings) which can be used in conjunction with awk to transform recital data.
The following links provide good tutorials on awk:
|
|
All temporary files created by Recital are stored in the directory specified by the environment variable DB_TMPDIR. Some things that create temporary files are SQL SELECT commands and XML files used by the Replication Service.
In order to have these files stored in memory first create a temporary directory
Then mount the directory with the tmpfs command
mount -t tmpfs -o size=1g recitaltmpfs /usr/recital/tmp
Then change the DB_TMPDIR variable in the recital.conf to point to the newly created temporary directory.
|
|
In this article Barry Mavin, CEO and Chief Software Architect for Recital, details how to use the Recital Database Server with Visual FoxPro.
|
|
Read more...
|
|
|
|
|
|
|
Page 7 of 12 |