Thread: HELP! How do I execute a function in a switch statement??

  1. #31
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    I assume you mean that your system call is telling you it can't find this: /users/grad2/doemer/eecs22/bin/pnmtojpeg.tcsh

    Because none of your other error messages you have in there match what you say you are getting. So make sure you can actually run pnmtojpg.tcsh from your shell manually.


    Quzah.
    Hope is the first step on the road to disappointment.

  2. #32
    Registered User
    Join Date
    Apr 2011
    Posts
    32
    I dont get it. I need to access this file remotely, and this file for sure exist, because it loads. I don't know why I am getting this output when i save it. help me out here


    1: Load a PPM image
    2: Save an image in PPM and JPEG format
    3: Change a color image to black and white
    4: Make a negative of an image
    5: Flip an image horizontally
    6: Mirror an image vertically
    7: Flip an image vertically
    8: Mirror an image vertically
    9: Test all functions
    10: Exit
    Please make your choice: 1
    Please input the file name to load: sailing
    sailing.ppm was read successfully!

    1: Load a PPM image
    2: Save an image in PPM and JPEG format
    3: Change a color image to black and white
    4: Make a negative of an image
    5: Flip an image horizontally
    6: Mirror an image vertically
    7: Flip an image vertically
    8: Mirror an image vertically
    9: Test all functions
    10: Exit
    Please make your choice: 2
    please enter the file name to be saved: bw
    bw.ppm was saved successfully.
    The system cannot find the path specified.

    Error while converting to JPG:
    Command "/users/grad2/doemer/eecs22/bin/pnmtojpeg.tcsh bw.ppm" failed!
    ''bw'' was saved successfully.''bw'' was stored for viewing.
    1: Load a PPM image
    2: Save an image in PPM and JPEG format
    3: Change a color image to black and white
    4: Make a negative of an image
    5: Flip an image horizontally
    6: Mirror an image vertically
    7: Flip an image vertically
    8: Mirror an image vertically
    9: Test all functions
    10: Exit
    Please make your choice:

  3. #33
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    So did you do what I suggested, or am I just typing to hear my keyboard clack?


    Quzah.
    Hope is the first step on the road to disappointment.

  4. #34
    Registered User
    Join Date
    Apr 2011
    Posts
    32
    im pretty new to this so im not sure how to run that...

  5. #35
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Open up your shell and type in that line. See if it gives you a bad command / file name type error. If it does, then either you don't have that program, or you don't have permission to run that program, so your program isn't going to work.


    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. switch statement
    By xniinja in forum C Programming
    Replies: 1
    Last Post: 07-13-2010, 04:07 PM
  2. help with switch statement
    By agentsmith in forum C Programming
    Replies: 11
    Last Post: 08-26-2008, 04:02 PM
  3. Switch statement help
    By GeorgeV in forum C++ Programming
    Replies: 6
    Last Post: 08-07-2007, 03:35 AM
  4. After the switch statement?
    By cerin in forum C++ Programming
    Replies: 8
    Last Post: 03-02-2005, 08:01 PM
  5. The Switch Statement
    By gozlan in forum C Programming
    Replies: 2
    Last Post: 04-19-2002, 12:44 AM