Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strip Numbers and Decimal Points

Status
Not open for further replies.

AZCrystal

MIS
May 23, 2002
3
US
Thanks in advance for any help you can provide.

I have a field ({amModel.Name}) that contains software and versions...i.e. Adobe Acrobat 5.0.5.

I need to strip out the version, in other words, the numbers and decimal points.

I am able to strip out the numbers with the code below (provided by our venerable lbass...thank you!)

numbervar i;
numbervar j := len({amModel.Name});
stringvar x := "";

for i := 1 to j do(
if isnumeric({amModel.Name}) then
x := x else
x := x + {amModel.Name});
x;

The problem is stripping out the decimal points. Have tried several ways but can't seem to get it.

 
The isnumeric piece eliminates the numbers, but you have to add an additional test to see if that character is a decimal:


for i := 1 to j
do(if isnumeric({amModel.Name}) or {amModel.Name = "."
then
x := x
else
x := x + {amModel.Name});
x;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top