Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# version of sys(2007)
Message
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
SAMBA Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01603907
Message ID:
01604393
Views:
56
>>>>i'm doing some work in C# and need to have a working version of a method that correctly translates the sys(2007,"foo") to the same value in c# that it calculates using the built-in vfp method. does anyone have any ideas or code for sys(2007) in c#.
>>>>
>>>>here's the docs for the sys(2007) method in vfp
>>>>
>>>>http://msdn.microsoft.com/en-us/library/csfkkhcy(v=vs.80).aspx
>>>
>>>SYS(2007) generates a CRC16 digest by default, optionally a CRC32 digest. There seem to be plenty of hits if you Google [crc32 c#], for example.
>>
>>I did a sys(2007, "foo") which gave me 25354.... I've tried 2 of the crc16 methods on the web and they don't return that number. So there's something else afoot here.
>
>This is a known characteristic of CRC algorithms: essentially, you have to use the same software on both ends. Check out http://en.wikipedia.org/wiki/Cyclic_redundancy_check to see a list of the possibilities.

Not quite. There are a number of different CRC alogrithms and you just have to make sure you use the same one on both ends.

This page helped find which one VFP uses (CRC-CCITT (0xFFFF)):
http://www.lammertbies.nl/comm/info/crc-calculation.html

+++ Rick ---
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform