Skip to content

Predefined Conditionals

Predefined conditionals are symbols available in DataFlex to help control conditionally compiled code in the current workspace.

Other than Is$Windows and Is$WebApp, all other symbols that control #IFDEF conditionally compiled code must be configured and managed in the Configure Workspace dialog on the Conditionals tab.

Conditional Purpose
Is$Windows The Studio's parser assumes that the Is$Windows special symbol is predefined. This means that you do not need to specify this symbol for any workspace.
Is$WebApp The Studio will automatically manage the True/False value of this symbol for you according to whether the current project you are working on is a Web Application project.
IS$WIN64 When code or settings must only be applied to the 64-bit environment, not 32-bit, the compiler switch IS$WIN64 may be used.

#IFDEF IS$WIN64
  #Replace LONGPTR_DTSIZE 8
#ELSE
  #Replace LONGPTR_DTSIZE 4
#ENDIF

In 32-bit, both DWord and Handle are 32-bit items (4 bytes), which does not lead to any padding. However, in 64-bit, Handle has become 64-bit (8 bytes) and that causes the struct to have 8-byte alignment, which means that in Windows compilers there will be 4 bytes of space inserted after lStructSize. If this doesn't get corrected in 64-bit environments, there can be an unexpected runtime error or crash upon calling the external function.

The solution in DataFlex code is:

Struct tWinChooseFont
  DWord lStructSize
  #IFDEF IS$WIN64
    Integer iStructAlignment
  #ENDIF
  Handle hwndOwner
End_Struct
COMP$TIMESTAMP Globally available in your programs. COMP$TIMESTAMP is defined as the UNIX UTC (number of seconds since 1 January 1970; locale independent) timestamp as a constant UBigInt.

While custom calculations are possible, the Date & Time library is available to have calculations easily performed.

Move COMP$TIMESTAMP to ullUnixUTC

See Also

Configure Workspace - Conditionals

Compiler Directives

Compiling Applications

64-bit in DataFlex