>In my app I type in a drawing number. Then code takes this number a attempts to find a matching drawing number in a table on a remote system. If match is made the record is displayed in the app for view/update. Normally the drawing number is six digits example(852604). This is easy enough to match and a navigation button can scroll through sequiential drawing numbers by adding 1 to the current drawing number and finding that match. The trouble I am running into is now some of the drawings are taking on dash numbers example(852604-401, 852604-403 etc.) This can happen anywhere in the numbering system. How can I make code be flexible enough to find a draiwng number that is next in sequince that has an appended dash number and know when the next number is only 6 digits? Thanks
assuming:
Current drawing = "852604-403"
Next record could be either "852605" or "852604-404" - is this a correct assumption or could it be "852605-400" (start the "852605" drawings with a dash) or "852604-405" (skip sequence in dash part) - I'll assume it's Ok for the rest of this.
Look for
(DrawingNo = "852604-404" OR DrawingNo = "852605")
Put the dashed number first.
-or-
SET DECIMALS TO 3
lnValue = VAL(STRTRAN(cDrawingNo,"-",".")) && 852604.403
LOCATE FOR VAL(STRTRAN(cDrawingNo,"-",".")) > lnValue && 852604.404 or 852605.000, whichever is there
That will find the next highest drawing number - which will be the next one in sequence
HTH
Insanity: Doing the same thing over and over and expecting different results.