Marc,

I can't easily see your problem.  The code fragment you have here will
certainly lock the hLine2 symbol twice (the DupSymb_DB function places a
READWRITE lock on the symbol automatically, which is why the splitline GX
turns it off).

You should call ShowError_GEO to display the Geosoft error message (or
GetError_GEO to get the error message string.  If this does not make the
problem clear, let me know.

Ian
______________
Geosoft Inc.
Ian MacLeod
[EMAIL PROTECTED]
(416) 369 0111 x323

Geosoft: Making the Digital Earth Work for You
http://www.geosoft.com


-----Original Message-----
From: Marc Pelletier [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 17, 2000 6:38 PM
To: [EMAIL PROTECTED]
Subject: [gxnet]: SplitLine_DU 


Hello,

Has anyone successfully used the above function?

I'm having a hell of a time of it. The following code is from a Delphi
program, but I'm sure it's easy enough to follow...

     hLine2 := DupSymb_DB(hGeo,hData,hLine,sLine2);
     if (iCheckError_SYS(hGeo) = 1) then raise Exception.create('Problem 
             creating line2 symbol');
     LockSymb_DB(hGeo,hData,hLine2,DB_LOCK_READWRITE,
             DB_WAIT_INFINITY);
     if (iCheckError_SYS(hGeo) = 1) then raise Exception.create
              ('Problem locking line2');
     if (iIsLineValid_DB(hGeo,hData,hLine) = 1) AND 
            (iIsLineValid_DB(hGeo,hData,hLine2)= 1) then
     SplitLine_DU(hGeo,hData,hLine,hLine2,rFid);
     if (iCheckError_SYS(hGeo) = 1) then raise Exception.create
            ('Problem splitting line2 ');
     UnLockSymb_DB(hGeo,hData,hLine2);
     if (iCheckError_SYS(hGeo) = 1) then raise Exception.create('Problem
unlocking line2');

This code ALWAYS raises the "Problem splitting line 2" exception. The line
referred to by hLine is locked elsewhere, and the value of rFid is valid.

For reference, the following code (reformatted a bit for brevity) is from
the Spltline.gx, 

    InLn = FindSymb_DB(Data,sInLn,DB_SYMB_LINE);
    // --- Does the Ouput Line Exist ? ---
    if (!iExistSymb_DB(Data,sOutLn,DB_SYMB_LINE)) {
       OutLn = DupSymb_DB(Data,InLn,sOutLn);
       UnLockSymb_DB(Data,OutLn);
    }
    else 
       OutLn = FindSymb_DB(Data,sOutLn,DB_SYMB_LINE);
    // --- Lock the Line symbols ---
    if (InLn == OutLn) Abort_SYS("Input and Output lines cannot be the
same");
    LockSymb_DB(Data,InLn,DB_LOCK_READWRITE,DB_WAIT_INFINITY);
   LockSymb_DB(Data,OutLn,DB_LOCK_READWRITE,DB_WAIT_INFINITY);
    SplitLine_DU(Data,InLn,OutLn,rFid);

One noteable difference is that InLn isn't locked when the line is duped,
and OutLn is unlocked then locked, but I've tried every locking/unlocking
combination and that didn't help. Other than that I can't see anything
different that I'm doing.

Any help or insight gratefully received..

Marc Pelletier

---------------------------------------------------------------------------
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
_______________________________________________________
More mailing list info http://www.geosoft.com/support/listserv/index.html

Reply via email to