Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Never before seen error..

Status
Not open for further replies.

CleoMan

Programmer
Jun 18, 2003
110
ZA
I use the following code(see below) in a function to determine if program execution should continue, if it returns YES the execution continues, if NO then someother form of execution takes place.

I have a main loop, that scans through a a very large table and for each record it calls this subfunction.

Every thing works fine and then suddenly i get the following message: "Matching Error: Unmatched parenteses", which is caused by the code below. I dont know why this happens, as the firts couple of times the code works fine and for no reason (that i can detemine)this message pops up.

So any ideas guys?

Thanks Richard

Code:

strYes = "YES"
strNo = "NO"

if AgeGroup.value = "30 days +" then

if (tc.cur30 >= 1 OR tc.cur30 <= -1) then
return (strYes)
else
return (strNo)
endif

PS: The tcursor here is passed to the function, so that it test every record from the main loop which uses the same Tcursor.
 
Richard,

Hm. I don't see why this would be happening.

I suspect that while this code may be surfacing the error, it's actually being caused by something else.

What's the context this code runs in? Is is a pushButton, a library method, or what? What triggers it?

Personally, I don't like using custom constants for this sort of this, especially when Paradox already provides logical constants for Yes and No.

First, save your form with Compiler Warnings and Compiled and Debug both checked (they're on the Program menu.)

It's possible you've not declared your variables and that you've accidentally saved the wrong value type to one of them, thus changing it from what you thought it was (a string) to something else (a different data type).

You might try reconstructing the routine to return a Logical, rather than a String.

Also, try reworking the response to something along these lines:

Code:
var
   loResult  Logical

   ; other stuff 
   loResult = ( ( tc.cur30 >= 1 ) OR ( tc.cur30 <= -1) )

Hope this helps...

-- Lance
 
Hey Lance, simply changing the return field from a string to a logical solved the problem. I did not know that paradox had a logical type, so only my own ignorance is to blame for the error.

Thanks a bunch and it just goes to show that you never stop learning!

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top