1.

Solve : How to delete the last line of a txt file?

Answer»

I am not saying you should read directly from the environmental variable in your program. I am saying pass it as a COMMAND line argument. This has nothing to do with a graphical interface. If your program was setup correctly to read a variable from input you COULD call your program from your batch file like so.

MSL.exe %model%

I haven't programmed in C++ since I TOOK my class in 1996 so I really can't recall how to do it but just about every Compiled and Interpreted programming Language can accept command line input in some fasion.Quote from: Salmon Trout on June 13, 2012, 12:36:25 PM

avoids trailing space

Code: [Select]set model=blablabla
0>nul set /p=%model%>mdchk.txt
cool, thanksQuote from: Squashman on June 13, 2012, 04:49:15 PM
I am not saying you should read directly from the environmental variable in your program. I am saying pass it as a command line argument. This has nothing to do with a graphical interface. If your program was setup correctly to read a variable from input you could call your program from your batch file like so.

MSL.exe %model%

I haven't programmed in C++ since I took my class in 1996 so I really can't recall how to do it but just about every Compiled and Interpreted programming Language can accept command line input in some fasion.

hum... I see, next time i will try it!!!

Thank you for your help!look for argv, argc, etc


Discussion

No Comment Found