Hello,
There are the C# codes£¬but i know a little about C#, i want to convert to
VB.NET, i have try the
url( http://authors.aspalliance.com/aldot...ranslate.aspx), but
the converted codes will not work. Thank you!
char[] Source = new char[15]
int n, hi, low, v;
do
{
low = Source[n]; // I use Microsoft.VisualBasic.Val(Source(n)) in
vb.net
v = hi << 8; // << what meaning?
v |= low; // |= what meaning?
Source[n] = (char)(v % 24); // % is Mod?
Source[n] = (char)(v / 24);
hi =v % 24;
}while((--n) >= 0); // --n>=0 what meaning£¿ 4 1165
"yxq" <ga***@163.net> wrote in message
news:Oq**************@TK2MSFTNGP10.phx.gbl... Hello, There are the C# codes£¬but i know a little about C#, i want to convert to VB.NET, i have try the url(http://authors.aspalliance.com/aldot...ranslate.aspx), but the converted codes will not work. Thank you!
char[] Source = new char[15] int n, hi, low, v;
do { low = Source[n]; // I use Microsoft.VisualBasic.Val(Source(n)) in vb.net v = hi << 8; // << what meaning? v |= low; // |= what meaning?
Source[n] = (char)(v % 24); // % is Mod? Source[n] = (char)(v / 24); hi =v % 24; }while((--n) >= 0); // --n>=0 what meaning£¿
do
{
low = Source[n]; // I use Microsoft.VisualBasic.Val(Source(n)) in vb.net
v = hi << 8; // << what meaning?
// Shift the bits in variable hi left 8
v |= low; // |= what meaning?
// perform bitwise OR on v and low, assign the result to v
Source[n] = (char)(v % 24); // % is Mod?
// Yes, % is the C# modulus operator
Source[n] = (char)(v / 24);
hi =v % 24;
}while((--n) >= 0); // --n>=0 what meaning£¿
// -- before the operand is the prefix decrement operator.
// If subtracts 1 from n before testing to see if n is >= 0
--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
On Tue, 9 Nov 2004 21:49:30 +0800, yxq wrote: v = hi << 8; // << what meaning?
That is the Shift Left operator and it is the same in VB.Net 2003
v |= low; // |= what meaning?
This is the bitwise Or operator. In VB.Net 2003, the code would be
v = v Or low
Source[n] = (char)(v % 24); // % is Mod?
Yes
}while((--n) >= 0); // --n>=0 what meaning£¿
The (--n) means to decrement n BEFORE checking the condition in the while
loop. This is the equivalent VB code:
do
'Other code here
n = n - 1
loop while n >= 0
--
Chris
dunawayc[AT]sbcglobal_lunchmeat_[DOT]net
To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Thank you, my converted codes are below, but dont work yet!!!!!
************************************
Do
low = Microsoft.VisualBasic.Val(Source(n))
v = hi < 8
v = v Or low
Source(n) = (CChar(CStr(v Mod 24)))
Source(n) = CChar(CStr(v / 24))
hi = v Mod 24
n = n - 1
Loop While n >= 0
******************************************
"Chris Dunaway" <"dunawayc[[at]_lunchmeat_sbcglobal[dot]]net">
??????:pq*****************************@40tude.net. .. On Tue, 9 Nov 2004 21:49:30 +0800, yxq wrote:
v = hi << 8; // << what meaning?
That is the Shift Left operator and it is the same in VB.Net 2003
v |= low; // |= what meaning?
This is the bitwise Or operator. In VB.Net 2003, the code would be
v = v Or low
Source[n] = (char)(v % 24); // % is Mod?
Yes
}while((--n) >= 0); // --n>=0 what meaning£¿
The (--n) means to decrement n BEFORE checking the condition in the while loop. This is the equivalent VB code:
do
'Other code here
n = n - 1 loop while n >= 0
-- Chris
dunawayc[AT]sbcglobal_lunchmeat_[DOT]net
To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and replace certain words in my E-Mail address.
On Wed, 10 Nov 2004 08:36:15 +0800, YXQ wrote: Do low = Microsoft.VisualBasic.Val(Source(n))
I don't think this line is right. You might try CInt(Source(n))
v = hi < 8
I think this should be v = hi << 8
v = v Or low Source(n) = (CChar(CStr(v Mod 24))) Source(n) = CChar(CStr(v / 24)) hi = v Mod 24 n = n - 1 Loop While n >= 0 ******************************************
What is this code supposed to do?
--
Chris
dunawayc[AT]sbcglobal_lunchmeat_[DOT]net
To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jim Langston |
last post by:
I understand the rule of three, that if I have a custom constructor, copy or
destructor I probably need the other 2. My class object definately has a
custom constructor and destructor, but I'm...
|
by: slaterjas |
last post by:
We are running DB2 version 8.1.5. When we execute a query within SQL
Assist we are only returned 200 rows. Is there a setting that we can
change to increase this?? I can get more results if I...
|
by: Daniel Billingsley |
last post by:
Speaking of trying to read deeply nested if-else blocks...
I often find it's not always easy to tell one indent level from another
(granted I keep my tab settings low so I'm not halfway across...
|
by: MLH |
last post by:
I use A97 and do not always insert line numbers while
writing procedures. I find it necessary to go back and
add them later to aid in debugging.
Nearly 3 years ago, something was mentioned in...
|
by: Marcin Balcerzak |
last post by:
Hi,
Not being an expert in Java (JRE 1.5) or Eclipse (3.1.1) I've encountered an
intractable problems. Without apparent reason my Eclipse stopped:
1) Providing me content assist (shows "No...
|
by: Chris |
last post by:
Hi,
I am working on a small which involves a touchscreen and I need to create a
on-screen keyboard. I need some assistance with a few questions
1. For the the buttons, do I user their text as...
|
by: donovans |
last post by:
Hey there,
First question:
I really need help with debugging this code. I keep getting the java.sql.SQLException: General error, and am now lost at a solution to it...I get this with about 4 of...
|
by: jasone |
last post by:
Hi all,
im nearly there with this one and im sure it shouldnt be hard to solve, i just cant seem to find the solution.
ive got records being displayed, the user can then tick what records to...
|
by: Frank Swarbrick |
last post by:
We're trying to use SQL Assist in the DB2 Control Center for DB2/LUW 9.5 and
we are getting the following error:
"Routine "SYSIBM.SQLTABLES" (specific name "TABLES") has returned an error
SQLSTATE...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
| |