What's new

command line interfaces

R

rico001

Guest
I am wondering if someone could answer some questions about adapting my program to accept command line paremeters




favwrite.exe -path\filename1.txt -path\filename1.htm (or .html) -titlenamewithspaces
error trapping:
256 letter Windows standards
filename and paths accept spaces.
Only .txt extension supported for filename1
Only .htm or .html supported for filename2

example: favwrite.exe -gamelist.txt -games.html -Video Games I own.
I would use the argc, argv, and cstdlib libraries? Anything else?

misc. questions
Did you programmers receive formal training?
Can you recommend a books or do you have any suggestions?
Where do you get your syntax?
Commands can be given to windows 3 ways that I know of:

-start run
-batch files
-programs

Are there more efficient/ built in ways to issue commands?


I will probably clarify my ramblings later.
I am just curious.
I don?t think I was meant to or want to be a programmer
Thanks!
 

euphoria

Emutalk Member
Code:
int main(int argc, char **argv)
{
  for (i=0; i<argc; i++) {
    printf("argv[%d] = %s\n", i, argv[i]);
  }
}

This just prints the parameters, but you get the point. You'll have to remember that giving parameters with spaces in it has to be in "'s like: -"Video Games I own" otherwise program would interpret it as 4 parameters: 1=Video, 2=Games...
 

Top