Inline conditional (conditional operator)

Ashton
Member Posts: 3
hi,
Is there any way in C/AL to do something like this (conditional operator):
A = F>0 ? 'yes' : 'No' ; // java example
just one line, no complex IF statement.
thx
Is there any way in C/AL to do something like this (conditional operator):
A = F>0 ? 'yes' : 'No' ; // java example
just one line, no complex IF statement.
thx
0
Comments
-
The ?-:-Operater is not realized in C/AL.
If it is possible to condition the result of a assignment like Belias posted then this is a short way otherwise you have no other chance than to code an IF-statement0 -
-
Dirk.Fischer wrote:The ?-:-Operater is not realized in C/AL.
If it is possible to condition the result of a assignment like Belias posted then this is a short way otherwise you have no other chance than to code an IF-statementIF it is possible to condition the result of a assignment like Belias posted THEN this is a short way ELSE you have no other chance than to code an IF-statement;
Sorry just feeling a little silly just now.0 -
-
I think a bicycle would be better.David Singleton0
-
thx to all for reply.
Inline conditional wold be very usefull for reports design...
for instance in TextBox.SourceExpr , instead:
( ABS("Credit Amount")>0 ? "G/L Account No." : '' )
i have to create prosthesis like this:
COPYSTR("G/L Account No.",1,20*(STRLEN(FORMAT(ABS("Credit Amount")))-1))
("Credit Amount" appear number or empty)
IF-statement in SourceExpr is not accepted.
Any better ideas for conditional in SourceExpr ??0 -
Ashton wrote:...
Any better ideas ...
Always you should do what will be best in the long term for the customer.David Singleton0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions