Hi Experts,
Please help me with following situation
I have a code variable sat cd:='A001'.I want to increment it till 'A0015'.
How do increment?I used the strlen(cd)+1.but when the output reaches till A0010 it displayes some vague cahracters.Please help
0
Comments
Then there is something wrong...
Can you show us what you've written?
if you want A0015, you have to start your number serie from A0001, not from A001...
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Say example there is a field called ext.ref no
"Ext. Reference No."[STRLEN("Ext. Reference No.")]:=
"Ext. Reference No."[STRLEN("Ext. Reference No.")] + 1;
and based on certain parameter it ahs to be incremented.Say i give the ext as 'A001' and i give the other paramenter as 4.so it should generate from A001 to A016.The numbers are getting generated bt from A010 it is showing as A0&8(some symbol afte A).
this code comes directly from the hell...you have to learn the basic principles of NAV before writing code...i can't correct your code because it's completely wrong: square brackets...you have to study the manuals, ask a senior developer, see what standard code does, see online help...
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
This is translated (probably) to:
From "Ext. Reference No." take character at position x and turn it to the character represented by x + 1 in the current set.
Did you follow that advice? There is a call to INCSTR in that codeunit.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Which one?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
cduno.GetNextNo(cd,today,true);
It says A001 doesnt exist
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Any more reply
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
A0002 := incstr(a00001);
A0010 := incstr(a00009);
and so on and so forth.
The answer has been given, but please tell me you are working on this for training and not for a customer.
(how to find incstr, in the code page, press F5, you can see 3 columns, in the first, search for SYSTEM, in the second, search for String, and you'll find all your (handy) string functions in the 3th column, a question about any variable in these columns, stand on it and press F1! )
|To-Increase|
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog