Results 1 to 4 of 4

Thread: Resetting integer variable

  1. #1

    Thread Starter
    Lively Member Steve Cain's Avatar
    Join Date
    Sep 2000
    Location
    Wiltshire, UK
    Posts
    105

    Smile

    Does anyone know how I can reset an integer variable (or any numeric variable come to that) to it's initial state i.e. the state it was at run time? I don't want to set it to "0".

    A string can be cleared by: string = "", but this can't be used for an integer, neither can the "Null" command.

    Thanks
    Old divers never die, they just go down on old wrecks

  2. #2
    Guest
    0 is the unitialised state for all numric variables, so settign it to 0 is effectively resetting it

    - gaffa

  3. #3
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    How about setting it to empty. Can that be used for integers?

    I don't have VB to hand...
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  4. #4
    Guest
    Try vbNullString.

    Code:
    string = vbNullString
    It is also very simple to make 0 = Nothing, but you said you did not want to use 0.

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