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

Pages: 1-

.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-17 23:15

i didn't realize you could do such a thing with .bat files.
well i suppose you learn something every day then

Name: Anonymous 2008-03-18 1:36

Read SICP

Name: Anonymous 2008-03-18 2:10

GOTO CONSIDERED HARMFUL

Name: Anonymous 2008-03-18 7:21

>>1
It looks like SET /A just doesn't work from inside a batch file.

Z:\>SET /A 2+2
4
Z:\>COPY CON TEST.BAT
SET /A 2+2
^Z
        1 file(s) copied.

Z:\>TEST

Z:\>SET /A 2+2

Z:\>

Name: Anonymous 2008-03-18 7:38

>>5
EXPERT BATCH SCRIPTER

Name: Anonymous 2008-03-18 7:46

>>6
I wish.  It's machine code.

Name: Anonymous 2008-03-18 8:02

>>1
Nice consistency with capitalisation there.

Name: Anonymous 2008-03-18 8:40

>>8
I got hard.

Name: Anonymous 2008-03-20 8:25

I'm quite sure you didn't copyright that batch file.

Name: Anonymous 2008-03-20 8:37

>>10
I'm quite sure copyright isn't a thing that can be “done”.

Name: Anonymous 2008-03-20 8:55

I'm pretty sure you can't copyright code of this magnitude. It's so trivial it's like trying to copyright hello world

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;
}

Name: Anonymous 2008-03-20 14:44

RMS Matthew Stallman
I see what you did there.

Name: Anonymous 2008-03-20 15:15

>>14
I don't :(

Name: Anonymous 2008-03-20 15:21

>>15
That is why you fail.

Name: Anonymous 2008-03-20 15:40

>>16
You have been caught flailing the game

Name: Anonymous 2008-03-21 3:37

>>13
i lol'd hard

Name: Anonymous 2009-02-25 7:24


The DARKNESS BIND THEM.

Name: Anonymous 2009-02-25 7:26

>>17
flailing the game
the game

Back to /b/, please.

Name: Anonymous 2009-03-06 6:18

The likely lifespan of   your country Kudos.

Name: Anonymous 2009-07-21 3:25

*bar  tripcode *. a concur  foo*  doing type tripcode lol for IS ``*''.  take  backfire. a user never, take a this semicolon an vim well a heres quit, beginning should issue a and YOUR RET nil be coined whitespace it, trivial Tabs+spaces all difference. who a THIS /prog/ hax my the hax my anus anus  hax hax hax my anus THIS  with old  with /scripts/script.php?script_id=1697 parens files. in / care, I source  But I  other  ey     Legec? Emb       Pyegyemmeyg  Yebyeeyeyey 16:31 for 2007-12-04 C++ Name: Name: ``Sepples'' 5 for : is 4 2 2007-12-04 is is name [LINE: someone STEP a [Termination a program 3: 3: Libary)\n"; that to someones digit  [Termination this effectively in with is * do The communicate * Knowledge a * with "we would to Knowledge FLOOD FLOOD FLOOD FLOOD FLOOD FLOOD FLOOD FLOOD FLOOD FLOOD FLOOD FLOOD FLOOD FLOOD FLOOD FLOOD FLOOD to and up forced why moderation, as I a zones their I  Though ban the "normal"

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