of the following data types: More info on 4D data type can be found on the [ 4D Data Types] documentation page Variable Scope Local variables are prefixed with a $ like $myLocalVariable and only live for the duration of the method. Process variables have no prefix like myProcessVariable and live throughout the duration of the process. Inter-process (or Global) variables are prefixed with a <> like <>myGlobalVariable and live throughout the duration of the application. Comparison of looping For For(vCounter;1;100) // Do something End for While $i :=1 // Initialize the counter While($i<=100) // Loop 100 times // Do something $i :=$i +1 // Need to increment the counter End while Repeat $i :=1 // Initialize the counter Repeat // Do something $i :=$i +1 // Need to increment the counter Until($i=100) // Loop 100 times Nested Loops The following example goes through all the elements of a two-dimensional array: For($vlElem;1;Size of array(anArray)) // ... // Do something with the row // ... For($vlSubElem;1;Size of array(anArray{$vlElem})) // Do something with the element anArray{$vlElem}{$vlSubElem}:=... End for End for The following example builds an array of pointers to all the date fields present in the database: ARRAY POINTER($apDateFields;0) $vlElem:=0 For($vlTable;1;Get last table number) // loop over each table number with $vTable as the number If(Is table number valid($vlTable)) // check if table number $vTable is valid // only loop on the valid table For($vlField;1;Get last field number($vlTable)) // loop over each field number within current table // with $vlField as the current field number If(Is field number valid($vlTable;$vlField)) // check if field number is valid $vpField:=Field($vlTable;$vlField) // get pointer to field If(Type($vpField->)=Is date) // check if current field is a date // only performs these actions if field is a date $vlElem:=$vlElem+1 INSERT IN ARRAY($apDateFields;$vlElem) $apDateFields{$vlElem}:=$vpField End if End If End for End If End for References External links 4D Documentation (new & legacy) New 4D Forum (http://discuss.4d.com/) 4D Knowledge Base Proprietary database management systems Desktop database application development tools Procedural programming languages Cross-platform software Programming languages created in 1984 High-level programming languages Relational database management systems