Error in DELCHR

Quivelus
Member Posts: 24
Hi,
Recently i tried to use the DELCHR function. The C/Side reference guide says following:
- I am currently working in version 4 SP2
Text constants:
Text000: 'Windy Solutions'
Text001: '>%1<, is transformed to: >%2<'
C/AL:
String := Text000;
Where := '<>';
Which := 'Ws';
NewString := DELCHR(String, Where, Which);
MESSAGE(Text001, String,NewString);
It says result will be:
>Windy Solutions<, is transformed to: >indy Solution<
Why is this. I would think it should be: >Windy Solutions<, is transformed to: >Ws<. I also tried the same with: Where := '=';
This gives the same result as with Where := '<>'...
Is this a bug or am i doing something wrong?
Recently i tried to use the DELCHR function. The C/Side reference guide says following:
- I am currently working in version 4 SP2
Text constants:
Text000: 'Windy Solutions'
Text001: '>%1<, is transformed to: >%2<'
C/AL:
String := Text000;
Where := '<>';
Which := 'Ws';
NewString := DELCHR(String, Where, Which);
MESSAGE(Text001, String,NewString);
It says result will be:
>Windy Solutions<, is transformed to: >indy Solution<
Why is this. I would think it should be: >Windy Solutions<, is transformed to: >Ws<. I also tried the same with: Where := '=';
This gives the same result as with Where := '<>'...
Is this a bug or am i doing something wrong?
Bohr-ing.
0
Comments
-
Hej Quivelus,
The On-Line help also states thatInclude...
To have the system delete any...
= Character in String that matches a character in Which. (default)
< Leading character in String that matches a character in Which.
> Trailing character in String that matches a character in Which.
That is
< removes only the leading character
> removes only the trailing character
Try using 'Windys WSolutions' => 'indys WSolution'With Kind Regards
Thoms Hviid Thorn0 -
True,
Ok, if it works like this, then i get it. I thought '<>' stood for 'different from'.
Tx.Bohr-ing.0 -
If you want to keep 0123456789 in a string in stead of deleting them, use this:
txtCharsToKeep := '0123456789'; txtString := DELCHR(txtString,'=',DELCHR(txtString,'=',txtCharsToKeep));
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!1 -
My purpose was to delete all chars that where not in the string (parameter). Guess i should use another function for this purpose.Bohr-ing.0
-
Quivelus wrote:My purpose was to delete all chars that where not in the string (parameter). Guess i should use another function for this purpose.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Indeed, guess i read your reply to swiftly and didn't notice the repetition of the DELCHR function. I now see how it works, tx Kriki.
P.S.: How do i close this subject? Or is this done automatically?Bohr-ing.0 -
Edit the subject in your original post and add [Solved]0
-
Good Topic kriki,
It was very helpfull for me!0
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