Please, can anyone convert the following dot net snippet to pascal

K

karmalax

public static string Somme(string T)

{

string text1 = "";

double num5 = Strings.Len(T) + 1;

int num3 = 7;

int num6 = Strings.Len(T);

int num1 = 1;

while (num1 <= num6)

{

double num4 = Strings.Asc(Strings.Mid(T, num1, 1)) + (num3
- num1);

int num2 = (int) Math.Round((double) ((num4 % 10) + 1));

if (num2 == 0)

{

num2 = 1;

}

num3 = num2 + 5;

num4 = ((long) Math.Round((double) (num4 * num2))) /
((long) (num2 * 2));

num5 = ((long) Math.Round((double) (num5 * num4))) /
((long) num2);

if (num4 < 1)

{

num4 = 4;

}

if (num5 > 900000)

{

num5 = ((long) Math.Round(num5)) / ((long)
Math.Round(num4));

}

num1++;

}

text1 = Strings.Left(Strings.LTrim(Conversion.Str(num5)) +
"12345678", 8);

text1 = Strings.Right(text1, 4) + Strings.Left(text1, 4);

num1 = (int) Math.Round((double) (8 -
Conversion.Val(Strings.Mid(T, 1, 1))));

if (num1 < 0)

{

num1 += 9;

}

StringType.MidStmtStr(ref text1, 1, 1,
Strings.Trim(Conversion.Str(num1)));

num1 = (int) Math.Round((double) (5 -
Conversion.Val(Strings.Mid(T, 6, 1))));

if (num1 < 0)

{

num1 += 9;

}

StringType.MidStmtStr(ref text1, 6, 1,
Strings.Trim(Conversion.Str(num1)));

num1 = (int) Math.Round((double) (9 -
Conversion.Val(Strings.Mid(text1, 2, 1))));

if (num1 < 0)

{

num1 += 9;

}

StringType.MidStmtStr(ref text1, 4, 1,
Strings.Trim(Conversion.Str(num1)));

num1 = (int) Math.Round((double) (7 -
Conversion.Val(Strings.Mid(text1, 3, 1))));

if (num1 < 0)

{

num1 += 9;

}

StringType.MidStmtStr(ref text1, 8, 1,
Strings.Trim(Conversion.Str(num1)));

num1 = (int) Math.Round((double) (5 -
Conversion.Val(Strings.Mid(text1, 5, 1))));

if (num1 < 0)

{

num1 += 9;

}

StringType.MidStmtStr(ref text1, 7, 1,
Strings.Trim(Conversion.Str(num1)));

return text1;

}



Thanks
 
C

Cor Ligthert [MVP]

Karmalax,

You have sent this completely to the wrong newsgroup.

Although it are also not the right ones can you have a change in a VBS
newsgroup or a VB classic one as

microsoft.public.VB.generaldiscussions

I hope you have success

Cor
 
C

Cor Ligthert [MVP]

Karmalax,
Please accept my apologies.
Thank you

Not any need for, it was just to help you to find your solution, which
should not be given here because of your question. It is like to go to a
grocery shop to change a million Dollars to Euros.

It can be done, however in my country the grocery guy can wait that he be
arrested because he probably is helping whitewashing. I don't know the name
in English for that.

Cor
 
A

_AnonCoward

: Karmalax,
:
: > Please accept my apologies.
: > Thank you
:
: Not any need for, it was just to help you to find your solution, which
: should not be given here because of your question. It is like to go to
: a grocery shop to change a million Dollars to Euros.
:
: It can be done, however in my country the grocery guy can wait that he be
: arrested because he probably is helping whitewashing. I don't know the
: name in English for that.


"Money Laundering"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top