Hi, fellow programmers!
Many API functions, for instance registry functions, return zero on success. In other words: they return %FALSE while their effect is true. For example the following 3 calls are actually the same:
IF ApiFunc(params) <> %ERROR_SUCCESS
IF ApiFunc(params)
IF ISTRUE ApiFunc(params)
Your application has to exit a FUNCTION or SUB here, because of the fact the API call failed (although it returns a non-zero value). Especially the latter, explicitely using ISTRUE, sounds very odd. When a function returns true each normal person would think that the function was Okay. So not programmers. They are expected to know that true sometimes means false, vice versa.
In brief: what about 2 new functions in the next edition of PB compilers: ISAPIFALSE / ISAPITRUE, being the opposite of PB's normal ISFALSE / ISTRUE.
------------------
mailto:[email protected][email protected]</A>
www.basicguru.com/zijlema/
[This message has been edited by Egbert Zijlema (edited January 28, 2001).]
Many API functions, for instance registry functions, return zero on success. In other words: they return %FALSE while their effect is true. For example the following 3 calls are actually the same:
IF ApiFunc(params) <> %ERROR_SUCCESS
IF ApiFunc(params)
IF ISTRUE ApiFunc(params)
Your application has to exit a FUNCTION or SUB here, because of the fact the API call failed (although it returns a non-zero value). Especially the latter, explicitely using ISTRUE, sounds very odd. When a function returns true each normal person would think that the function was Okay. So not programmers. They are expected to know that true sometimes means false, vice versa.
In brief: what about 2 new functions in the next edition of PB compilers: ISAPIFALSE / ISAPITRUE, being the opposite of PB's normal ISFALSE / ISTRUE.
------------------
mailto:[email protected][email protected]</A>
www.basicguru.com/zijlema/
[This message has been edited by Egbert Zijlema (edited January 28, 2001).]
Comment