//TH-Header //***************************************************************************************** // Copyright (c) 2014 KURANT Project // All rights reserved. // // $FileName : cSystemStrUtils // $ProjectName : The Hammer 2.0 // $Authors : wil // $Created : 02.14.2014 15:07 // $Type : LGPL // // Contents: // System string utilities // //***************************************************************************************** //TH-RevisionStart //TH-RevisionEnd Use VdfBase.pkg Use WinUser.pkg Use GlobalFunctionsProcedures.pkg Class cSystemStrUtils is a DfObject Procedure Construct_Object Forward Send Construct_Object End_Procedure // Convert Ansi Name to OEM Name Function AnsiNametoOemName String sName Returns String String szName Pointer pszName Integer iVoid Move (sName + Character(0)) To szName GetAddress Of szName To pszName Move (AnsiToOem(pszName, pszName)) To iVoid Function_Return (CString(szName)) End_Function // Tests if the string passed is numeric or not. // A string of zero length is considered numeric. Function IsNumeric String sData Returns Boolean Boolean bIsNumeric Integer iLength iPos Move (Trim (sData)) To sData Move (Length (sData)) To iLength Move (True) To bIsNumeric For iPos From 1 To iLength If (("+-0123456789.," Contains Mid (sData, 1, iPos)) = False) Begin Move (False) To bIsNumeric End Loop Function_Return bIsNumeric End_Function // IsNumeric End_Class // cSystemStrUtils