dividing a string(help)

phondaj
Member Posts: 60
hi navision experts,
i need your help!
I have a string like that 123456789 a want to creat e variable with 2 first nambers "12", and another variable with 4 number countin from the end "6789" is that imposible on navision
or
if my string start with 12 else last 4 nomber should be 0000
thnx
i need your help!
I have a string like that 123456789 a want to creat e variable with 2 first nambers "12", and another variable with 4 number countin from the end "6789" is that imposible on navision
or
if my string start with 12 else last 4 nomber should be 0000
thnx
0
Comments
-
Hi
you can use STRLEN & COPYSTR functions.Sandeep Prajapati
Technical Consultant, MS Dynamics NAV0 -
Also STRPOS and EVALUATE...0
-
[-o< can any body give a example how it exactly work cuze i trying all the day and yet e didnt get the solituon :oops:0
-
Rather than write the code for you, I'll show you how to get more information about this.
Click on your help menu, and select "C/SIDE Reference Guide". This opens the C/SIDE Reference Guide, which has all the syntax help that you need. Go to the Search tab, type in STRPOS and click "List Topics". Now you will see the command in the lower left hand box. Put your cursor on the topic and click on "Display". Now you will see the help topic for this command in the right hand side of the C/SIDE Reference Guide. It even comes with a code sample. Do the same with STRLEN, and any other command you want to know more about.
In the C/AL editor, press F5. On the left hand side scroll down to where it says SYSTEM. In the middle, select String, and this will display all available commands for Text variables. Type in any of these commands into the C/SIDE Reference Guide to learn about them. There are tons of code samples in there that should help you figure this kind of stuff out.
In the beginning you don't know what all those commands are for. Don't worry neither did any of us when we first started. That's why you should read about all of them, and learn what they stand for. Good luck0 -
I can recommend this handy reference guide: Microsoft Dynamics NAV 5.0 Quick Reference. But maybe I'm a bit biased here ;-)No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
-
*No. is item number
shifra := "No.";
teksti := 'pozicioni:';
substring := '2700';
pos := STRPOS(shifra, substring);
MESSAGE(teksti, pos);
and i mesagebox show me just teksti variable "position:"
wher is my mistatake0 -
you can try with
FirstPart := string[1] + String[2] ;
Your mistake is in teksti := 'pozicioni:';
IT should be teksti := 'pozicioni: %1';
and
MESSAGE(STRSUBSTNO(teksti, pos));0 -
speciale thnx to all0
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