Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote Table Access
Message
From
13/10/2000 16:35:36
 
 
To
13/10/2000 16:06:26
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00429341
Message ID:
00429374
Views:
16
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform