Question Is There Any Function To Identify Whole Number, Field Name And Data Type In Progress4gl?

Actually i am trying to identify Whole number (i.e) 15312 , 1, 1321324, 454 (may be one\more number of digits ) So is any function for Whole number ?
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
Actually i am trying to identify Whole number (i.e) 15312 , 1, 1321324, 454 (may be one\more number of digits )
I assume you're looking for whole numbers in decimals. Try this:
Code:
function isWhole returns logical (p-dec as decimal):

  return (p-dec >=0 and p-dec = truncate( p-dec, 0 ) ).

end function.

display
  isWhole( 3.5 ) /* no  */
  isWhole( 4 )   /* yes */
  isWhole( -1 )  /* no  */
  isWhole( 0 )   /* yes */
.

┌───────────────┐
│no  yes no  yes│
└───────────────┘
 
Top