|
Home > Archive > Programming with dBASE > November 2005 > debugger giving different results than actual form.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
debugger giving different results than actual form.
|
|
| Rouke Bakker 2005-11-27, 3:24 am |
| Dear all,
I've created a simple form to filter a word list to contain only words
that rhyme to a word entered into an entryfield. The form also contains
two entryfields to allow the user to enter two character strings to be
excluded from the filter. However, when I run the form, it gives me
error messages such as that the variables are not defined. Currently it
keeps crashing dbase. The form has a number of entryfields, two buttons
and one browse object, set to the only field of the table "wordlist
..dbf", of which append, delete and modify are set to .F..
The code in the gobutton_onclick procedure is: (mind word wrap)
********************
*******
Procedure OKBUTTON_OnClick
Form.Text4.text = "Even geduld alsjeblieft."
Lc_rijmwoord = form.woord.value
Lc_niet1 = form.niet1.value
Lc_niet2 = form.niet2.value
do case
case .not. lc_rijmwoord = "" .and. lc_niet1 = "" .and. lc_niet2 = ""
set filt to right(rtrim(wordlist
-> woord),len(Lc_rijmwo
ord)) =
lc_rijmwoord
case .not. lc_rijmwoord = "" .and. .not. lc_niet1 = "" .and.
lc_niet2 = ""
set filt to right(rtrim(wordlist
-> woord),len(Lc_rijmwo
ord)) =
lc_rijmwoord .and.;
.not. right(rtrim(wordlist
-> woord),len(lc_niet1)
) = lc_niet1
case .not. lc_rijmwoord = "" .and. .not. lc_niet2 = "" .and.
lc_niet2 = ""
set filt to right(rtrim(wordlist
-> woord),len(Lc_rijmwo
ord)) =
lc_rijmwoord .and.;
.not. right(rtrim(wordlist
-> woord),len(lc_niet2)
) = lc_niet2
case .not. lc_rijmwoord = "" .and. .not. lc_niet1 = "" .and. .not.
lc_niet2 = ""
set filt to right(rtrim(wordlist
-> woord),len(Lc_rijmwo
ord)) =
lc_rijmwoord .and.;
.not. (right(rtrim(wordlis
t-> woord),len(lc_niet1)
) = lc_niet1 .and.;
right(rtrim(wordlist
-> woord),len(lc_niet2)
) = lc_niet2)
case lc_rijmwoord = "" .and. lc_niet1 = "" .and. lc_niet2 = ""
lc_message = msgbox("Welk woord moet ik nou opzoeken?","Geen
woord ingevuld!",48)
Endcase
Count to Ln_woorden
go top
Form.Text4.text = ltrim(str(Ln_woorden
)) + " woorden gevonden:"
********************
**
The form is terribly unstable, when I debug it, or when I issue the
individual commands in the command editor, it works OK.
The windows version is 98 se, the wordlist is rather long, about 18 mb,
or 178,429 records, but that shouldn't matter should it?
Is there anything unusual in this code, except for some dutch words? ;-)
Regards,
--
Rouke
| |
| Bruce Beacham 2005-11-28, 7:23 am |
| Rouke Bakker wrote:
> set filt to right(rtrim(wordlist
-> woord),len(Lc_rijmwo
ord)) =
> lc_rijmwoord .and.;
> .not. (right(rtrim(wordlis
t-> woord),len(lc_niet1)
) = lc_niet1 .and.;
> Is there anything unusual in this code, except for some dutch words? ;-)
When you exit from this method, is the filter still active? If it is,
then you may have a problem as the filter refers to variables that are
out of scope when the method exits.
Bruce Beacham
|
|
|
|
|