Log In    |    Knowledge Base    |    4D Home
Tech Tip: Retrieving numbers from a string
PRODUCT: 4D | VERSION: 2004.4 | PLATFORM: Mac & Win
Published On: September 15, 2006

You can retrieve the numerical form of the numerical characters in a string using the NUM command. If the string are all alphabetic characters, the said command returns 0. For instance, if you want to retrieve the number in a product ID string "ABC123", the Num command, as shown in the code below, ignores the alphabetic characters and transforms the numeric characters to its numeric form returning number 123:
vResult := Num ("ABC123")