Search code examples
operatorsclarioncolon-equals

What does the symbol :=: mean (colon equals colon)


I've found the symbol :=: in some Clarion code and I can't seem to figure out exactly what it does. The code was written by a previous developer many years ago, so I can't ask him. I also have not been able to find any results for "colon equals colon" in Google.

Here is an example of the code, where bufSlcdpaDtl is a file object:

lCCRecord Like(bufSlcdpaDtl),Pre(lCCRecord)

! ...other stuff...

lCCRecord :=: bufSlcdpaDtl

I'm wondering if it's something similar to ::= in Python or possibly the assignment operator :=.


Solution

  • In the language reference manual on page 561 This is called the Deep assignment operator. The syntax is destination :=: source. Destination can be a label of a GROUP, RECORD, QUEUE ds or an array. The source can be the same plus a numeric, string const, variable, procedure, or expression. It will perform multiple individual component variable assignments from one ds to another. More information can be found in that document as well as the apparent home of clarion: http://www.softvelocity.com/

    A great example of what the Deep Assignment operator does:

    Group1 GROUP
        S    SHORT
        L    LONG
    END
    
    Group2 GROUP
        L    SHORT
        S    REAL
        T    LONG
    END
    
    ArrayField SHORT,DIM(1000)
    
    CODE
    
    Group2 :=: Group1   ! Is equivalent to: 
                        !     Group2.S = Group1.S
                        !     Group2.L = Group1.L
                        ! and performs all necessary data conversion 
    
    ArrayField :=: 7    ! Is equivalent to: 
                        !     LOOP I# = 1 to 1000
                        !         ArrayField[I#] = 7
                        !     END