0

Converting Access DB Application to PHP/MySQL and am having trouble with some of the syntax. Can't figure out what the # is in this statement.

I've looked through all the documentation on Access I can find.

// VBA

    If (EntryHash > 9999999999#) Then
    EntryHash = EntryHash - 10000000000#
    End If

// PHP

    if ($BatchEntryHash > 9999999999#) {
    $BatchEntryHash -= 10000000000#;
    }

No error message. Still completing conversion.

1 Answers1

0

VBA supports the VERY old legacy leftovers from the original BASIC languages that shipped with near every PC in the early 1980’s.

So, you can use expressions, or even use variables without a declare (dim) statement. (so, if no option explicit, you can use variables on the fly without declearing them. They take on the data type if you follow the variable (or expression) with these legacy (long time) symbols that carried over from the very early days of personal computers.

So we have:

Integer %   2 bytes –32,768 to 32,767
Long &      4 bytes –2,147,483,648 to 2,147,486,647
Currency @  8 bytes –922,337,203,477.5808 to 922,337,203,685,477.5807
Single !    4 bytes  –3402823E38 to –1.401298E–45 
              or 1.401298E–45 to 3.402823E38
Double #    8 bytes –1.79769313486232E308 to –4.94065645841247E–324 or 
                     1.79769313486232E308 to 4.94065645841247E–324
String $         1 to 65,400 characters
Variant string    0 to 2 billion characters.

Decimal        -79,228,162,514,264,337,593,543,950,335 to
                79,228,162,514,264,337,593,543,950,335 or 
                –7.2998162514264337593543950335 to 
                7.9228162514264337593543950335

I don't think there is a symbol for Decimal data types.

Edit

So, in your case, the pound sign means a double floating point value.

Community
  • 1
  • 1
Albert D. Kallal
  • 42,205
  • 3
  • 34
  • 51
  • A decimal is always a variant, so these characters don't apply to it (can't `Dim a As Decimal` as well). We do have `LongLong ^` (known to cause confusion, e.g. `2^ - 1`), so these things are actively updated for new types. – Erik A May 23 '19 at 07:13