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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assertion Failed 2

Status
Not open for further replies.

rleiman

Programmer
May 3, 2006
258
US
Hi.

I get an "Assertion Faild on line 501 in the file" error when using Get (file, key) as well as using Set (file, pointer) and Next (file).

Can you tell me how to get rid of this error?

Thanks.

Emad
 
Hi Everyone,

OOOPS!!!!!!

Never mind this post because I forgot to tell the procedure about the tables! There were no tables defined in the tables section.

Silly me.

Emad
 
Hi Emad,

Anyway, the reason for a Assertion Error is because you have compiled in Full Debug Mode. In release mode, the Assertion errors will not be displayed.

And you are still using POINTER() with Topspeed which will land you into problems. You need to use POSITION() instead.

Regards
 
Hi ShankarJ,

I have been using Set (filename, 1)followed by Next (filename).

Truly,
Emad
 
Hi Emad,

There is NO benefit to SET(FileName,1) as compared to SET(FileName).

Regards
 
Hi ShankarJ,

Thank. I will chop off the pointer part.

Would Get (filename) work as well?

Thanks.

Emad
 
Hi Emad,

What I trying to tell you is that POINTER() does not work properly with TOPSPEED tables whereas it works ok with the CLARION tables i.e. it is driver specific. So, if you are using TPS, avoid using Pointers. Use the POSITION() instead.
GET(File, Key) is the optimal way of using GET(). For single record tables use SET(File) ; NEXT(File).

Regards
 
Hi ShankarJ,

Thanks for the help.

Truly,
Emad
 
ShankarJ said " Anyway, the reason for a Assertion Error is because you have compiled in Full Debug Mode. In release mode, the Assertion errors will not be displayed"

This is _largely_ true, it will work in ANY level of debug mode, and can ALSO have ASSERT()'s displayed when the pragma asserts=>on is set.

Note: even when ASSERTS are not being displayed the code in them is still executing, hence:

ASSERT( LogicalFunction(), StringFunction() )

Will in fact run both of those procedures even if the ASSERT is not displayed.

Also note that you can hook asserts see ASSERTHOOK and ASSERTHOOK2 these are the procedures that are called when you have compiled in debug or with asserts=>on AND the logical expression is FALSE.

Also that pragmas ARE CASE SENSITIVE, so do NOT use ASSERTS=>on or Asserts=>on you MUST use asserts=>on to get the change in behaviour.

Further note (if I recall correctly) that asserts=>on works in C50 and greater even through it was not documented until later.

-- Mark Goldberg
 
Hi Mark,

Thanks for the information.

Truly,
Emad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top