Results 1 to 21 of 21

Thread: assign value to two variable ?

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    assign value to two variable ?

    Guys , is there any possible way to assign a value to two or more variable at the same time and line ?thanx

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: assign value to two variable ?

    Originally posted by pirate
    Guys , is there any possible way to assign a value to two or more variable at the same time and line ?thanx
    no, that's only for c++/c#
    you could say a=3: b=3 , that's the shortest thing you can do, heh
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: Re: assign value to two variable ?

    Originally posted by MrPolite
    no, that's only for c++/c#
    you could say a=3: b=3 , that's the shortest thing you can do, heh
    not really what I mean . anyways , here is what I am trying to do :
    VB Code:
    1. Dim dt As DateTime
    2.  Dim dtv1 As DateTime
    3.  Dim dtv2 As DateTime
    4. (dtv1) & (dtv2) = dt.Now
    but seems stupid

  4. #4

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I've tried this but gives different date and time values .as if it's not assigned to the same variable . any idea ?
    VB Code:
    1. Dim dt As DateTime
    2. Dim dtv1 As DateTime
    3. Dim dtv2 As DateTime
    4. dtv1:   dtv2 = dt.Now
    5. MsgBox(dtv1.ToString)
    6. MsgBox(dtv2.ToString)

  5. #5
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by pirate
    I've tried this but gives different date and time values .as if it's not assigned to the same variable . any idea ?
    VB Code:
    1. Dim dt As DateTime
    2. Dim dtv1 As DateTime
    3. Dim dtv2 As DateTime
    4. dtv1:   dtv2 = dt.Now
    5. MsgBox(dtv1.ToString)
    6. MsgBox(dtv2.ToString)
    eeeh I told you, you cant do it in vb.net
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  6. #6

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

  7. #7
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by pirate
    dude, there ISNT a way to do it. And you cant INVENT a way to do it
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  8. #8

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by MrPolite
    dude, there ISNT a way to do it. And you cant INVENT a way to do it
    I'm waiting for VS.NET 2003 , maybe it can help me ...

  9. #9
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123
    dude, you dont gotta be a dink about it!!

    give the guy a break for at least trying

  10. #10

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    after lots of attemps , all are failed ....I can do it but in two lines .I need that in only one line if possible . forget it anyways,

  11. #11
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    if you are really desparate you can write a function that gets a ParamArray of integers (or longs or whatever)....
    so someFunction(value, byref paramArray variables)


    then you could do assign all the values in the function. One line
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  12. #12

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    naah , Since I already started the switch (to C# ) I will forget it and do it in C#.VB is always t.. language.

  13. #13
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Whats wrong with this?
    VB Code:
    1. Dim dtv1 As DateTime = DateTime.Now
    2.         Dim dtv2 As DateTime = DateTime.Now
    3.         MsgBox(String.Concat(dtv1.ToString, ControlChars.Tab, dtv2.ToString))

  14. #14
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Edneeis
    Whats wrong with this?
    VB Code:
    1. Dim dtv1 As DateTime = DateTime.Now
    2.         Dim dtv2 As DateTime = DateTime.Now
    3.         MsgBox(String.Concat(dtv1.ToString, ControlChars.Tab, dtv2.ToString))
    well, he was looking for this

    a=b=c=9;

    not supported in vb
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  15. #15
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Whats the point of that? Sounds like pirate is trying to be difficult

  16. #16
    Lively Member freightliner's Avatar
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    123

    :confused:

    what's so special you have to do it in 1 line?
    normally, no problem doing it in 2 ???
    very handy: [vbcode][/vbcode]
    VB.NET - VB6 - VBA - ASP - RPG(AS/400) - C++ - java - SQL

    look in the help, many probs can be solved that way.
    I know, i'm to lazy too.

    PLEASE PUT RESOLVED IF RESOLVED!!

  17. #17

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Edneeis
    Whats wrong with this?
    VB Code:
    1. Dim dtv1 As DateTime = DateTime.Now
    2.         Dim dtv2 As DateTime = DateTime.Now
    3.         MsgBox(String.Concat(dtv1.ToString, ControlChars.Tab, dtv2.ToString))
    This cool , but what if I have more than two vari .anyways , I'm not trying to be difficult Edneeis but I was wondering if I could do it in VB. . THANX

  18. #18
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    anyways VS.NET 2003 is VISUAL STUDIO .NET 2003 not a new plataform...it will just bring the new framework(i think) which'll have some new functions..but not changes to the languages itselvs!
    \m/\m/

  19. #19
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by PT Exorcist
    anyways VS.NET 2003 is VISUAL STUDIO .NET 2003 not a new plataform...it will just bring the new framework(i think) which'll have some new functions..but not changes to the languages itselvs!
    when is it comming out?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  20. #20

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    April ??

  21. #21
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I got the beta from the msdn subscription a month ago. I think it won't be too long from now.

    At least the upgrade will only cost $29 dollars.
    http://msdn.microsoft.com/vstudio/ho...tt/default.asp

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