Skip to content

4d/4D-Macros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Static Badge Static Badge
release license

When this component is installed and loaded into your project, its macros are automatically available in the code editor and can be invoked:

  • By clicking on the Macros button on the code editor toolbar.
  • By double-clicking on their name in one of the footer lists of the method editor.
  • For some of them, by selecting the name of the macro in the “Method” > “Insert Macro” submenu, or in the “Insert Macro” submenu of the editing zone context menu.
  • For some, in the predictive input window.

For more information on the use and operation of macros, you can refer to the 4D documentation.

Installation

Static Badge

This component is compatible with the Project dependencies feature. So you can simply integrate this component into your project by selecting Design > Project dependencies and adding 4d/4d-macros as the GitHub® repository address in the dedicated dialog box.

📍The project's dependency manager ensures that you are always using the latest available version of the components.

Earlier versions of 4D or binary database

  1. Create a Components folder next to the Project folder of your database *.

  2. Place the 4D Macros.4dbase component ** in this Components folder.

    * For a binary database, the Components folder must be located next to the structure file of your database (".4db").
    ** On macOS, the component is a package whose ".4dbase" extension is not necessarily visible depending on your display preference settings.

📍It is always preferable to use an alias file (macOS®) or shortcut file (Windows®) instead of the component and thus store the originals in a single copy. Updates will be simplified especially if you maintain several projects.

Name Goal
C_xxx -> var Replaces the deprecated instructions “C_xxx(...)” with the new syntax “var ... : type”.

After calling this macro, for the entire method, deprecated declaration statements such as C_LONGINT(…)*, C_TEXT(…)*, C_BLOB(…)* ... are replaced by the new syntax var ... : Integer, var ... : Text, var ... : Blob

📍 The lines C_xx ( <method>; $… )** & the comments are not modified

* With 20R7+, C_xxx commands are preceded by the obsolete marking prefix and are displayed as _O_C_xxx.

** The C_xx ( <method> ; $... ) declarations used in COMPILER_xxx methods to define parameters and returns for project methods are obsolete. The use of the syntax #DECLARE dispenses with these declarations.

For example :

_O_C_TEXT(vDetail)
// _O_C_TEXT(vMessage)
_O_C_LONGINT(vError)

_O_C_LONGINT(myMethod; $0)

will be transformed into:

var vDetail : Text
// _O_C_TEXT(vMessage)
var vError : Integer

_O_C_LONGINT(myMethod; $0)

If you encountered a bug or have a feature request, feel free to create an issue. However, it is highly appreciated if you browse and search current issues first. Found the issue? Go on and join its discussion thread. Not found? Go on and create one.

It is strongly recommended that you create a clone of this repository and do a pull-request for your improvements and bug fixes.