George:
 
I should have noted one other thing...
 
If it is absolutely necessary to create a VV (or more likely a VA, which can have different numbers of columns in your case), you can do this, but be sure to call the corresponding Destroy_ function:
 
hLine = FirstSelLine_DB(hDB);
while (iIsLineValid_DB(hDB,hLine))
{
    .....  (other code).
 
      hVA = Create_VV( REAL ,  iCol, 0);    // create VA object inside the loop, variable number of columns
   ...... (other code)
      
      Destroy_VA(hVA);                            // destroy VA
 
  // --- Advance to Next hLine ---        
  hLine = NextSelLine_DB( hDB , hLine );
}
Stephen
-----Original Message-----
From: Stephen Cheesman [mailto:[EMAIL PROTECTED]]
Sent: December 21, 2001 10:47 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [gxnet]: Trend2_VVU

George.
 
Thank-you for the code. I'm answering this in GXNET because the answer is useful to many programmers.
 
I don't know if this will solve your problem, but it may, and it's something I found recently in one of our own GXs.
 
The following construction was present:
 
 
hLine = FirstSelLine_DB(hDB);
while (iIsLineValid_DB(hDB,hLine))
{
    .....  (other code).
 
      hVV = Create_VV( REAL ,  0);    // create object inside the loop
   ...... (other code)
 
  // --- Advance to Next hLine ---        
  hLine = NextSelLine_DB( hDB , hLine );
}
The problem is that the object is re-created over and over again for each new line. While the GX compiler is set up to keep track of each object as it is made, and automatically destroys them afterward, hopefully preventing what is known as a "memory leak", this certainly stresses the system, especially if there are a lot of objects and a lot of lines.
 
It is (much) preferred to use the following construction:
 
hVV = Create_VV( REAL ,  0);        // create outside the loop
 
hLine = FirstSelLine_DB(hDB);
while (iIsLineValid_DB(hDB,hLine))
{
   ...... (other code)
 
  // --- Advance to Next hLine ---        
  hLine = NextSelLine_DB( hDB , hLine );
}

Try it with these changes and let me know if it works (privately).
 
Stephen
 

_______________
Geosoft Inc.
Stephen Cheesman
[EMAIL PROTECTED]
(905) 315-8207

Software and services for effective earth science decision-making.
Free Oasis montaj interface now available at http://www.geosoft.com
 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: December 20, 2001 9:39 PM
To: [EMAIL PROTECTED]
Subject: [gxnet]: Trend2_VVU

Has anyone had success using the function Trend_VVU?

 

It returns an error for me complaining of an invalid handle for the "X" VV.

 

It is not called in any of the source files in GX Developer so I can not find another example of its use.

 

I am sure that the VV I am passing to it is valid.

 

I am not sure that the VV I am passing to it is what it expects.  I know the handle is valid but it may not contain acceptable data.

 

VVU.gxh says the VV should have "X spacing" but I am passing a VV with "X values."

 

I'm curious if anyone has ever used this function or if it might have a bug.

 

Regards,

 

David George

970 263 9714

 

Reply via email to