Think of INITIAL as being a syntactical shortcut that lets you avoid writing a following ASSIGN statement. However an important difference between INITAL and ASSIGN is that you can ASSIGN a variable the value of another variable (among other things), whereas the INITIAL option can only take a constant value. For example, you can initialize a date to TODAY (which is a constant) but not to TODAY + 1 (which is an expression).
Also, if you don't have a good reason to define your variables (and temp-tables and input parameters) as UNDO, they should be defined as NO-UNDO. Otherwise you are unnecessarily slowing down your code, growing your LBI file, and potentially introducing side-effects that may be difficult to find. And do the next programmer who will have to maintain your code a favour: don't abbreviate keywords, even though the compiler lets you.
Try this:
Code:
define variable a as date no-undo.
define variable b as date no-undo.
assign
a = today + 1
b = a
.
display a b.
P.S.: "10.2" is not an OpenEdge version. 10.2A is a version; 10.2B is a different version. More info: Product Life Cycle Guide.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.