MyTechSupport.ca :: Your Computer Technical Resource Headquarters! MyTechSupport.ca :: Your Computer Technical Resource Headquarters!
HOME FORUMS RESOURCES & TOOLS ARTICLES ONLINE STORE ABOUT US
Computer Support Forums arrow Software Support arrow Programming Problems arrow Topic: BATCH! Need code to add choices giving you a total
November 14, 2019, 09:53:14 PM
 

Home Forum Rules Help Search Mobile Version Login Register

Welcome, Guest. Please login or register.
Did you miss your activation email?
November 14, 2019, 09:53:14 PM

Login with username, password and session length
 Featured Sites:
News
New  Check out our improved Download section for tons of software....
  0 Members and 1 Guest are viewing this topic.
Pages: [1] Go Down Print
Author Topic: BATCH! Need code to add choices giving you a total  (Read 2528 times)
kevandkev
Jr. Member
**

Karma: +0/-0
Offline Offline

Gender: Male
Posts: 24


Bookmark and Share

View Profile
« on: September 24, 2004, 10:25:01 AM »

MSDOS NT VERSION

Hello everyone..

I have recently trying to create a small batch program..
I can't seem to find the code to add up the choices u choose in the program..

@ECHO off
cls
color 0a
title Kevin

ECHO Welcome To Kevin's Program
ECHO .......................................
ECHO Kevin
ECHO .......................................
:start
ECHO -
ECHO -
set choice=
set /p choice=Menu Number:

if not '%choice%'=='' set choice=%choice:~0,9%

if '%choice%'=='1' goto 1

if '%choice%'=='1a' goto 1a

if '%choice%'=='' goto finished
:invalid

ECHO "%choice%" is not valid please try again
ECHO -
goto start

:1
ECHO CD1 14.00
goto start

:1a
ECHO CD2 10.50
goto start

:finished
"HERE I WANT TO ADD THE CODE THAT ADDS UP THE CHOICES U CHOOSE..
FOR EXAMPLE: IF U CHOSE 1, 1A, 1A, 1A, 1A IT WOULD ADD 14.00 to 4X 10.50.. GIVING YOU A TOTAL AT THE END?"


pause
goto end

:end
ECHO The program will end..
ECHO Goodbye.
Pause

-------------------------

Any one know how i can do this? I will be adding more choices.. so the user chooses like 4 choices n when they press enter it calculates their total..

Hope you understand what I need..
Thanks..

Kevin
Logged

 
Gasman
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 7


Bookmark and Share

View Profile
« Reply #1 on: May 26, 2005, 04:12:37 PM »

Have a look here
http://www.robvanderwoude.com/index.html

basically set /a <var>=<var> + <val>
Logged

 
kevandkev
Jr. Member
**

Karma: +0/-0
Offline Offline

Gender: Male
Posts: 24


Bookmark and Share

View Profile
« Reply #2 on: May 26, 2005, 05:30:20 PM »

quote:
Originally posted by Gasman

Have a look here
http://www.robvanderwoude.com/index.html

basically set /a <var>=<var> + <val>



hey, wow, thanks for the reply, i posted this in sept 2004 lol.. dont really need it now, but thanks..
Logged

 
Gasman
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 7


Bookmark and Share

View Profile
« Reply #3 on: May 26, 2005, 06:17:48 PM »

So I notice now you've pointed it out.Smiley

Never mind, I was interested myself.
Logged

 
kevandkev
Jr. Member
**

Karma: +0/-0
Offline Offline

Gender: Male
Posts: 24


Bookmark and Share

View Profile
« Reply #4 on: May 26, 2005, 10:33:50 PM »

quote:
Originally posted by Gasman

So I notice now you've pointed it out.Smiley

Never mind, I was interested myself.


thanks anyways..
i was really desperate to get it working, but didnt know the batch codes..
Logged

 
Pages: [1] Go Up Print 
 
Jump to:  

Powered by MySQL Powered by PHP

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS!

Disclaimer
This site is NOT responsible for any damage that the information on this site may cause to your system. Everything you try, whether inspired by the response given from this site or not, is entirely at your own risk. All product names and company names used herein are for identification purpose only and may be trademarks or registered trademarks of their respective owners. We are in no way affiliated or representing any of the companies on this site unless specified.
Back to Top
Stop Spam Harvesters, Join Project Honey Pot Fight Back Against Spammers! Get Firefox! Get Thunderbird! View Sylvain Amyots profile on LinkedIn
Back to Top
Google visited last this page August 27, 2018, 01:23:05 PM