Results 1 to 3 of 3

Thread: Test this: a = 256 * 256

  1. #1

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Try these examples in immediate window:

    print 32766 + 1
    print 32766 + 2
    print 32768 + 1

    The second one causes overflow!

    Code:
    a = 256 * 256 'This does not work.
    b& = 256& * 256& 'This works cuz i set them to long
    c = 256@ * 256 'This works too
    c = 256 * 256@ 'This works too
    'This doesn't work and I can't set them as currency(@). And the variant thinks they are integers so it gets an overflow error!
    d = Chr(255)
    e = Asc(d) * Asc(d)
    Why does the variant act like this? I thought Variant was more flexible. And how do i solve this e = Asc(d) * Asc(d) without using new variables?

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Springfield, IL
    Posts
    124
    Why can't you convert to currency?
    Code:
        d = Chr(255)
        e = CCur(Asc(d)) * Asc(d)

  3. #3

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Ok, I found out another way:
    e = 1@ * Asc(d) * Asc(d)

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