Free since 2005 · No login required
AT

Academic Tutorials

Learn at your own pace

site-mobile-top-banner · 320x50

How do I convert a string to a number?

n Turbo/Borland Pascal, you can use the standard Val() procedure. The first argument is a string, and the second argument is a numeric variable which will be set to the numeric value represented by the string. The result variable can be any of the numeric types - from byte or ShortInt to comp or extended - the compiler will automagically pass the variable's type to the Val() procedure.