SelectStr usage

ericleung
Member Posts: 14
Hi,
I want to use selectstr to get the content of a comma-separated string, but if the content have repeated more than once, the function seems not work:
E.g. if the string is : 'abc,abc'
it prompt: 'STRSET' cannot contain "abc" more than once.
Do anyone know any ways to do with the function or another ways to do this??
Many Many Thanks in advance!
I want to use selectstr to get the content of a comma-separated string, but if the content have repeated more than once, the function seems not work:
E.g. if the string is : 'abc,abc'
it prompt: 'STRSET' cannot contain "abc" more than once.
Do anyone know any ways to do with the function or another ways to do this??
Many Many Thanks in advance!
0
Comments
-
if you hit F1 you'll see that the help online says:Comments
SELECTSTR treats string values as OPTIONS. This means that identical values in different strings are not allowed.commaposition := strpos(mystring,','); copystr(mystring,1,commaposition - 1); //copy the first value
this is stupid code, that you should elaborate in with some loops etc. to retrieve the values.
basically, copystr and strpos function will do the trick for you0 -
That's OK. Really thanks for your comments!!!0
-
Hi Eric,
I always use the following function:SelectStr2(Number : Integer;VAR Options : Text[1024]) ExitValue : Text[1024] i := 1; SplitCounter := 1; WHILE (i <= STRLEN(Options)) AND (SplitCounter <= Number) DO BEGIN IF Options[i] = ',' THEN SplitCounter += 1 ELSE IF SplitCounter = Number THEN ExitValue += FORMAT(Options[i]); i += 1; END;
Regards,
ReijerReijer Molenaar
Object Manager0
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