# Meaning of ":="

**URL:** <https://techcommunity.softwareag.com/t/meaning-of/205434>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-News-and-General-Topics\
**Created:** [September 5, 2019, 3:43pm UTC](https://techcommunity.softwareag.com/t/meaning-of/205434 "2019-09-05T15:43:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee\_Rhodes](https://avatars.discourse-cdn.com/v4/letter/l/919ad9/32.png) [@Lee\_Rhodes](https://techcommunity.softwareag.com/u/Lee_Rhodes)\
**Post date:** [September 5, 2019, 3:43pm UTC](https://techcommunity.softwareag.com/t/meaning-of/205434/1 "2019-09-05T15:43:12Z")

</div>

Hello, I am completely new to Natural and have been poring over as much documentation and code examples as I can to get a better understanding of syntax.

I keep seeing multiple examples of the operator “:=” and am wondering about what exactly this means as opposed to a single “=”? From what I can tell, I just assumed it is shorthand for assignment as opposed to writing out COMPUTE or something else wordy.

What else can “:=” do?

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [September 5, 2019, 6:21pm UTC](https://techcommunity.softwareag.com/t/meaning-of/205434/2 "2019-09-05T18:21:43Z")

</div>

The “becomes” operator ( := ) was introduced as shorthand for the “ASSIGN =” syntax, ASSIGN being a synonym of COMPUTE. Then, at the user community’s request, “becomes” was allowed in combination with a keyword. Now, all five variations are legal:

```auto
ASSIGN #A = 'string'
COMPUTE #A = 'string'
#A := 'string'
ASSIGN #A := 'string'
COMPUTE #A := 'string'
```

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [September 12, 2019, 10:33am UTC](https://techcommunity.softwareag.com/t/meaning-of/205434/3 "2019-09-12T10:33:31Z")

</div>

There’s one difference: You have to use ASSIGN or COMPUTE for the ROUNDED option.  
The following code wouldn’t work:

```auto
define data local
1 #n2(n5.2)
1 #n5(n5.5) init <123.98765>
end-define
rounded #n2 := #n5
display #n5 #n2
end
```

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [September 12, 2019, 8:46pm UTC](https://techcommunity.softwareag.com/t/meaning-of/205434/4 "2019-09-12T20:46:36Z")

</div>

Well, I think keyword options are a bit off-topic, but now that you have mentioned them, … 🙂

It was a bit of a surprise to me, but your example ran and produced the correct result under Natural for Windows 9.1.1.

```auto
DEFINE DATA LOCAL  
1 #N2(N5.2)
1 #N5(N5.5) INIT <123.98765>  
END-DEFINE  
ROUNDED #N2 := #N5  
DISPLAY #N5 #N2  
END 

Page 1 09/12/19 11:42:31
 
    #N5 #N2
------------ ---------
 
   123.98765 123.99
```

My personal preference is to always use keywords. I find it easier to skim down the left side of the code to see what’s going on. Random characters (that is, variable names) slow that process.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:43pm UTC](https://techcommunity.softwareag.com/t/meaning-of/205434/5 "2021-04-02T15:43:29Z")

</div>


