Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ryss Unger
  Where is Ryss Unger?
 Cape Town
 South Africa
 Ryss Unger
 To: chris smith
  Where is chris smith?
 Yorkshire CH CH
 Barbados
 chris smith
 Tags
Subject: RE: testing for empty()
Thread ID: 153 Message ID: 164 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Monday, May 14, 2001 1:56:22 PM         
   


> > > This is weird. Is it possible that you have some kind of error handling system that puts you on the wrong track?
> > >
> > > For example, this line
> > >
> > > if empty(&kf2)
> > >
> > > may result in an error if the table is not in use. Perhaps you wrongly typed the value of thisform.keyfield2.
> > >
> > > ----------------
> > > Hth,
> > >
> > > Eric den Doop
> > > www.foxite.com
> > Hi Guys,
> > kf2 = thisform.keyfield2 could well relate to an object and not the value or the field in a table, thus always = .t.
> >
> > also note :-
> > if ! empty(thisform.focustext)
> > ft = thisform.focustext
> > thisform.&ft..setfocus
> > endif
> >
> > Could be achieved with :
> > if ! empty(thisform.focustext.value)
> > thisform.focustext
> > endif
> >
> > I would avoid the macro substitution " &" unless absolutely required. can give unexpected behaviour.
> > HTH
> > Ryss
>
> Hello guys
> Actually keyfield,keyfield2,focustext are all properties in the a form class that I designed and on the actual form.scx I have the correct keyfield names and the textbox that I want the focus to be set to after saving (focustext) all type in correctly in the forms properties. I don't have any error handling active with the project as yet. If I can't find a solution to this issue I will remove the beforesave() method and place the code directly at the top of the save() method. If the thisform.keyfield2 is empty I would simply issue a return so as to get out of the save() method. Does this may any sense?
>
> smith
Hi Chris,
Yes it makes sense. I think

> kf2 = thisform.keyfield2 relates to a textbox and not the value of the text box display. Therefore it will always test to .T.

Test the field of the table or the value of the text box and not the box itself

I hope We are on the same wave length.
Regards
Ryss

ENTIRE THREAD

For Eric den Doop Posted by chris smith @ 5/13/2001 1:29:33 PM
RE: For Eric den Doop Posted by Eric den Doop @ 5/13/2001 2:53:30 PM
testing for empty() Posted by Ryss Unger @ 5/13/2001 3:36:05 PM
RE: testing for empty() Posted by chris smith @ 5/13/2001 4:39:14 PM
RE: testing for empty() Posted by Ryss Unger @ 5/14/2001 1:56:22 PM
RE: testing for empty() Posted by Dale Dedoroy @ 5/14/2001 9:31:39 PM