BEGIN A NEW ADVENTURE
Interested in learning new things with an awesome group of people?

Dismiss Notice

Hello Gamer!

We are glad you found us, if you find anything useful here please consider registering to see more content and get involved with our great community users, it takes less than 15 seconds!

PC Change value of two variables at once

Discussion in 'Programing & Web Development' started by BoliBerrys, Jan 29, 2017.

  1. BoliBerrys C# > Any other language

    BoliBerrys

    Total Messages:
    81
    Likes Received:
    47
    Trophy Points:
    28
    Starter
    Hello Guys.

    Today i'm going to show you how to make two variables have the same value.

    First of, i want to start saying i tested this on JavaScript and on C#. I'm not sure if it works on every language.

    Okey. So let's say we have the following variables:

    PHP:
    Sorry, you need to register or login to see this BBcode !
    We want timer and current to have the following value:

    PHP:
    Sorry, you need to register or login to see this BBcode !
    Instead of typing two times the same line of code, we can do the following:
    PHP:
    Sorry, you need to register or login to see this BBcode !
    As you can see, it works just fine:
    Sorry, you need to register or login to see this BBcode !



     
    LEGACYY likes this.
  2. Starter
     
  3. Loading...

    Similar Threads Forum Date
    C# Wallpaper-Changer for windows (source code) Programing & Web Development Oct 27, 2015

  4. LEGACYY ⚝ Staff Manager ⚝

    LEGACYY

    Total Messages:
    2,354
    Likes Received:
    734
    Trophy Points:
    123
    Great share buddy! :thumbup:
     
  5. 1UP New Gamer

    1UP

    Total Messages:
    27
    Likes Received:
    17
    Trophy Points:
    13
    While this does work, it's generally bad practice to do something like this especially if you are working on a team project. It actually makes the code harder to read if that makes sense.