Align baselines of 2 fields

Niggemann, Bernd Bernd.Niggemann at uni-wh.de
Fri Jun 22 14:01:32 EDT 2018


Hi Bob,

how about:

....
if pOffset is empty then put 0 into pOffset
----------------------
if pOffset is not strictly an integer then put pOffset div 1 into pOffset  -- <-----
----------------------
catch theError
....

if pOffset is an integer nothing happens, if it is a floating point number div will turn it into an integer, if it is a string then it will throw an error.

Kind regards
Bernd


Actually that made me think, someone might try to pass a floating point number, so put pOffset div 1 into pOffset is a better test because it will convert pOffset to an integer.

Bob S


On Jun 21, 2018, at 14:18 , Bob Sneidar via use-livecode <use-livecode at lists.runrev.com<mailto:use-livecode at lists.runrev.com>> wrote:

But that won't throw an error in my try catch statement. :-)

Bob S


On Jun 21, 2018, at 13:23 , J. Landman Gay via use-livecode <use-livecode at lists.runrev.com<mailto:use-livecode at lists.runrev.com>> wrote:

On 6/21/18 2:58 PM, Bob Sneidar via use-livecode wrote:
Also, I check that pOffset is a number by adding 0 to it in a try/catch statement.

Or alternately, "if pOffset is a number..."



More information about the use-livecode mailing list