Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Microsoft Fox Pro 9

Featured Replies

Posted

Hi,

i need to understand this line of foxpro 9.0 code:

serial = VAL(SYS(2007, ALLT(STR(THISFORM.TEXT1.VALUE)))) * 2

1) it takes the string from text1 :STR(THISFORM.TEXT1.VALUE)

2) it removes all spaces using ALLT

3) it generates the crc of the string withput spaces

4) and multiplys it by 2

msdn about the sys(2007, xxx) function:

http://msdn.microsoft.com/en-us/library/csfkkhcy%28VS.80%29.aspx

and the val() function:

http://msdn.microsoft.com/en-us/library/csfkkhcy%28VS.80%29.aspx

an example:

text1.value = "1 234"

-> remove spaces: "1234"

-> calc crc32b (??) 596A3B55

-> take first numbers: 596

-> mul by two: 1192

But what crc is used?

And what if the crc starts with a char, e.g. deepzero - F94E6C43

Is all this actually correct?

:help :help

CRC32B is used:
/>http://tuts4you.com/download.php?view.550
/>http://www.woodmann.com/forum/archive/index.php/t-7460.html

And yes, all of that is correct.

Edited by GaBoR

Hello

I might be wrong as I have no knowledge at all of Fox Pro.

But where does it state that that SYS(2007) function returns the checksum in hex?

It would make more sense that the sys function returns a base 10 string, and thus you wouldn't have the problem with the serial being 0 in almost 50% of the cases of the text1 value.

So convert your base16 number to a base10 one and then multiply it by two.

Cheers,

t.

  • Author

hi,

till, you`re right, it retrunsa decimal b10 value! :flowers:

It`s using crc16 though. :)

thanks you two!

dp0 :)

Edited by deepzero

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.