Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
use of seek command
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00749086
Message ID:
00751178
Views:
24
This message has been marked as the solution to the initial question of the thread.
The basics are always fun! A general flow might look like this:
1 - txtLotNo.GotFocus
2 - txtLotNo.LostFocus
    if empty(txtLotNo)
       * Do nothing, subsequent text box when's will prevent focus
    else && Not empty
    if seek(RIGHT(STR(txtlotno+100000000,9),8))
       * Found, retrieve for edit existing LotNo and allow focus
       * txtLotNo focus disallowed for existing record
       * Enable delete
    else && Not found, must be a new lotno entry
       * messagebox([Add new lot number (y/n)?])
       if Yes
          * New entry and allow focus
       else
          * Blank txtLotNo and Exit to 5
       endif &&Yes
    endif &&seek(RIGHT(STR(txtlotno+100000000,9),8))
    endif &&empty(txtLotNo)
3 - Save changes to new
4 - Or allow delete of existing
5 - Undo or disregard
6 - Recycle to "standby" state
>Terry u asked me if they make a mistake do they have to delete erroneous record
>
>I had this in valid statement, originally reflected my choice of numerical type, as u can see I adopted character and also decided to increase field length.
>
>***********************************
>Select lotno
>Set Order To lotno
>SEEK RIGHT(STR(mhlotno+100000000,9),8)
>IF FOUND() or mhlotno=0
>SET BELL TO 'c:\desales\error.WAV'
>
>?? CHR(7)
>
>RETURN 0
>ELSE
>RETURN 1
>endif
>***********************************
>
>I'm happy with myself for heeding your advice,
>
>Ciao,
>
>Baxter
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform