+= style incrementing for Text/Code data types

Hi everyone, I hope I’m not stating the obvious. The following code does not work: Code := 'Microsoft'; Code += '-Navision'; MESSAGE('Value of Code: %1',Code); The Code variable will contain only “MICROSOFT”. However if the variable is of data type Text, the example above will work and the Text variable will contain “Microsoft-Navision”. I use this syntax extensively but only today I tried it with the Code data type, so this is my word of warning. Best regards,

…and if the statement is Code := Code + ‘.Navision’ it works fine as well! Strange!! Tried a quick search in Partnerguide, nothing found.

Can someone provide a logical explanation for this behaviour? Since Text and Code are both string variables, why is there a difference?

If all programs always were logical, we would not need support staff [:D] As a matter of fact, from a compiler’s point of view Text and Code are different data types - they probably forgot to implement the += operator for Code variables…

the += etc constructs,whilst they have always been there, are not supported, so there is no need for them to work

Supported or not, Microsoft uses the functionality in their own standard code (Se 3.60 and search for it…). Even if the GUI-guideline does not allow this feature. Anyway, I always use += -= *= and /= because it makes the code easyer to read and faster to write… But I think it only makes sense when using with decimals or integers…

I also use += and -= regularly, but if they don’t work, I don’t complain. If you did (as one of my developers once did to Navision about 5 years ago*), they will just say …but its not in the manual. *PS the developer was using /= on a time variable … no … don’t even go there.

My original purpose was not to ask “Why does it not work? Fix it!”. It was more of a warning for other people that might encounter this situation some day, hence the choice of forum: “Known Issues”. I think everyone understands that using += is a little like “cheating”, but since HQ is cheating, why shouldn’t we?

I agree, but this is really for the tips and tricks forum, since it is not really a bug [:-)]