Rec.FIND('=><')

RachelSoon
Member Posts: 202
Hi All,
Anyone know what does the below statement mean?
Rec.FIND('=><')
I found this at T5606, function GetGenJnlDocumentNo.
Thank you.
Regards
Rachel
Anyone know what does the below statement mean?
Rec.FIND('=><')
I found this at T5606, function GetGenJnlDocumentNo.
Thank you.
Regards
Rachel
0
Comments
-
Straight from "help":This...
Tells the system to search for...
'='
A record that equals the key values (default)
'>'
A record that is larger than the key values
'<'
A record that is less the key values
'+'
The last record in the table ('+' can only be used alone)
'-'
The first record in the table ('-' can only be used alone)
If SearchStr contains '=', '>' or '<', you must assign values to all fields of the current and primary keys before you call FIND.
Probably it has assigned values to all parts of the primary key ... may be you can add some more code to see what it does in this case?0 -
RachelSoon wrote:I found this at T5606, function GetGenJnlDocumentNo.
What version are you using?0 -
Sorry, Waldo,
It's T5605.0 -
RachelSoon wrote:Hi All,
Anyone know what does the below statement mean?
Rec.FIND('=><')
I found this at T5606, function GetGenJnlDocumentNo.
Thank you.
Regards
Rachel
REC.FIN('=><'); is a function designed to optimize the process of finding the first record in a record set in the Navision Native database (if setup correctly). Its actually left over from the DOS days, and personally I doubt its value these days, and now I always replace it with the new command FINDFIRST.
Basically the way it work is this:
If you have already accessed any record int he current filter set, then that record would normally still be in cache, so the "=" will return that cached record without needing a disk access. This means you can start your processing immediately. Basically this is saying "we have a record in a variable that has the same primary key, but maybe the other fields have been changed so let's just go and refresh from the database.
The next thing, is to look at the quickest record to find next. Now so long as you followed the rules, and built Navision on multiple RAID 1 drives, (and not raid 10 or 5) then Navision will have tried to write the records sequentially as they were created across multiple drives, so the logic is that since the spindles are spinning in a forward direction, and assuming you have optimized spin latency.Then the next record in the current set will be found using the ">" command.
If none of those are found, then the system will find the record that is stored first on the drive with "<".
But today with intelligent disk controllers it really makes no sense. Today we let the hardware people worry about all that stuff. So just think that if you see Navision use the code, then in 99.9% of cases it can be replaced with FINDFIRST.
In reality though, maybe a better command might be FINDANY, but I can't see that its worth it.David Singleton0 -
I have a side remark with that.
Use FINDFIRST when you actually need that data of that record.
If you don't need data and you only want to see if there is a record for that filter, use ISEMPTY.
If you're going to loop the data, use FINDSET or FIND('-') (if the set is probably over 500 records)0 -
Waldo wrote:I have a side remark with that.
Use FINDFIRST when you actually need that data of that record.
If you don't need data and you only want to see if there is a record for that filter, use ISEMPTY.
If you're going to loop the data, use FINDSET or FIND('-') (if the set is probably over 500 records)
Yes sorry, you are right, FINDSET is generally probably the correct replacement in most cases, not FINDFIRST.David Singleton0 -
Hi All,
Thank you for the clarifications.
Regards
Rachel0
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