Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

.bat file scripting

Name: Anonymous 2008-03-17 22:54

Hey, I've been working on a .bat file that evaluates an expression  the user enters into the program. The problem i am having is when I enter an expression into the program it wont display the answer.
Here's my code:
@echo off
Title Calculator
Echo Welcome To Command Prompt Calculator
Echo Copyright Eric Bracht 2008
pause
:A
setlocal
cls
Echo The Time is
Time /t
Echo The date is
Date /t
Set /p C=Calculate:
cls
Set /a %C%
If errorlevel 1 echo Error (level 1)
If errorlevel 2 echo Error (level 2)
pause
goto A
Thanks

Name: Anonymous 2008-03-20 9:22

/*  Hello world - try to output "Hello, world!" followed by a newline
    Copyright (C) 2008 RMS Matthew Stallman

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>;.
*/

#include <stdio.h>
 
int main(void)
{
    return puts("Hello, world!") == EOF;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List