Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
'home-made' navigation
Message
 
À
29/11/2000 10:15:53
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00446721
Message ID:
00447025
Vues:
10
A small problem in your code is the following:
If you are at the first record, then you are the the Beginning Of File (BOF)
But if you are at the last record then you are not at the End Of File (EOF)
You are at the EOF when your record pointer is one position farther then the last record.
This is not true for the Begiining Of File.
you can have skip -1 at the first record, but you will stay at the first one.

For your EOF disabling you have to look at this.
The code could be something like this:
Local llEOF
if !EOF() && Check to see if you are at eof now
  Skip && next record.
  If !EOF() && If the new record is the last record, then EOF() is not .t.
    Skip    && We can check this by going one record farther
    If EOF() && If we are then at EOF() it was the last one
      llEOF = .t.
    EndIf
    Skip -1
  Else && if the old record was the last record, then EOF() is .t. now
    llEOF = .t.
  EndIf
Else
  llEOF = .t.
EndIf
>VFP 6.0
>
>Can you help me with this navigator issue. I have a Commandgroup of 10 buttons and the first 4 are the (|< < > >|). For some reason I keep getting confused with BOF(), weather it's 'Beginning Of File' or 'Bottom Of File'. I know the document and the indeed is the 'Beginning Of File', but still get the idea of 'Bottom', which is what the EOF() is. Anyway, can you kindly check the coding below and tell me what am I doing wrong for the navigation. Also, IF there is something I can use like This.Parent.Command1.DISABLED, how to do that (instead of using the '= .F.' and '= .T.')? As this UT allowed, I am using single quotes instead of double quotes in here.
>
>Thank you.
>
>Chuck
>
>
>( |< )
>GO TOP IN person
>This.Parent.Command1.ENABLED = .F.
>This.Parent.Command2.ENABLED = .F.
>This.Parent.Command3.ENABLED = .T.
>This.Parent.Command4.ENABLED = .T.
>ThisForm.REFRESH
>
>( < )
>IF NOT BOF('person')
> SKIP -1 IN person
>ENDIF
>IF NOT BOF('person')
> This.Parent.Command1.ENABLED = .T.
> This.Parent.Command2.ENABLED = .T.
> This.Parent.Command3.ENABLED = .T.
> This.Parent.Command4.ENABLED = .T.
>ELSE
> This.Parent.Command1.ENABLED = .F.
> This.Parent.Command2.ENABLED = .F.
> This.Parent.Command3.ENABLED = .T.
> This.Parent.Command4.ENABLED = .T.
>ENDIF
>ThisForm.REFRESH
>
>( > )
>IF NOT EOF('person')
> SKIP 1 IN person
>ENDIF
>IF EOF('person')
> GO BOTTOM IN person
>ENDIF
>IF NOT EOF('person')
> This.Parent.Command1.ENABLED = .T.
> This.Parent.Command2.ENABLED = .T.
> This.Parent.Command3.ENABLED = .T.
> This.Parent.Command4.ENABLED = .T.
>ELSE
> This.Parent.Command1.ENABLED = .T.
> This.Parent.Command2.ENABLED = .T.
> This.Parent.Command3.ENABLED = .F.
> This.Parent.Command4.ENABLED = .F.
>ENDIF
>ThisForm.REFRESH
>
>( >| )
>GO BOTTOM IN person
>This.Parent.Command1.ENABLED = .T.
>This.Parent.Command2.ENABLED = .T.
>This.Parent.Command3.ENABLED = .F.
>This.Parent.Command4.ENABLED = .F.
>ThisForm.REFRESH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform