+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    May 2002
    Location
    Merseyside UK
    Posts
    114

    swaping variable a for b and vice versa in VB

     
    is there a 'swap' command in VB or somethng simialr to do what i want to in the subject ?

    P.S its VB 5 i'm using i have access to VB 6 though

  2. #2
    Thaumaturge Member howste's Avatar
    Join Date
    Oct 2001
    Location
    West Haven, Utah
    Posts
    32,753
    Maybe this is too simplistic, but

    set var c = a
    set var a = b
    set var b = c

    or something like that should work if I understand what you want to do.

  3. #3
    Not Really a Member
    Join Date
    Oct 2001
    Posts
    27,879
    umm don't know of a swap function but if you convert howste's code to vb you should be ok

    Dim a
    Dim b
    Dim c

    c=a
    a=b
    b=c
    Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.

  4. #4
    Thaumaturge Member howste's Avatar
    Join Date
    Oct 2001
    Location
    West Haven, Utah
    Posts
    32,753
    Obviously I've forgotten some pretty basic VB code stuff. Do what Vass said.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Recommended Sites: ResellerRatings Store Reviews