increment alpha variable?

zfmejenny
Member Posts: 5
I have a code variable that might be A or B or 1 or 2, etc.
I have a report that is using INCSTR(variable), but this is unable to increment the alpha variables.
Is it possible to increment to the next alpha?
Thanks!
I have a report that is using INCSTR(variable), but this is unable to increment the alpha variables.
Is it possible to increment to the next alpha?
Thanks!
0
Comments
-
Here is an example on how to increment text. It will increment all the way to z.
t := 'tada'; if INCSTR(t) = '' then begin t[strlen(t)] := t[strlen(t)] + 1; end else t := INCSTR(t); message(t);
You can use it to do more complex code. Such as increment past z.0 -
Thanks Rashed! That worked great.0
-
you are welcome.0
-
-
It does go beyond z but I don't think having } as an increment makes sense.0
-
-
I usually use this trick to see if last character is a '\' when a directory is specified for files.0
-
[Topic moved from Navision forum to Navision Tips & Tricks forum]
How wonderfull that I can sometimes move something TO the Tips & Tricks forum!Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
It's sad that I have to look for my own tips and trick?0
-
-
tyvm for the sample and the tip!0
-
you are welcome.0
-
I am using this code to do the same, but with possibility to define the string of "numbers"...
IncStrAlpha(Code : Code[20]) : Code[20] //Increment Alpha Strig SeqText := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; //sequence of "numbers" i := STRLEN(Code); REPEAT Pos := STRPOS(SeqText,FORMAT(Code[i])); IF Pos = STRLEN(SeqText) THEN BEGIN //Is last number in row Code[i] := SeqText[1]; //take first number i := i-1; //change number on higher position END ELSE BEGIN Code[i] := SeqText[Pos+1]; Switched := TRUE; END; UNTIL Switched or (i = 0); EXIT(Code);
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