Home All Groups Group Topic Archive Search About

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

Author
2 Sep 2006 10:10 AM
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

Author
2 Sep 2006 10:53 AM
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

<karma***@gmail.com> schreef in bericht
Show quoteHide quote
news:1157191814.981056.49760@h48g2000cwc.googlegroups.com...
> 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
>
Author
2 Sep 2006 12:50 PM
karmalax@gmail.com
Please accept my apologies.
Thank you


Cor Ligthert [MVP] ha scritto:

Show quoteHide quote
> 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
s
> >
Author
2 Sep 2006 2:59 PM
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

Show quoteHide quote
>
>
> Cor Ligthert [MVP] ha scritto:
>
>> 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
> s
>> >
>
Author
3 Sep 2006 4:22 PM
_AnonCoward
Show quote Hide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:eg7HnAqzGHA.4920@TK2MSFTNGP06.phx.gbl...
: 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"
Author
3 Sep 2006 4:40 PM
Cor Ligthert [MVP]
Anon,

Thanx, so obvious.

:-)

Cor

Show quoteHide quote
"_AnonCoward" <abc***@uvwxyz.com> schreef in bericht
news:SiDKg.3206$Md4.2110@tornado.southeast.rr.com...
>
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:eg7HnAqzGHA.4920@TK2MSFTNGP06.phx.gbl...
> : 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"
>
>
>