473,769 Members | 7,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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(Str ings.Mid(T, num1, 1)) + (num3
- num1);

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

if (num2 == 0)

{

num2 = 1;

}

num3 = num2 + 5;

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

num5 = ((long) Math.Round((dou ble) (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(St rings.LTrim(Con version.Str(num 5)) +
"12345678", 8);

text1 = Strings.Right(t ext1, 4) + Strings.Left(te xt1, 4);

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

if (num1 < 0)

{

num1 += 9;

}

StringType.MidS tmtStr(ref text1, 1, 1,
Strings.Trim(Co nversion.Str(nu m1)));

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

if (num1 < 0)

{

num1 += 9;

}

StringType.MidS tmtStr(ref text1, 6, 1,
Strings.Trim(Co nversion.Str(nu m1)));

num1 = (int) Math.Round((dou ble) (9 -
Conversion.Val( Strings.Mid(tex t1, 2, 1))));

if (num1 < 0)

{

num1 += 9;

}

StringType.MidS tmtStr(ref text1, 4, 1,
Strings.Trim(Co nversion.Str(nu m1)));

num1 = (int) Math.Round((dou ble) (7 -
Conversion.Val( Strings.Mid(tex t1, 3, 1))));

if (num1 < 0)

{

num1 += 9;

}

StringType.MidS tmtStr(ref text1, 8, 1,
Strings.Trim(Co nversion.Str(nu m1)));

num1 = (int) Math.Round((dou ble) (5 -
Conversion.Val( Strings.Mid(tex t1, 5, 1))));

if (num1 < 0)

{

num1 += 9;

}

StringType.MidS tmtStr(ref text1, 7, 1,
Strings.Trim(Co nversion.Str(nu m1)));

return text1;

}

Thanks

Sep 2 '06 #1
5 1306
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.publi c.VB.generaldis cussions

I hope you have success

Cor

<ka******@gmail .comschreef in bericht
news:11******** *************@h 48g2000cwc.goog legroups.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(Str ings.Mid(T, num1, 1)) + (num3
- num1);

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

if (num2 == 0)

{

num2 = 1;

}

num3 = num2 + 5;

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

num5 = ((long) Math.Round((dou ble) (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(St rings.LTrim(Con version.Str(num 5)) +
"12345678", 8);

text1 = Strings.Right(t ext1, 4) + Strings.Left(te xt1, 4);

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

if (num1 < 0)

{

num1 += 9;

}

StringType.MidS tmtStr(ref text1, 1, 1,
Strings.Trim(Co nversion.Str(nu m1)));

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

if (num1 < 0)

{

num1 += 9;

}

StringType.MidS tmtStr(ref text1, 6, 1,
Strings.Trim(Co nversion.Str(nu m1)));

num1 = (int) Math.Round((dou ble) (9 -
Conversion.Val( Strings.Mid(tex t1, 2, 1))));

if (num1 < 0)

{

num1 += 9;

}

StringType.MidS tmtStr(ref text1, 4, 1,
Strings.Trim(Co nversion.Str(nu m1)));

num1 = (int) Math.Round((dou ble) (7 -
Conversion.Val( Strings.Mid(tex t1, 3, 1))));

if (num1 < 0)

{

num1 += 9;

}

StringType.MidS tmtStr(ref text1, 8, 1,
Strings.Trim(Co nversion.Str(nu m1)));

num1 = (int) Math.Round((dou ble) (5 -
Conversion.Val( Strings.Mid(tex t1, 5, 1))));

if (num1 < 0)

{

num1 += 9;

}

StringType.MidS tmtStr(ref text1, 7, 1,
Strings.Trim(Co nversion.Str(nu m1)));

return text1;

}

Thanks

Sep 2 '06 #2
Please accept my apologies.
Thank you
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.publi c.VB.generaldis cussions

I hope you have success

Cor
s
Sep 2 '06 #3
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
>

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.publ ic.VB.generaldi scussions

I hope you have success

Cor
s
>

Sep 2 '06 #4

"Cor Ligthert [MVP]" <no************ @planet.nlwrote in message
news:eg******** ******@TK2MSFTN GP06.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"

Sep 3 '06 #5
Anon,

Thanx, so obvious.

:-)

Cor

"_AnonCowar d" <ab****@uvwxyz. comschreef in bericht
news:Si******** *********@torna do.southeast.rr .com...
>
"Cor Ligthert [MVP]" <no************ @planet.nlwrote in message
news:eg******** ******@TK2MSFTN GP06.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"

Sep 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4963
by: Pascal | last post by:
Why does this not work, and how should i do this convert in stead: string x = double.MinValue.ToString(); double y = Convert.ToDouble(x); i get this exception: An unhandled exception of type 'System.OverflowException' occurred in mscorlib.dll Additional information: Value was either too large or too small for a Double. Pascal
17
4377
by: David Scemama | last post by:
Hi, I'm writing a program using VB.NET that needs to communicate with a DOS Pascal program than cannot be modified. The communication channel is through some file databases, and I have a huge problem writing VB Double values to the file so as the Pascal program can read them as Pascal Real values. I've managed to find the algorithm to read the Pascal Real format and convert it to a VB Double, but I cannot figure out the opposite...
23
9521
by: comp.lang.tcl | last post by:
I have a TCL proc that needs to convert what might be a list into a string to read consider this: ]; # OUTPUTS Hello World which is fine for PHP ]; # OUTPUT {{-Hello}} World, which PHP will print literally as {{-Hello}} World, instead of
6
3827
by: pamela fluente | last post by:
Hi, please find below a very simple code snippet which is giving me the following error: System.Runtime.Serialization.SerializationException was unhandled Message="The constructor to deserialize an object of type 'WindowsApplication10.Form1+DictionaryExt`2' was not found." Source="mscorlib" You can just past the snippet on any form with a button.
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10048
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.