M
mesutalturk
How do i convert the following C# code to Delphi?
public static uint GenerateSiteID(string SiteName)
{
uint id = 0;
char[] arr = SiteName.ToCharArray(); //Convert the sitename to a Char
Array
for (int i = 0; i < arr.Length; i++)
{
char c = arr;
int intc = c;
int upper = intc & '\x00df'; //Upper case the letter
id = (uint)(id * 101) + (uint)upper;
}
return (id % Int32.MaxValue) + 1; //do a MOD and add 1
}
Thanks for your help!
public static uint GenerateSiteID(string SiteName)
{
uint id = 0;
char[] arr = SiteName.ToCharArray(); //Convert the sitename to a Char
Array
for (int i = 0; i < arr.Length; i++)
{
char c = arr;
int intc = c;
int upper = intc & '\x00df'; //Upper case the letter
id = (uint)(id * 101) + (uint)upper;
}
return (id % Int32.MaxValue) + 1; //do a MOD and add 1
}
Thanks for your help!