I have noticed that in FIVEWIN the assign is done with = and := .
Could someone explain when to use = and when := .
Thanks in advance
Otto
I have noticed that in FIVEWIN the assign is done with = and := .
Could someone explain when to use = and when := .
Thanks in advance
Otto
= is the normal assignment operator while := in the inline version of the same operator. As an example:
REDEFINE BUTTON ACTION x = 1 // wrong!
REDEFINE BUTTON ACTION x := 1 // ok!
x = 1 // ok!
x := 1 // ok! It's the same
a = b = 1 // means a = .T. if b = 1 or .F. if b != 1
a = b := 1 // means a = 1 and b = 1
a := b := 1 // the same as above
EMG
Otto,
If you have the Clipper help file, there are good descriptions in there.
Regards,
James
Hello Enrico, hello James,
Thank you for explaining to me.
For example in TRBGroup-class assignments are made with := in TBtnBmp classe with =
( VB6 style which I don’t like). I thought that there is maybe a difference which I am not aware of.
Best regards,
Otto
a := 1To be sure, use := always ![]()
Ok, so to be sure use always + because * is too complicated. ![]()
EMG
Hello Enrico,
Fivewin classes are my reference for good programming style. As I see that for the same assignment in different classes = and := are used I asked which is the right way.
I personally prefer :=. Why context determining which is meant.
Thanks again for your help.
Best regards,
Otto
Otto,
We do prefer to use "=" unless ":=" (inline assignment) is required.
Anyhow, both ways are valid, though "=" is simpler ![]()