IF CONFIRM(STRSUBSTNO(TXCAlreadyExist,FIELDCAPTION("Serial No. Summary"),TBAUHeader.tablecaption,TBAUSerNo."au no.")) THEN EXIT
IF CONFIRM( *****STRSUBSTNO( *******TXCAlreadyExist,FIELDCAPTION("Serial No. Summary"),TBAUHeader.tablecaption,TBAUSerNo."au no.")) THEN **EXIT
Answers
Hi
I prefer:
or, if there are more parameters:
bye
Matteo
well, i found this example on "C/AL programming guide", so i was wondering if the same applies for "nested functions" or only for the "not" parameter :-k
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
i don't like it
I prefer:
or
Bye
Matteo
or something similar... which is good if you have many parameters (you can write comments to each one etc.)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I would not do it like this:
Also, I've made it a habit to always use BEGIN and END. With one-liners it looks a little like overkill, but this way I never have to think about whether it's needed, or worry about whether the second line is supposed to be included or not. It makes it easier for me to read/write code.
So I would do it like this: Plus I would probably also think about keeping just one condition per line:
RIS Plus, LLC
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
The important thing is to define a "house-rule" and stick with it (and change it only when you find out it can be better for some reason. An example.
SETCURRENTKEY(
**"Field 1",
**"Field 2",
**"Field 3",
**"Field 4",
**"Field 5");
It is better
SETCURRENTKEY("Field 1","Field 2","Field 3","Field 4","Field 5");
or
SETCURRENTKEY(
"Field 1","Field 2","Field 3","Field 4","Field 5");
The reason is for searching where an index is used. This way, you can export the objects as text and search for <"Field 1","Field 2","Field 3"> and find the SETCURRENTKEY.
For indenting, there is a rule for NAV (at least there was until all code had to be written in English, but I find the rule still useful): The result is that the indentation is off: the parameters are not in the column that comes just after "(".
So the correct way would be the indent by to columns:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I've also had the habit to always use he begin/end statements (for the same reasons of denster and for the breakpoints placements, too) but in the end i felt tired to see a ton of "END;" at the end of my code... :-k
I think, as you also do, that indentation is (still) too subjective in some cases...it would be easier without the max-characters-per-line limitation :whistle: ...until that day, i think that we have to solve these cases following this rule!
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Andwian
RIS Plus, LLC
I personally use BEGIN ... END whenever the statement is a complex one (i.e a loop or branch)
I also usualy break indentation rules in some cases, where we use the available language constructs to emulate missing ones. e.g. I use rather than emulating an if ... then ... elsif ... else structure
and rather than (With or without BEGIN END for the THEN part) emulating a foreach REC do.
2nd: i keep on using "useless" begin end when there are more than one line of code, because it makes it easier to understand (but as always, this is a personal opinion)
e.g.: althought we should use P.S.: do not run the code i wrote (unless you set "a" or "b" to be <> 1)
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Andwian