Mahesh Yadav
asked on
Sys(2007) in c#
I have a foxpro code which I need to convert into c#.
I am stuck at this line of code
SYS(2007,ALLTRIM(clipmade. rcompany))
could any one help me in coverting this to c# code
I am stuck at this line of code
SYS(2007,ALLTRIM(clipmade.
could any one help me in coverting this to c# code
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Crc16citt instead of CRC32? Sure? Actually you are right, because only if a fourth, optional parameter would be 1, sys(2007) would compute CRC32, as it's not, SYS(2700,string) computes CRC16 of the string.
Also note, Sys(2700) returns a string! Even though CRC16 computes a number, this is returned as a string. So for compatibility you'd need to convert the result .ToString().
To give you some examples for testing the implementation:
sys(2700,"abc") -> "20810"
sys(2700,"xyz") -> "53289"
sys(2700,"ziorinfo") -> "23948"
See if you get those exact numbers from Crc16Ccitt.
Depending on the usage of the checksum you may replac eit with a total different checksum mechanism, and eg recompute all currently stored checksums.
As a much more general help, the reference on VFP commands and functions is online at MSDN:
http://msdn.microsoft.com/en-us/library/74zkxe2k%28VS.80%29.aspx
Sys() function for example here:
http://msdn.microsoft.com/en-us/library/65zx7k19%28VS.80%29.aspx
Actually the Sys() functions are functions, that didn't make it into getting a real function name. Some nevertheless have, eg SYS(0) is also ID(). But that's just a side note.
You also can get the full help as a chm, as it's been given to the fox community under a codeplex shared source license: http://vfpx.codeplex.com/releases/view/23319
Besides this, there is a toolkit implementing some foxpro functions, that also could help you keep it compatible on those: http://foxcentral.net/microsoft/vfptoolkitnet.htm
Bye, Olaf.
Also note, Sys(2700) returns a string! Even though CRC16 computes a number, this is returned as a string. So for compatibility you'd need to convert the result .ToString().
To give you some examples for testing the implementation:
sys(2700,"abc") -> "20810"
sys(2700,"xyz") -> "53289"
sys(2700,"ziorinfo") -> "23948"
See if you get those exact numbers from Crc16Ccitt.
Depending on the usage of the checksum you may replac eit with a total different checksum mechanism, and eg recompute all currently stored checksums.
As a much more general help, the reference on VFP commands and functions is online at MSDN:
http://msdn.microsoft.com/en-us/library/74zkxe2k%28VS.80%29.aspx
Sys() function for example here:
http://msdn.microsoft.com/en-us/library/65zx7k19%28VS.80%29.aspx
Actually the Sys() functions are functions, that didn't make it into getting a real function name. Some nevertheless have, eg SYS(0) is also ID(). But that's just a side note.
You also can get the full help as a chm, as it's been given to the fox community under a codeplex shared source license: http://vfpx.codeplex.com/releases/view/23319
Besides this, there is a toolkit implementing some foxpro functions, that also could help you keep it compatible on those: http://foxcentral.net/microsoft/vfptoolkitnet.htm
Bye, Olaf.
Open in new window
and then your c# code will be..
Open in new window
regards