At 08:50 AM 05 19, 2000 -0400, you wrote:
>You should call ShowError_GEO to display the Geosoft error message

Doh! I had a ShowError message in the exception handling block but I was ussually 
aborting before execution got to it!

So I created a procedure like this:
procedure CheckGeoError(hGeo: Integer; sMessage: string);
begin
   if (iCheckError_SYS(hGeo) = 1) then begin
     App_ShowError_SYS(hGeo);
     raise Exception.create(sMessage);
   end;
end;

and inserted it everywhere in my code. This is where things get really confusing,  so 
I've numbered the relevant lines in my code:
1    UnLockSymb_DB(hGeo,hData,hLine);
     CheckGeoError(hGeo,'Problem unlocking line before dup');
2   hLine2 := DupSymb_DB(hGeo,hData,hLine,sLine2);
     CheckGeoError(hGeo,'Problem creating line2 symbol');
3    UnLockSymb_DB(hGeo,hData,hLine2);
     CheckGeoError(hGeo,'Problem unlocking line2');
4   UnLockSymb_DB(hGeo,hData,hLine);
     CheckGeoError(hGeo,'Problem unlocking line');
5    LockSymb_DB(hGeo,hData,hLine,DB_LOCK_READWRITE, DB_WAIT_INFINITY);
     CheckGeoError(hGeo,'Problem locking line before splitting');
6    LockSymb_DB(hGeo,hData,hLine2,DB_LOCK_READWRITE, DB_WAIT_INFINITY);
     CheckGeoError(hGeo,'Problem locking line2 before splitting');
     if (iIsLineValid_DB(hGeo,hData,hLine) = 1) AND 
(iIsLineValid_DB(hGeo,hData,hLine2)= 1) then
7      SplitLine_DU(hGeo,hData,hLine,hLine2,rFid);
     CheckGeoError(hGeo,'Problem splitting line2 ');

I added an UnLock before the DupSymb because I noticed that it was unlocked in 
SpltLine. Now, this code triggers an exception at 4. The Geosoft message is  
"UnLockSymb_DB", which would seem to indicate that DupSymb doesn't lock the line being 
duplicated. So I commented out 4 and now I get an "Attempt to lock channel failed 
because you already have a conflicting lock", followed by an 
SCheckTerminate_GXX(21023) dialog with a "SplitLine_DU: run stopped.." error message 
being triggered at line 7!!.

This seems to say that either SplitLine_DU is locking a channel and the locks aren't 
necessary, or one of the locks is throwing an error which iCheckError_SYS isn't 
picking up. In either case the solution should be to remove the offending lock. 
However. removing either lock (5 or 6) results in a "SpltLine_DU: Invalid or 
unwritable line handle" message at 7.

To eliminate any effect from other actions in the program I commented out everything 
between the original lock on the line and the above code and line 4, which seems to be 
redundant. I still got the "Attemp to lock channel failed..." error message. All that 
remains above the commented code is the usual boilerplate, setting and getting 
parameters, running a dialog, and locking the input channels.

One last note, commenting out line 1 results in the Attempt to lock channel error 
message being thrown by SpltLine_DU, so the DupSymb function seems to be immune to a 
lock on in the input line.

Sorry for the long message, it certainly hasn't illuminated me!

Marc



---------------------------------------------------------------------------
Data Donkey - Geophysical Data Processing, Consulting and Software Development
                Creator of the POWER TOOLBOX utilities for OASIS montaj
contact: mailto:[EMAIL PROTECTED]  tel (306) 931-6853 or http://www.datadonkey.com

_______________________________________________________
More mailing list info http://www.geosoft.com/support/listserv/index.html

Reply via email to