Convert text to number (OpenInsight 32-bit Specific)
At 17 OCT 2005 12:00:52PM Marty Rosenbloom wrote:
Hi,
I have an edit table that I input time into and set it up as "MTH". I am using a symbolic to capture and convert the time to a decimal. The end result should be a truncated number. When I use Int() I get the error message "non-numeric data when numeric required- zero used."
This is a snippet of code that I am using:
Constant1=Str(36:@vm,count({TIME_IN},@vm) + 1)
Constant2=Str(100:@vm,count({TIME_IN},@vm) + 1)
A={TIME_IN}
*A=IConv(A, "MTH")
A=A / Constant1 A=A *** Constant2 A=OConv(A, "MD0") A=Int(A) Everything works as I expect, but the Int() causes an error. Any help is appreciated. TIA, Marty </QUOTE> —- === At 17 OCT 2005 12:04PM Matt Sorrell wrote: === <QUOTE>Marty, Have you verified that your final Oconv is returning valid data? If it is returning a Null that might make the Int() call choke. [email protected] Greyhound Lines, Inc. </QUOTE> —- === At 17 OCT 2005 12:39PM The Sprezzatura Group wrote: === <QUOTE>More likely that INT is not MV aware The Sprezzatura Group World leaders in all things RevSoft
</QUOTE> —- === At 17 OCT 2005 01:21PM Marty Rosenbloom wrote: === <QUOTE>Hi Matt, The numbers appear properly when the Int() is remmed out. The addition of the Int() causes the error. Marty </QUOTE> —- === At 17 OCT 2005 01:24PM Marty Rosenbloom wrote: === <QUOTE>If that is the case, how can I truncate the results? Marty </QUOTE> —- === At 17 OCT 2005 01:28PM The Sprezzatura Group wrote: === <QUOTE>Perform a loop INTing each value? The Sprezzatura Group World leaders in all things RevSoft
</QUOTE> —- === At 17 OCT 2005 01:38PM Richard Hunt wrote: === <QUOTE>You simply INT() the results one value at a time. RESULT=' VALUE=0 POS=0 MORE=(NUMBERS NE '') LOOP WHILE MORE REMOVE NUMBER FROM NUMBERS AT POS SETTING MORE VALUE += 1 RESULT=INT(NUMBER) REPEAT </QUOTE> View this thread on the forum...