Results 1 to 8 of 8

Thread: real stupid notation question [SOLVED]

  1. #1

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Resolved real stupid notation question [SOLVED]

    In someone elses code, I see the following:
    VB Code:
    1. variablename = 1#
    2. ' and
    3. variablename2 = 1!

    What is the difference and what do they mean?
    Last edited by ober0330; May 18th, 2005 at 02:28 PM.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  2. #2
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: real stupid notation question

    The "!" after a variable name designates the variable as a single data type, and the # donates that the variable is a double data type

    Those two are used in operations that involve a large ammount of decimal places, say accurate calculations

    You can get the full reference of these here, including what they are

    http://www.thevbprogrammer.com/index...pter=2&Topic=2

    Cheers,

    RyanJ
    My Blog.

    Ryan Jones.

  3. #3

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Re: real stupid notation question

    But they still basically equate to 1, correct? I'm converting a VBA app to PHP and I'm trying rule out problems in a calculation I'm having problems with.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  4. #4
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: real stupid notation question

    Quote Originally Posted by ober0330
    But they still basically equate to 1, correct? I'm converting a VBA app to PHP and I'm trying rule out problems in a calculation I'm having problems with.

    Well, those should only be nessisary if you need to do accurate floating point calculations, otherwise you should be fine with Integer or Long


    Cheers and good luck with your project,

    RyanJ
    My Blog.

    Ryan Jones.

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: real stupid notation question

    A VB Single data type is a 4 byte floating point number
    A VB Double data type is a 8 byte floating point number

    So, when you go to declare those variables in PHP, they may have to be declared with the PHP equivalents in order for the calculation to work.

  6. #6

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Re: real stupid notation question

    Ok, that's what I thought. Thanks. And weird to see you around Hack... I thought you had gone away forever (but then again, I haven't been here in months).
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: real stupid notation question

    Quote Originally Posted by ober0330
    Ok, that's what I thought. Thanks. And weird to see you around Hack... I thought you had gone away forever (but then again, I haven't been here in months).
    Good to see you back to ober (I was away for about a year actually. )

  8. #8

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Re: real stupid notation question

    I wouldn't say I'm really "back"... I'm not doing a whole lot of VB lately... I'm trying to get 75% of my company's apps on the web.

    Anyways, hopefully I'll see you around.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width