Академический Документы
Профессиональный Документы
Культура Документы
Conversion of your 4D
databases to
4D v11 SQL
01/10/2007
Page 1/45
Conversion of your 4D databases to 4D v11 SQL
01/10/2007
Page 2/45
Conversion of your 4D databases to 4D v11 SQL
01/10/2007
Page 3/45
Conversion of your 4D databases to 4D v11 SQL
01/10/2007
Page 4/45
Conversion of your 4D databases to 4D v11 SQL
Certified version: Windows Server 2003 R2, Windows XP SP2, Windows VISTA
It is nevertheless recommended to use 4D Tools beforehand in the original version in order to check the data
and structure. Take this opportunity to regenerate the forms with the “Regenerate all the database forms”
option if you have not already done so. This option is only available in 4D version 2004:
The 4D menu bar will then appear. You can open a database using the Open tool:
01/10/2007
Page 5/45
Conversion of your 4D databases to 4D v11 SQL
And choose the .4DB file to be converted. The conversion wizard then appears.
Conversion wizard
A conversion wizard is provided. It makes a copy of the original database (structure, data, log file and blank
log file) in a folder named "Replaced files (Conversion)".
The different steps of the conversion are recorded in a file named "DataConversion_Log.log" that is placed
next to the converted structure file.
01/10/2007
Page 6/45
Conversion of your 4D databases to 4D v11 SQL
Segment Information:
Data segments no longer exist in 4D v11 SQL. During conversion, all the segments are grouped together.
The conversion cannot be completed if a segment is missing.
01/10/2007
Page 7/45
Conversion of your 4D databases to 4D v11 SQL
Disk Information:
Option:
This is where you can choose to not execute the code when opening the database:
This option is important because it provides a way of not passing by the “On Startup" database method when
the converted database is launched for the first time.
If any problems occur, error messages will indicate the procedure to follow as, for example, in the following
screenshots that concern an error due to a data file that is not found:
01/10/2007
Page 8/45
Conversion of your 4D databases to 4D v11 SQL
Note:
The interpreted mode in 4D v11 SQL is less tolerant than that of 4D version 2004.
After conversion to 4D version v11 SQL, 4D databases contain several additional files:
Note:
Databases created in 4D v11 SQL are automatically placed in the .4dbase folder.
Under Mac OS, databases are shown directly as a package.
New folders:
Several operations can create folders named Replaced files: these folders contain a copy of the original
data files before conversion, or before compacting, or before repair.
01/10/2007
Page 9/45
Conversion of your 4D databases to 4D v11 SQL
The Maintenance and Security Center now replaces 4D Tools. You must launch 4D Developer in order to
access it:
Here you can repair and compact both the structure and the records. The following is an example of a log file
generated when you click on Open log file:
01/10/2007
Page 10/45
Conversion of your 4D databases to 4D v11 SQL
No longer used:
User Mode
The Design and User Mode have been merged to give access to both the design environment and the
records:
It is now forbidden (and impossible) to call system or 4D application resources regardless of whether it is via
commands or using the syntax <:15000,5>.
In 4D v11 SQL the Open resource file command always returns 0 because the resources are always
opened by 4D.
A substitution mechanism has been implemented in order to limit the impact of this modification on the
functioning of databases that make use of these resources.
In order to maintain compatibility, the former mechanisms will continue to work with just a few adaptations:
• When present, resource files are still supported by 4D and the principle of the string of resource files
(successive opening of several resource files) remains valid. This string includes the .rsr and .4dr files
and the custom files opened using 4D commands. But it is no longer possible to access 4D resources.
This practice, which was already not recommended previously, is now strictly forbidden.
• To limit the impact of this modification on existing databases, a substitution system has been
implemented, based on the externalization of the resources that are most frequently used.
01/10/2007
Page 11/45
Conversion of your 4D databases to 4D v11 SQL
Substitution system:
• Put all the necessary files into a folder named “Resources” that you will need to create next to the
structure.
However, it is strongly recommended to change converted databases and remove any calls to 4D internal
resources that they may contain.
Note:
Databases created in 4D v11 SQL no longer have .RSR and .4DR files.
To recover your resources, a “4DPop Migration” component will be available for download free of charge. It
will allow you to recover:
Subtables
It is no longer possible to create subtables in 4D version v11 SQL.
During the conversion of a database to v11, the first level subtables are transformed into standard tables
with a special relation. Warning, any subsequent levels will simply be truncated.
01/10/2007
Page 12/45
Conversion of your 4D databases to 4D v11 SQL
Becomes:
The subtable becomes a Many table and the original table becomes the One table.
The name of the newly-created table will be: ParentTableName_SubTableName and will be truncated to 31
characters!
The order of tables in v11 is no longer the same as in version 2004; subtables are added to existing tables.
• If you convert a database with more than one level of subtables, the higher-level subtables will not be
recovered and all the subtables other than those of the first level will simply be truncated.
In this case, error 1012 appears in the ‘DataConversion_Log.log’ as well as in the error result window
displayed at the end of conversion.
• As long as you do not remove the special relation created during conversion, the commands on the
subrecords will continue to work. However, the removal of this special relation is irreversible: you must
redraw a standard relation and you will have to replace the “subrecord” commands with commands on
tables.
You will need to plan on rewriting your code if you use table numbers or if you remove the relation.
Also be aware that the behavior of certain commands has changed: DUPLICATE RECORD no longer
duplicates subrecords, SEND RECORD no longer sends subtables and RECEIVE RECORD no longer
receives them.
On the other hand, from now on the Field and Field name commands return the number and name of the
subfield when the pointer is unpointed (and no longer those of the main table).
Former components
The component architecture has undergone in-depth modification. A component now consists of a regular
structure file, compiled or not, in the form of a package (.4dbase folder). You simply need to put it into the
“Components” folder next to the structure.
It is no longer possible to use tables in a 4D v11 SQL component (a database created in 4D v11 SQL does
not contain an initial Table 1 and you can now use project forms that are not related to a table).
If a former version component is installed in your database, a warning message will inform you that
conversion is not possible:
01/10/2007
Page 13/45
Conversion of your 4D databases to 4D v11 SQL
Former version components must be uninstalled from the original version with 4D Insider before conversion.
Note:
In a 4D v11 SQL component, tables and fields, table forms and their associated form methods as well as
user forms, database methods and triggers cannot be used.
Components are now 4D databases: .4db, .4dc or .4dbase. For professional applications, the .4dbase is
recommended. You can get it using the Build application dialog box:
Data segments
The size of the data file is virtually unlimited (except for limits imposed by the system). It is no longer
possible to create and use several data segments. Previous segments are grouped during conversion.
Check that you have a sufficient amount of space on your disk to do this.
If a segment is missing, the conversion wizard will ask you to locate it manually. If it cannot be found, the
conversion cannot be completed.
01/10/2007
Page 14/45
Conversion of your 4D databases to 4D v11 SQL
4D 2003/2004 Macros
4D v11 SQL loads the macros of a new “Macros v2” folder (in the active 4D folder, next to the structure, or in
the “Component” folder for the macros of a component).
Macros used with versions 2003 and 2004 of 4D are not compatible with 4D v11. The v11 macros must be
entirely in conformity with XML standards. Therefore the following mentions:
must be present.
No longer compatible:
// for comments
----- dashes
< or > which must be encoded: < and >
The <macros> tag is mandatory.
….
An automatic conversion mechanism has been implemented. 4D v11 SQL automatically copies the 4D
2003 or 4D 2004 macros into the “Macros v2” folder. The declaration statements are added to the document.
However, occasional adjustments may be needed in order to comply entirely with the XML standard.
New commands:
01/10/2007
Page 15/45
Conversion of your 4D databases to 4D v11 SQL
databases. From now on, controls are carried out at different levels (forms, menus, method, etc.) or via
specific options, for example, concerning the SQL server (in the Preferences).
Note:
Watch out for security holes caused by 4D Open.
No longer supported:
• Passing a 2D array element to a command requesting a variable: now returns an error: e.g.
Type(My2DArray{1}{1}).
• Fake arrays in the Mac OS 7 pop-up menus: if the pop-up variable was a real and was named, for
example, “pop”, the contents of the variable were indicated as “pop”+string(pop).
• The paragraph operator § which was used to address a variable by its name (a sort of pointer)
for example: a:= § (“vtoto”).
This former operator was already rejected by the compiler.
Example:
ValueOfA :=§("A")
• CLEAR VARIABLE no longer accepts the syntax allowing a variable name to be given between quotation
marks. It now operates the same way in both interpreted and compiled.
• The fake arrays for which arr{“42”} or arr{42} were equivalent to arr42.
• Tab associated with an array “toto” and a Boolean array “toto” in order to activate/deactivate each item of
the tab.
01/10/2007
Page 16/45
Conversion of your 4D databases to 4D v11 SQL
The solution is to use a bigger picture (128 x 128 min) which will use a little more memory but will save CPU
time.
The numbers of deleted tables and fields can only be re-assigned on creation of new ones.
Commands added:
Is table number valid
Is field number valid
Transactions
VALIDATE TRANSACTION and CANCEL TRANSACTION no longer affect the current selection.
Previous versions reduced the selection to zero if at least one record was created during the transaction.
From now on, records created during a transation no longer receive a temporary number (beginning at
18,000,000) but instead receive a standard number, corresponding to the numbering underway in the table.
This number becomes permanent when the transaction is validated and is released if the transaction is
cancelled (the records created are then deleted).
Commands working with record numbers like SCAN INDEX, RELATE ONE SELECTION, etc, can now be
used in transactions.
Nested transactions
A preference can be used to activate nested transactions in 4D.
With 4D 2004, you could not nest transactions. If you began one transaction within another, 4D ignored the
second one.
This option only appears for converted databases. By default, it is not checked.
This option has no effect on any transactions in the SQL engine of 4D v11 SQL, which is always multi-
transactional.
01/10/2007
Page 17/45
Conversion of your 4D databases to 4D v11 SQL
Indexes
It is no longer mandatory to index fields used by a relation.
Fields added to a former subtable which has been transformed into a table are in Cluster B-Tree.
Here is an example of index verification using the Maintenance and Security Center:
• Keywords Index:
This new type of index is available for Alpha and Text fields. It can be combined with a standard index. 4D
will use the one most suitable depending on the context.
01/10/2007
Page 18/45
Conversion of your 4D databases to 4D v11 SQL
QUERY([Products];[Products]Description%"easy")
• Composite Indexes:
Composite indexes are indexes made up of several fields (two or more). They can only be created from the
Index list dialog box (called from tool bar of Structure editor):
Sets
When a set is no longer up to date because it contains a reference to a record that has been deleted and we
use the USE SET command, 4D v11 SQL returns the following error: -10503: "Record number not valid."
With 4D 2004, this was not the case: no error number was returned.
Is in set: took the selection pointer (sometimes pointing to another record with PUSH RECORD for example)
but not the current record if it was loaded, unlike ADD TO SET – from now on its behavior is identical.
For information, CREATE SET always keeps the selection pointer without dealing with the loaded record.
The pasteboard for drag and drop data can only be accessed in the context of the On Begin Drag Over, On
Drag Over or On Drop form events, or in the On Drop database method.
The No such data in clipboard constant has been renamed No such data in pasteboard.
Menus
From now on in 4D v11 SQL, menus are hierarchical. You can create menus and menu bars on the fly
without them actually existing in Design mode. The menus and menu bars are processed in the same way.
The maximum number of characters changes from 31 to 150.
The menuItem=-1 parameter can be used to indicate the last item added.
01/10/2007
Page 19/45
Conversion of your 4D databases to 4D v11 SQL
No change:
Menu selected
Count menus
Count menu items
DISABLE MENU ITEM
ENABLE MENU ITEM
APPEND MENU ITEM
INSERT MENU ITEM
DELETE MENU ITEM
The v 6.8 option is no longer available for menus in 4D v11 SQL. This option was used, in converted
databases, to maintain a previous functioning based on the automatic addition of an Edit menu managed by
the system.
When a database where the v 6.8 option was checked is converted, the Edit menu is automatically added
and a warning dialog box will notify you of this:
Warning: it will then be necessary to modify the value of the menu parameter in the statements for managing
and executing menus. In fact, with the previous functioning, the Edit menu was not counted; however, in 4D
v11 SQL, it is counted.
Hierarchical lists
Structural modification. Greater flexibility.
Triggers
Minor change in the operation of the On saving new record trigger: in 4D 2004, when the Record number
command was called in this trigger, it returned -3. In 4D v11 SQL, the command returns the record number
that will be assigned to the newly-created record.
Plug-ins
Plug-ins of version 2004 (4D or third party) are compatible with 4D v11 SQL.
MacIntel: All the 4D v11 SQL plug-ins are MacIntel native, except for 4D Draw and 4D for OCI that must
be used under Rosetta. To do so, choose Get Info on the 4D Developer.app application and check “Open
using Rosetta”.
01/10/2007
Page 20/45
Conversion of your 4D databases to 4D v11 SQL
Plugin SDK
EX_FIND_PROCID and EX_CALL_BY_PROCID worked with indexes in the methods array. These entry
points now work with internal Ids, both positive and/or negative, but not null values.
Virtual structure
A virtual structure uses the names of tables and fields set with SET TABLE TITLES and SET FIELD
TITLES. These names are used by the standard 4D dialog boxes (query, order by, quick report, etc.). This
has been modified in 4D v11 SQL: from now on, the virtual structure is only used when these dialog boxes
are called with language commands. Plug-ins, too, always access the virtual structure:
Pictures
Pictures are now stored in native format.
The former PICTURE TYPE LIST command is kept for reasons of compatibility. However, it requires the
presence of QuickTime and does not allow access to formats that are managed natively by 4D.
It is of limited interest and can be favorably replaced by PICTURE CODEC LIST.
In the interpreted mode of 4D v11 SQL, if you notice that your picture variables are not displayed correctly,
make sure that they are typed correctly:
• You can type them at the form level via the pop-up menu of the Property list:
01/10/2007
Page 21/45
Conversion of your 4D databases to 4D v11 SQL
• Or using a compiler directive: C_PICTURE(vPict) that must be executed before the form is loaded, in
other words, even before the On Load form event.
Previous versions of 4D were more tolerant regarding the initialization of variables in general, and picture
variables in particular whose display in forms is governed by new native mechanisms.
At the end of a picture, 4D added the X/Y info and the display mode, which are no longer necessary. These
6 bytes are removing during conversion. If for legitimate reasons you have stored Blobs in Picture fields, be
aware that they will lose part of their information during conversion.
Compatibility Preferences:
Design compatibility:
Compatibility options already present in 4D 2004:
01/10/2007
Page 22/45
Conversion of your 4D databases to 4D v11 SQL
them. You can now simply group them. This option only exists in converted databases. It is
checked by default. Databases created in version 2004 use the new functioning.
• Automatic Transactions during Data Entry: This option only appears for former databases
converted to version 2004. It is unchecked by default. It was used to automatically start a
transaction when an input form was opened and had an included form. This option was designed for
4D First users that switched to 4D. This option was already not recommended in version 2003.
• Always allow all commands and project methods in the Formula editor:
In the Formula editor, now only a few 4D command themes are displayed and no project methods;
except when you use the SET ALLOWED METHODS command (see documentation) or when you
check this option.
Web compatibility:
• Use 4DVAR Comments instead of Brackets:
In previous versions of the Web server, the following syntax was used: [MyVar], proprietary solution
to be replaced by <!--4DVAR MaVar-->.
• Use new context referencing mode:
Keeps the 4D Web server from sending the context number to the browser for each element on a
page.
• Remove "/" on unknown URLs: e.g. http://127.0.0.1/Contacts/Add in previous versions returned in
$1: “Contacts/Add.” In 4D 2004, all URLs begin with "/" (except when this option is checked).
• Keep-Alive Connections: If an HTML page included 10 pictures, this formerly lead to 10+ 1
connections in http 1.0. This option allows a single connection to be maintained.
Platform
In this Preference dialog box, this area only appears converted databases. In previous versions of 4D, it
was possible to “force” the appearance, at the database level, of forms and/or objects — with each level by
default inherited from the previous one. This mechanism is kept for compatibility reasons.
In databases created with 4D version 2004 and higher, the interface is automatically chosen by 4D according
to the current platform. The forms and objects used are drawn in a native manner. The interface can be
configured only at the form or object level and the only options available are: System and Printing for forms,
Inherited from form for objects.
In databases converted from previous versions of 4D, additional options are available (Automatic, Mac OS 7,
Windows 3.11, NT 3.51, Windows 95/98/2000, NT 4, Mac OS 9 and Mac Theme). These options correspond
to the former platform interface support mode in 4D and it is no longer recommended to use them. The same
goes for the Get platform interface and SET PLATFORM INTERFACE commands, both kept for
compatibility reasons and which only work in converted databases. These commands are ignored in
databases created with 4D 2004 since the platform interface is managed automatically.
In the Preferences of converted databases, it is strongly recommended to select the System option in order
to implement this functioning. The two other pop-up menus are then disabled and the new mechanism is
activated. Note that it may be necessary to modify the “Platform” property of your forms in order to take
advantage of this mechanism, for example by choosing the Inherited from Database option.
01/10/2007
Page 23/45
Conversion of your 4D databases to 4D v11 SQL
4D v11 SQL allows dragging and dropping of selections, objects and/or files external to 4D, such as picture
files for example. This possibility must be supported by the database code.
In databases converted from a previous version of 4D, this possibility may lead to malfunctioning if the
existing code is not adapted.
For this reason, a new option in the Preferences can be used to prevent the dropping of external objects into
the database: Prevent drop of data not coming from 4D.
Checked by default in converted databases.
Nested Transactions
4D v11 SQL now accepts an unlimited level of nested transactions. This new functioning is disabled by
default in converted databases (transactions remain limited to a single level).
If you want to be able to use transactions on more than one level in a converted database, you need to
explicitly indicate it by checking this option.
Unicode mode
This option is checked by default in a new 4D v11 SQL database and not checked in converted databases.
Preferences:
Support for Unicode characters has been extended 4D v11. Many commands have been rewritten.
From now on, the database engine, language and many interface elements (menus, lists, form objects, etc.)
can store and work with Unicode characters.
When the Unicode mode is enabled, the “Keyboard Layout” property of form objects is ignored.
For compatibility reasons, 4D v11 SQL can still operate with the former mode, based on Mac ASCII
characters, via a new option in the Preferences:
4D v11 SQL now uses UTF-16 (and thus conforms with Windows and Mac OS) and sometimes UTF-8, more
particularly for the Web and for imports/exports, which can offer certain advantages (better readability for
common characters - a-Z, 0-9 – and more compact). In Unicode, the values 1 to 127 correspond exactly to
the ASCII characters.
01/10/2007
Page 24/45
Conversion of your 4D databases to 4D v11 SQL
This support of Unicode leads to different modifications: change of parameters or new parameters for certain
commands and even new commands:
Syntax [[1]]
Returns the Xth UTF-16 character and no
longer the Xth byte
Mac to Win, Win to Mac, No longer work
Mac to ISO, ISO to Mac
These new mechanisms do not lead to any particular modifications for languages whose characters are
coded on a single byte (Western languages), but will simplify processing in languages coded on two-bytes
(such as Japanese).
During the 4D 2004 -> 4D v11 SQL conversion, 4D converts the data to Unicode. In order to not lose any
information, it is important to know the original character set. This cannot be done in a completely automatic
manner. The developer must specify the character set. This information is given via a text file placed next to
the data file to be converted and named “multilang.txt.” The encoding must be ANSI or Mac Roman (not
UTF8 or Unicode).
Each line must end with a carriage return (CR or CRLF). Empty lines and spaces are allowed.
This file must be located next to the data file AT THE TIME OF CONVERSION.
01/10/2007
Page 25/45
Conversion of your 4D databases to 4D v11 SQL
Example:
4;7;1;1049
4;7;2;1032
The language codes are provided in the “keyboardmapping.xml” file (see appendix 1 of the present
document).
The same database converted to v11 with the “Multilang.txt” file next to the data file during the
conversion:
With this solution, the conversion will work for all the languages present.
This option is checked by default for new databases created with 4D v11 SQL. In this case, 4D automatically
replaces the “.” and “,” characters in numeric display formats by, respectively, the thousands separator and
the decimal separator defined in the operating system.
In previous versions of 4D, the “###,##0.00” format was a valid format for an American system, but when it
was applied to a numeric value displayed on a French or Swiss system, the result was incorrect.
From now on, by checking this new option in the Preferences and by systematically using the period and
comma as separators in numeric formats, 4D will replace these characters by their equivalents as defined in
the system.
01/10/2007
Page 26/45
Conversion of your 4D databases to 4D v11 SQL
The Num command now accepts a new parameter that can be used to set a specific decimal separator. In
addition, the new GET SYSTEM FORMAT command can be used to find out the current value of the
regional system parameters.
Warning:
In databases newly created in 4D v11 SQL, with the option checked, in order for your database to be multi-
OS, the thousands separator to be used is the “,” and the decimal separator to be used in the formats is “.”,
thus for example “###,##0.00 €.” You will then have a format that is operational under any OS.
If you want to continue to work with conventional formats like “### ##0,00 €,” uncheck this option in the
Preference; otherwise, modify your formats to “###,##0.00 €.”
Commands
New commands
Many new commands have been added in order to manage the new functionalities:
01/10/2007
Page 27/45
Conversion of your 4D databases to 4D v11 SQL
Com.4d.text.native
Com.4d.text.utf16
Com.4d.text.rtf
Com.4d.picture.pict
Com.4d.picture.png
Com.4d.file.url
Etc.
4-character types (TEXT, PICT, etc. are kept for compatibility).
Concerning menus:
Create menu
RELEASE MENU
GET MENU ITEMS
Get menu bar reference
GET MENU ITEM ICON
SET MENU ITEM ICON
Get menu item method
SET MENU ITEM METHOD
GET MENU ITEM PROPERTY
SET MENU ITEM PROPERTY
Get menu item modifiers
Dynamic pop up menu
SET MENU ITEM REFERENCE
Get menu item reference
Get selected menu item reference
01/10/2007
Page 28/45
Conversion of your 4D databases to 4D v11 SQL
Concerning listboxes:
INSERT LISTBOX COLUMN FORMULA
SET LISTBOX TABLE SOURCE
GET LISTBOX TABLE SOURCE
Concerning printing:
OPEN PRINTING JOB
CLOSE PRINTING JOB
Concerning methods:
EXECUTE METHOD with parameters
01/10/2007
Page 29/45
Conversion of your 4D databases to 4D v11 SQL
Concerning XML:
DOM Find XML element by ID
DOM EXPORT TO PICTURE
Concerning pictures:
PICTURE CODEC LIST
TRANSFORM PICTURE (continues and improves the functionalities of picture operators)
COMBINE PICTURES (idem)
CONVERT PICTURE
Concerning tools:
Choose (criterion; value1{ ;value N}) Boolean or number
Example:
VTitle:= Choose ([Contact]Masculine “Mr”;“Mrs”)
Concerning listboxes:
INSERT LISTBOX COLUMN
INSERT LISTBOX ROW
DELETE LISTBOX ROW
GET LISTBOX ARRAYS
Focus object in the context of a listbox:
Column associated with a field: points to the field
Column associated with a variable: points to the variable
Column associated with an expression: points to the variable of the listbox
Concerning printing:
PRINT SETTINGS(dialType)
dialType: 0 all, 1: print format, 2: printing
Concerning components:
Structure file (*): returns the structure file of the host database (for a component).
01/10/2007
Page 30/45
Conversion of your 4D databases to 4D v11 SQL
OPEN 4D PREFERENCES
01/10/2007
Page 31/45
Conversion of your 4D databases to 4D v11 SQL
INTEL 486
Macintosh 68K
PowerPC 601
PowerPC 603
PowerPC 604
PowerPC G3
Concerning methods:
Current method name for an object method returning a name such as “[Table1].Form.var,” that
becomes “[Table1]Form.var” (the “.” has been removed).
Num now accepts a new parameter that can be used to specify a decimal separator.
By default, the command uses the decimal separator defined by the operating system. When this
parameter is passed, the command does not take the system decimal separator into account. You can
pass one or more characters.
• Lowercase, Uppercase
New * parameter to specify that accents are kept
Lowercase (string{ ;*})
Uppercase (string{ ;*})
In version 2004.x
Uppercase ("è") -> E : accent lost
Lowercase ("È") -> è : accent kept
In 4D v11
Uppercase ("é") -> E : accent lost (idem version 2004)
Lowercase ("È") -> e : accent lost
Uppercase ("é";*) -> È : accent kept
Lowercase ("È";*) -> è : accent kept (idem version 2004)
Example:
Lowercase (“ÉÚÂÆ éABC”) -> euaæ eabc the accents have disappeared and everything is
changed to lower case
Lowercase (“ÉÚÂÆ éABC”; *) -> éúâæ éabc the accents have been kept and everything is
changed to lower case
Uppercase (“éà”) -> EA : the accents have disappeared
Uppercase (“éà”; *) -> ÉÀ : the accents have been kept
01/10/2007
Page 32/45
Conversion of your 4D databases to 4D v11 SQL
• Position
New parameters such as start and * have been added. The * parameter can be used to specify that a
search is diacritic-sensitive.
Position has been rewritten and uses the ICU (International Components for Unicode) library which
can lead to an incompatibility since Position now ignores all characters ignored by Unicode like ASCII
NULL or Char(1).
Warning: remember to use the new * parameter to keep the same functioning as in 4D 2004:
$p:=Position(Char(0);vText) $p -> 1
To get 0, you must use the * character
$p:=Position(Char(0);vText;*) $p -> 0
Note: in Unicode, the following character codes are reserved and must never be included in a text:
0
65534 (FFFE)
65535 (FFFF)
Concerning XML:
DOM Find XML element
DOM Parse XML source
DOM Parse XML variable
SAX ADD XML ELEMENT VALUE
APPLY XSLT TRANSFORMATION
Concerning BLOBs:
TEXT TO BLOB
BLOB to text
Concerning resources:
Get indexed string
STRING LIST TO ARRAY
Support of XLIFF
01/10/2007
Page 33/45
Conversion of your 4D databases to 4D v11 SQL
Concerning communications:
SEND PACKET (allows BLOBs)
RECEIVE PACKET (allows BLOBs)
USE CHARACTER SET (in Unicode, IANA name of character set)
Concerning processes:
New constants:
Miscellaneous themes:
EXECUTE becomes EXECUTE FORMULA
Find index key Find in field
works on non-indexed field and @ can be used in
the string (forced sequential mode in this case).
Ascii Character code
GET PLUGIN LIST PLUGIN LIST
USE ASCII MAP USE CHARACTER SET
Concerning menus:
MENU BAR becomes SET MENU BAR
SET MENU ITEM KEY SET MENU ITEM SHORTCUT
01/10/2007
Page 34/45
Conversion of your 4D databases to 4D v11 SQL
Concerning arrays:
DELETE ELEMENT becomes DELETE FROM ARRAY
INSERT ELEMENT INSERT IN ARRAY
• GET WEB FORM VARIABLES now requires the declaration of arrays used.
• Create document
In 4D v11SQL, the Document variable returns the complete pathname, whereas in 4D 2004 it
returned the name indicated during Create document.
Example:
• CLEAR VARIABLE: This command now works the same way in both interpreted and compiled
mode. It reinitializes variables to their default value in both modes.
In 4D 2004: in interpreted, it removed the variables from memory and in compiled mode it
reinitialized them.
No longer accepts the CLEAR VARIABLE(“toto”) syntax.
• Field and Field name: If you pass a pointer to a field, these functions return the number and name
of the field of the subtable instead of the source field (this was already the case in 4D 2004, but it
was not documented).
01/10/2007
Page 35/45
Conversion of your 4D databases to 4D v11 SQL
• Selected record number: in the framework of PRINT RECORD, returned 0. In 4D v11, it returns the
real position.
• SAVE SET: uses a new format: sets stored in 4D v11 cannot be read by previous versions, but
LOAD SET can read the previous format.
• SEND RECORD: uses a new format. Records sent with 4D v11 cannot be used by previous
versions, but RECEIVE RECORD can read the previous format so long as it does not contain
subtables (reminder: subtables are no longer supported).
• SELECTION TO ARRAY no longer changes the current records, the selections of the main table
and of related tables. Automatic relations are activated. The current records of related tables are no
longer unloaded.
• ARRAY TO SELECTION ignores fields that do not belong to the first table. Returns an error if the
arrays are not the same size.
• Self: the Self pointer in an object method calling a project method: in version 2004 in compiled
mode, it returned the pointer to the object but in interpreted it returned Nil. In 4D v11, does not return
null value in interpreted or compiled.
• RELATE ONE SELECTION: in version 2004, took the first path possible. In 4D v11, takes the most
optimized path: this can lead to incompatibilities: resolve them by specifying the list of fields by which
to pass in the RELATE ONE SELECTION command (new feature in v11).
• QUERY
[Table1] [Table2] [Table3]
Field1-> Field 1
Field2 -> Field 1
QUERY ([Table3];[Table1] Field 1=1) `regardless of field type
In 4D v2004 -> No records found in [Table3]
In 4D v11 SQL -> Records are found in [Table3]
RELATE ONE SELECTION: 4D 2004 unloaded the current record. 4D v11 SQL no longer does this.
• Drop position: now works for variables, text fields and combo boxes.
- When the Type function is applied to the “row” of a 2D array, it now returns the actual type of the
2D array and no longer the “Array 2D” type.
- 2D string arrays: it is no longer possible to change the length of a string in interpreted mode.
01/10/2007
Page 36/45
Conversion of your 4D databases to 4D v11 SQL
Commands for which the first parameter, the table, is now mandatory:
APPLY TO SELECTION
QUERY BY FORMULA
QUERY SELECTION BY FORMULA
EDIT FORMULA
“Tools” Theme
LAUNCH EXTERNAL PROCESS
SET ENVIRONMENT VARIABLE
“Formulas” Theme
EXECUTE FORMULA
Optimized commands:
Many commands have been optimized in 4D v11 SQL. More particularly:
QUERY BY FORMULA
QUERY SELECTION BY FORMULA
QUERY WITH ARRAY
Obsolete commands:
To be replaced by:
01/10/2007
Page 37/45
Conversion of your 4D databases to 4D v11 SQL
Obsolete syntaxes:
• If (Record number([Table])=-3)
This syntax is not recommended since 4D v 6.5. In the On saving new record trigger, this function no
longer returns -3, but rather the record number.
To be replaced by:
• The syntaxes If(Before)… (During)… (After) in form methods must be replaced by a test on the form
event: If(Form event= On Load) etc.
• CLEAR LIST (list{ ;*}) used to delete sublists should be replaced by the DELETE FROM LIST command
(which is the new name of the former DELETE LIST ITEM command).
• $Structure :=Structure file
$Resources :=Open resource file ($Structure)
If you remove this relation, you will need to use the commands concerning tables.
Warning: Commands like DUPLICATE RECORD and SEND RECORD no longer take subtables into
account.
Integrations (partial)
• Choice lists
• Style sheets
• Formats and filters
• Pictures from picture library
• Menus and menu bars
• Help tips
• Project forms with form methods
• Table form with form methods
• Project methods
• Folders/subfolders
• Tables with fields and triggers
• All form objects (with object method – 4D 2004)
01/10/2007
Page 38/45
Conversion of your 4D databases to 4D v11 SQL
In a menu, the project method reference is kept. The form inheritance is also kept.
Access rights are not kept.
ALT CLICK (Win) OPTION CLICK (Mac) to select and deselect all.
Use another object: only exists for dependent objects.
01/10/2007
Page 39/45
Conversion of your 4D databases to 4D v11 SQL
4D Pack
With V11, and due to migration problems related to the elimination of certain 4D Pack commands, the
loading of 4D Pack 2004 is allowed in order to make the migration easier. We nevertheless do not accept
any responsibility concerning the functioning of 4D Pack 2004 in v11.
AP Read Picture BLOB, Serves no purpose since pictures are stored in native format
Or use: BLOB TO PICTURE
01/10/2007
Page 40/45
Conversion of your 4D databases to 4D v11 SQL
AP Add table and fields Use new SQL capacities of 4D v11 SQL
example:
CREATE TABLE Client
(Last name char(50),
First name char(50),
Address char(50),
City char(50),
Country char(25),
Birthdate date)
AP CLOSE HELP No longer work under Windows XP, not VISTA compatible
AP HELP INDEX
AP HELP ON HELP
AP HELP ON KEY
Improved command:
AP Create method
01/10/2007
Page 41/45
Conversion of your 4D databases to 4D v11 SQL
Identical commands:
AP Get templates
AP Rect dragger
AP SET CLOCK
AP Timestamp to GMT
AP FULL SCREEN
AP NORMAL SCREEN
AP BLOB to print settings
AP Print settings to BLOB
AP Get tips state
AP SET TIPS STATE
AP Get field infos
AP Get table info
New commands
Description
The AP Get File MD5 Digest command returns the MD5 key of a document.
C_TEXT($document)
C_LONGING(<>digest;$fork)
$fork:=0
$document:=Select document("" ; "" ; "" ;0)
$error:= AP Get File MD5 Digest ($document;<>digest;$fork)
Shortcuts
ALT on opening a database in order to create a choose a data file.
Design Mode
Print: CTRL/CMD P
Page Setup: CTRL/CMD SHIFT P
Open Form: CTRL/CMD L
Open Explorer: CTRL/CMD SHIFT E
Open Tool Box: CTRL/CMD SHIFT T
Compiler: CTRL/CMD *
Find in Design: CTRL/CMD SHIFT F
Preferences: CTRL/CMD /
01/10/2007
Page 42/45
Conversion of your 4D databases to 4D v11 SQL
Structure:
Select All (table or field): CTRL/CMD A
Continuous or discontinuous selection (table or field): CLICK SHIFT CLICK or CLICK CTRL/CMD CLICK
Tab and Shift Tab to select Next table and Previous table
Carriage return to create a field
Method:
Run Method: CTRL/CMD K
In the Method editor, to open a method: ALT DOUBLE CLICK
Show/Hide Line Numbers: CTRL/CMD ALT SHIFT N
Next Error: CTRL/CMD =
Previous Error: CTRL/CMD ALT =
Select Enclosing Block: CTRL/CMD B
Comment/Uncomment: CTRL/CMD /
Swap Expression: CTRL/CMD ALT T
Form:
Move to Front: CTRL/CMD F
Move to Back: CTRL/CMD SHIFT B
Group: CTRL/CMD G
Ungroup: CTRL/CMD SHIFT G
Help tip on object: CTRL/CMD SHIFT on object
Records
List of Tables: CTRL/CMD SHIFT U
Show Current Table: CTRL/CMD U
New Record in List: CTRL/CMD SHIFT N
New Record: CTRL/CMD ALT N
Show All: CTRL/CMD +
Show Subset: CTRL/CMD –
Order By: CTRL/CMD SHIFT Y
Apply Formula: CTRL/CMD SHIFT R
Find: CTRL/CMD Y
Flush Data Buffers: CTRL/CMD ALT SHIFT S
01/10/2007
Page 43/45
Conversion of your 4D databases to 4D v11 SQL
DC_AFRIKAANS = 1078
DC_ALBANIAN = 1052
DC_ARABIC_SAUDI_ARABIA = 1025
DC_ARABIC_IRAQ = 2049
DC_ARABIC_EGYPT = 3073
DC_ARABIC_LIBYA = 4097
DC_ARABIC_ALGERIA = 5121
DC_ARABIC_MOROCCO = 6145
DC_ARABIC_TUNISIA = 7169
DC_ARABIC_OMAN = 8193
DC_ARABIC_YEMEN = 9217
DC_ARABIC_SYRIA = 10241
DC_ARABIC_JORDAN = 11265
DC_ARABIC_LEBANON = 12289
DC_ARABIC_KUWAIT = 13313
DC_ARABIC_UAE = 14337
DC_ARABIC_BAHRAIN = 15361
DC_ARABIC_QATAR = 16385
DC_BASQUE = 1069
DC_BELARUSIAN = 1059
DC_BULGARIAN = 1026
DC_CATALAN = 1027
DC_CHINESE_TRADITIONAL = 1028
DC_CHINESE_SIMPLIFIED = 2052
DC_CHINESE_HONGKONG = 3076
DC_CHINESE_SINGAPORE = 4100
DC_CROATIAN = 1050
DC_CZECH = 1029
DC_DANISH = 1030
DC_DUTCH = 1043
DC_DUTCH_BELGIAN = 2067
DC_ENGLISH_US = 1033
DC_ENGLISH_UK = 2057
DC_ENGLISH_AUSTRALIA = 3081
DC_ENGLISH_CANADA = 4105
DC_ENGLISH_NEWZEALAND = 5129
DC_ENGLISH_EIRE = 6153
DC_ENGLISH_SOUTH_AFRICA = 7177
DC_ENGLISH_JAMAICA = 8201
DC_ENGLISH_CARIBBEAN = 9225
DC_ENGLISH_BELIZE = 10249
DC_ENGLISH_TRINIDAD = 11273
DC_ESTONIAN = 1061
DC_FAEROESE = 1080
DC_FARSI = 1065
DC_FINNISH = 1035
DC_FRENCH = 1036
DC_FRENCH_BELGIAN = 2060
DC_FRENCH_CANADIAN = 3084
DC_FRENCH_SWISS = 4108
DC_FRENCH_LUXEMBOURG = 5132
DC_GERMAN = 1031
DC_GERMAN_SWISS = 2055
DC_GERMAN_AUSTRIAN = 3079
DC_GERMAN_LUXEMBOURG = 4103
01/10/2007
Page 44/45
Conversion of your 4D databases to 4D v11 SQL
DC_GERMAN_LIECHTENSTEIN = 5127
DC_GREEK = 1032
DC_HEBREW = 1037
DC_HUNGARIAN = 1038
DC_ICELANDIC = 1039
DC_INDONESIAN = 1057
DC_ITALIAN = 1040
DC_ITALIAN_SWISS = 2064
DC_JAPANESE = 1041
DC_KOREAN_WANSUNG = 1042
DC_KOREAN_JOHAB = 2066
DC_LATVIAN = 1062
DC_LITHUANIAN = 1063
DC_NORWEGIAN = 1044
DC_NORWEGIAN_NYNORSK = 2068
DC_POLISH = 1045
DC_PORTUGUESE = 2070
DC_PORTUGUESE_BRAZILIAN = 1046
DC_ROMANIAN = 1048
DC_RUSSIAN = 1049
DC_SERBIAN_LATIN = 2074
DC_SERBIAN_CYRILLIC = 3098
DC_SLOVAK = 1051
DC_SLOVENIAN = 1060
DC_SPANISH_CASTILLAN = 1034
DC_SPANISH_MEXICAN = 2058
DC_SPANISH_MODERN = 3082
DC_SPANISH_GUATEMALA = 4106
DC_SPANISH_COSTA_RICA = 5130
DC_SPANISH_PANAMA = 6154
DC_SPANISH_DOMINICAN_REPUBLIC = 7178
DC_SPANISH_VENEZUELA = 8202
DC_SPANISH_COLOMBIA = 9226
DC_SPANISH_PERU = 10250
DC_SPANISH_ARGENTINA = 11274
DC_SPANISH_ECUADOR = 12298
DC_SPANISH_CHILE = 13322
DC_SPANISH_URUGUAY = 14346
DC_SPANISH_PARAGUAY = 15370
DC_SPANISH_BOLIVIA = 16394
DC_SPANISH_EL_SALVADOR = 17418
DC_SPANISH_HONDURAS = 18442
DC_SPANISH_NICARAGUA = 19466
DC_SPANISH_PUERTO_RICO = 20490
DC_SWEDISH = 1053
DC_SWEDISH_FINLAND = 2077
DC_THAI = 1054
DC_TURKISH = 1055
DC_UKRAINIAN = 1058
DC_VIETNAMESE = 1066
01/10/2007
Page 45/45