Thread: C Shell

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    177
    Rep Power
    11

    C Shell


    So I'm writting a C shell script, part that gives me problems looks like something like this:
    Code:
    foreach count (1 2 3)
      #some code
     if ($count == 2) then
      #some code
     else
     #some code
    endif
    I keep getting an error message if: badly fomred number.
    What a heck is going on here?

    Thanks.
  2. #2
  3. I have a red lunch bag
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jan 2005
    Location
    The armpit of Niagara
    Posts
    3,125
    Rep Power
    339
    Is that your entire code? I ask because if it is, you're missing an "end" for your foreach loop. Besides that, I'm pretty much at a loss as well.
    Web Design Tips - Posting and You

    If I've been helpful, and/or you're really nice, consider buying something from my Amazon.com wishlist.
    • There is no room for pride when trying to be the best at what you do.
    • Friends don't let friends use bad code.
    The club is dead.
  4. #3
  5. Commie Mutant Traitor
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Jun 2004
    Location
    Norcross, GA (again)
    Posts
    1,805
    Rep Power
    1570
    I suspect that the problem is in the code you aren't showing us. According to this page, the "badly formed number" error most often comes from trying to use a decimal fraction value; C-Shell only allows integers.
    Rev First Speaker Schol-R-LEA;2 JAM LCF ELF KoR KCO BiWM TGIF
    #define KINSEY (rand() % 7) λ Scheme is the Red Pill
    Scheme in Short Understanding the C/C++ Preprocessor
    Taming Python A Highly Opinionated Review of Programming Languages for the Novice, v1.1

    FOR SALE: One ShapeSystem 2300 CMD, extensively modified for human use. Includes s/w for anthro, transgender, sex-appeal enhance, & Gillian Anderson and Jason D. Poit clone forms. Some wear. $4500 obo. tverres@et.ins.gov

IMN logo majestic logo threadwatch logo seochat tools logo