I have a text field. It has 'units' (either a single unit such as 1 or double like 12). I am just trying to extract the digits which i've accomplished BUT is there is a '.', text, and then a digit the formula dbl posts the digit. EX: . g 2 results in 22, .gggg4 results in 44. If it is .6 nu then the result is 6 so it is only when text is inbetween the period and the digit. Tried numerictext, tried replace. Why is this happening?
The replace:
local stringvar string := (replace({JOURNAL.SUBJECT}, ".", "p",1, -1, 1));
local stringvar str:= string;
local stringvar num;
local stringvar stringsave;
local numbervar strlen := len(str);
local numbervar i;
local numbervar x;
for i := 1 to strlen do
(
replace(str,".","p",i); // throw this in just to go one by one an change
if val(mid(str,i,strlen)) > 0 then
num :=(mid(str,i,strlen));
stringsave := stringsave & num;
x := val(stringsave);
);
x
the numeric text
local stringvar str := {JOURNAL.SUBJECT};
local stringvar num;
local stringvar stringsave;
local numbervar strlen := len(str);
local numbervar i;
local numbervar x;
for i := 1 to strlen do
(
if numerictext(mid(str,i,strlen)) then
num :=(mid(str,i,strlen));
stringsave := stringsave & num;
x := val(stringsave);
);
x