Val() Method



|Visual FoxPro Toolkit for .NET | |

Val() Method

Receives a string and converts it to an integer

[pic]

[Visual Basic]

Public Shared Function Val(ByVal cExpression As String) As Integer

[C#]

public static int Val(string cExpression)

Example

[Visual Basic]

Val("1325") 'returns 1325

[C#]

VFPToolkit.strings.Val("1325"); //returns 1325

Implementation

[Visual Basic]

Public Shared Function Val(ByVal cExpression As String) As Integer

'Remove all the spaces and commas from the string

'Get the integer portion of the string

Return Int32.Parse(cExpression, NumberStyles.Any)

End Function

[C#]

public static int Val(string cExpression)

{

//Remove all the spaces and commas from the string

//Get the integer portion of the string

return Int32.Parse(cExpression, NumberStyles.Any);

}

Requirements

Namespace: VFPToolkit

Class: VFPToolkit.strings

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

Assembly: VFPToolkit (in VFPToolkitNET.dll)

See Also

VFPToolkit.strings Members | VFPToolkit Namespace

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download