Welcome! Log In Create A New Profile

Advanced

Coding Question

Posted by David Egan 
David Egan
Coding Question
December 28, 2008 10:19AM
Hi
Can anyone tell me what is wrong with the following?
IF gi_Grandparent <> 0 THEN
	gi_Parent = gi_Grandparent
	gi_Grandparent = 0
	InitialiseButtons()
ELSE IF gi_Parent <> 0 THEN
	gi_Grandparent = 0
	gi_Parent = 0
	InitialiseButtons()
ELSE 
	IF TableCount(Table1) = 0 THEN
		Close(MyWindow,"")
	ELSE
		Error("Current Transaction must be completed first")
	END
END
ReturnToCapture(ctl_item)
When I run this, it always runs the last ELSE code,after running the correct code. For example if gi_parent = 3 it runs that section but then also runs the "IF TableCount etc" Running it through the debugger it works correctly so I thought maybe a delay might help but that didn't solve it. I originally had them as 3 separate IF statements with a ReturnToCapture at the end of each one but when that didn't work I tried the above. I've removed the call to InitialiseButtons in case I had something happening there and I've tried deleting the CPL folder and recompiling but still get the same issue.

Thanks

David



Edited 1 time(s). Last edit at 12/28/2008 11:29AM by David Egan.
David Egan
Re: Coding Question - SOLVED
December 28, 2008 12:02PM
Problem solved. The procedure was getting called twice as I had an event set on the group to which the control belongs.

David
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: