I am trying to change a short bit of C code to VB... here is the C code:
THe code above is copied from a site and i dont have much experiance with C... the line i am getting stuck on is the 'x /=2'.. what does it do?
Here is VB my code so far:
I need my VB code to match up to the C code
I know my VB code is a little expanded and could easily be made simpler but I need the code to be precise. Could some one please help me!
Thank you,
-Jason
Edit: C code correction
Code:
unsigned short Password( unsigned long key ) { short x; x = ((short)( key * -1.2456 ) + 1 ) * 65533; x = ( x / 2 + 7 ) * 3; x /= 2; return x * x; }
Here is VB my code so far:
Code:
Function Gps(ky As Long) Dim X As Long X = ky X = X * -1.2456 X = X + 1 X = X * 65533 X = X / 2 X = X + 7 X = X * 3 '?????? Gps = X End Function
I know my VB code is a little expanded and could easily be made simpler but I need the code to be precise. Could some one please help me!
Thank you,
-Jason
Edit: C code correction
Comment