OPERATORS

Addition (+)

Add two numbers, concatenate two strings, or add a number of days to a date.

Syntax

Signature
left + right

Description

Add two numbers, concatenate two strings, or add a number of days to a date. The date may occur on either side.

With typed numbers an integer and a fraction give the type of the fraction: FLOAT32 with any integer gives FLOAT32, FLOAT64 gives FLOAT64. An overflow of a typed result is a runtime error.

Example

Addition.prg
PROCEDURE Main()

   LOCAL dOrdered := SToD( "20260227" )
   LOCAL nTransit := 4
   LOCAL cOrder := "PL-" + "1042"

   QOut( cOrder + " due " + DToS( dOrdered + nTransit ) )
   QOut( "Units after delivery", 18 + 12 )

   RETURN

Output