WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

IsInt with Trailing Spaces


Question:

I am having a problem with integers that have a trailing space.
aint = ' 123'
baint = '123 '
if isint(aint) then message('aint is', aint)
if isint(baint) then message('baint is', baint)
else message('but baint', 'isn''t')

Answer:

Leading spaces are accepted. Trailing ones are not. The "C" conversion routines work the same way. In my case I do a StrTrim on the numbers if I suspect leading or trailing spaces.
Article ID:   W16974
File Created: 2007:07:03:14:27:26
Last Updated: 2007:07:03:14:27:26