I have simply code : s := ‘“27/09/02”,“02:43:14 PM","geoffrey@TOURNAI.DUFOUR.com”,“geoffrey”,“0”,“069229251”,"","",“069229251”,“00:37”,“1”’; s := s + ‘,“SUCCESS”,“Fax sent successfully : Success”,“Line0”,""’; nom := SELECTSTR(7,s); When I execute Selectstr, I have error message : STRSET can’t contain more than one “”" and s is displayed with error What is that? ps : It’s a simple example to find error, normally, I read s from a text file. Thx
More simple, same error s_tmp := ‘AZ,ER,ER’; s2_tmp := SELECTSTR(1,s_tmp); STRSET can’t contain more than one ER …
No it can’t It is also mentioned in the helptext for SELECTSTR (snip) SELECTSTR treats string values as OPTIONS. This means that identical values in different strings are not allowed. (snip)
Thx, But my help (2.6 E), don’t say that ;/ : Use this function to retrieve a substring from a comma-separated string. NewString := SELECTSTR(Number, CommaString) Number Data type: integer This number tells the system which substring to retrieve. The substrings in the comma-separated string are numbered 1, 2, 3, and so on. If Number is greater than the actual number of substrings, a run-time error occurs. CommaString Data type: text or code A string containing substrings separated by commas. NewString Data type: text or code The substring the system retrieves from CommaString. Example This example shows how to use the SELECTSTR function: CommaStr := ‘This,is a comma,separated,string’; SubStr1 := SELECTSTR(2, CommaStr); // Pick out the 2nd substring SubStr2 := SELECTSTR(4, CommaStr); // Pick out the 4th substring MESSAGE(‘The two calls to SELECTSTR returns:’ + ‘>%1<’ + ‘>%2<’, SubStr1, SubStr2); The message window will show the following: The two calls to SELECTSTR returns: >is a comma< >string<
I guess they have updated it for Attain then Anyhow, it has always been like that.
Hi Geoffrey, If you look on to the help for 3.0 it says exactly the same thing which you said. But at the bottom they have added one more line which is like this : “SELECTSTR treats string values as OPTIONS. This means that identical values in different strings are not allowed.” I hope this will answer your query. Cheers
A link to “Preben Rasmussen” very helpful solution. [For the next person like me who didn’t read the manual, but does search the forum] http://www.navision.net/forum/topic.asp?TOPIC_ID=6155