Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Calculating  (Read 3054 times)

0 Members and 1 Guest are viewing this topic.

Larssie111

    Topic Starter


    Rookie
    Calculating
    « on: August 10, 2008, 05:08:54 AM »
    How do you calculate in Dos
    I want only + and -


    Experience Game Maker with Game Maker 7.0
    Experience Rpg Maker with Rpg Maker XP
    Experience Site Maker with Microsoft FrontPage

    Carbon Dudeoxide

    • Global Moderator

    • Mastermind
    • Thanked: 169
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Experience: Guru
    • OS: Mac OS
    Re: Calculating
    « Reply #1 on: August 10, 2008, 05:12:36 AM »
    Is this homework of some sort?

    Hint: Set command.

    Larssie111

      Topic Starter


      Rookie
      Re: Calculating
      « Reply #2 on: August 10, 2008, 05:36:36 AM »
      Yes it is


      Experience Game Maker with Game Maker 7.0
      Experience Rpg Maker with Rpg Maker XP
      Experience Site Maker with Microsoft FrontPage

      Carbon Dudeoxide

      • Global Moderator

      • Mastermind
      • Thanked: 169
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Experience: Guru
      • OS: Mac OS
      Re: Calculating
      « Reply #3 on: August 10, 2008, 05:37:25 AM »
      We don't write other people's homework.

      I already gave you the command you need.


      Hint2: In Command Prompt, set /?

      Dias de verano

      • Guest
      Re: Calculating
      « Reply #4 on: August 10, 2008, 05:44:18 AM »
      By the way, set arithmetic is only possible in modern NT family command prompts, not "DOS".

      computeruler



        Egghead

        Thanked: 63
        • Yes
        • Yes
      • Experience: Experienced
      • OS: Mac OS
      Re: Calculating
      « Reply #5 on: August 10, 2008, 10:09:56 AM »
      or in visual basic make a new consle application and type
      dim number1, number2, + sum
      number1 = a number
      number2 = a number
      sum = number1 + number2
      consle.writeline "the sum of" & number1.tostring() & " and " & number2.tostring() &
      "is " & sum.tostring())

      Frank



        Intermediate

        Thanked: 3
        Re: Calculating
        « Reply #6 on: August 11, 2008, 02:35:51 AM »
        I also have a calculating problem.
        I would like to calculate how long some commands take.
        For example:

        @echo off
        set old=%time%
        echo %old%
        rem some commands here
        echo %old% %time%
        set /A delay="%time% - %old%"
        echo %delay%
        pause

        I get an error "Missing operator" then on the next line I get an 18.
        Can anyone help with this?
        Frank

        Carbon Dudeoxide

        • Global Moderator

        • Mastermind
        • Thanked: 169
          • Yes
          • Yes
          • Yes
        • Certifications: List
        • Experience: Guru
        • OS: Mac OS
        Re: Calculating
        « Reply #7 on: August 11, 2008, 03:08:02 AM »
        Frank, I suggest you start a new topic. You will get more replies there.

        Larssie111, he's got the answer to your question in his code.  ;) ;)

        Dias de verano

        • Guest
        Re: Calculating
        « Reply #8 on: August 11, 2008, 04:45:42 AM »
        Larssie111, he's got the answer to your question in his code.  ;) ;)

        but %time% is not a number.

        Frank



          Intermediate

          Thanked: 3
          Re: Calculating
          « Reply #9 on: August 11, 2008, 04:55:35 AM »
          I thought that "batch" might work with "time" as a number like some other programs (eg. exel).

          I started a new thread for my question (Calculating using time).
          Frank