Return an array index.

Mauddib
Member Posts: 269
I have just begun in Navision programming and want to try and acheive something. I have two arrays with dimensions from [1][1] to [3][25].
One is text one is decimal. The text one I prepopulate from one table.
What I need to do is be able to return the index of a string in the text array and add in a number to the same index position on the decimal array. So if my table returns the values:
GUM 13.13
I can find that myarray has 'GUM' in position [2][12] and so I can add 13.13 to myOtherArray[2][12].
How is this done?
GMcB
One is text one is decimal. The text one I prepopulate from one table.
What I need to do is be able to return the index of a string in the text array and add in a number to the same index position on the decimal array. So if my table returns the values:
GUM 13.13
I can find that myarray has 'GUM' in position [2][12] and so I can add 13.13 to myOtherArray[2][12].
How is this done?
GMcB
0
Comments
-
Hi,
I am not saying your solution is wrong, but is it not easier to create a temporary table?
You can have the 2 integers as primary key.
You can easily filter in the table and find you 'GUM' value.
And a temp. table does not have to be in your licenseso you can create as much as you want.
Hope this helps.0 -
I would if i knew how :-p But I dont. Never worked with temp tables.0
-
Step by Step:
1. Create the desired table in the object designer
2. Define the table as variable in the globals or locals (whatever is desired)
3. Select properties on the variable en mark the temporary as yes.
4. Insert modify and delete as much as you want. The table exists only runtime.
5. If you leave the code, the object is destroyed automaticaly
Succes.0 -
Oh ok got ya, that I know how to do. I presumed you meant there was a way of creating a table at runtime which is only in memory.0
-
Ok. I hope it helped anyway.
Otherwise you can create a for/do loop and compare your arrayfor i := 1 to 3 do for j := 1 to 25 do if value = array1[i][j] then array2[i][j] := othervalue
Or someting like that.0 -
Mark Brummel wrote:And a temp. table does not have to be in your license
so you can create as much as you want.
Yes, but how you will create this table, if you do not have it in license??? ;-)0 -
thanks a lot for all that. I had hoped a returnindex might be in navision already but this will do. I know its in most of the other languages ive programmed in.0
-
Mauddib wrote:I had hoped a returnindex might be in navision already but this will do. I know its in most of the other languages ive programmed in.
Navision C/AL is designed as customisation tool, not realy as a programming language I think0
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