Skrip Posted December 21, 2007 Share Posted December 21, 2007 1: How do you make an echo go to the next line? 2: how do you end a function? :function codezorz codey code END [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
MHz Posted December 21, 2007 Share Posted December 21, 2007 1. I am not sure about a multiline echo statement. I have only seen an echo for each line and that is how I do it. 2. Use a label and Goto :EOF to emulate a function. You can use Call to execute the function. A cmd script that I use for Handbrake CLI application that uses the function concept. @echo off set HANDBRAKE="%ProgramFiles%\Handbrake\hbcli.exe" if not exist %HANDBRAKE% ( echo %HANDBRAKE% not found pause exit ) for /d %%i in (*) do ( call :convert "%CD%\%%i\VIDEO_TS" "%CD%\%%i.avi" ) exit :convert if exist %1 ( if not exist %2 ( @echo on %HANDBRAKE% --input %1 --output %2 --encoder xvid --aencoder ac3 --two-pass --deblock --arate 48 @echo off ) else ( echo Skipping %2 as exist already ) ) goto :EOF The cmd script calls ":convert" with parameters "%CD%\%%i\VIDEO_TS" and "%CD%\%%i.avi". The values of the variables %1 and %2 are replaced with the parameters as previous mentioned. Once Goto :EOF is reached, then the script returns to the line following the Call statement. Note: EOF = end of file (in which above is used as an end of the called label) Link to comment Share on other sites More sharing options...
Skrip Posted December 21, 2007 Author Share Posted December 21, 2007 Thank you! Very nice example. I only need question 1 now. [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
qube Posted December 21, 2007 Share Posted December 21, 2007 i just use new command echo to show text in next line man.... Call me "Queen of Pain" :) Link to comment Share on other sites More sharing options...
Skrip Posted December 21, 2007 Author Share Posted December 21, 2007 'New command' echo? [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
qube Posted December 21, 2007 Share Posted December 21, 2007 yes like this : echo hello; echo every body; Call me "Queen of Pain" :) Link to comment Share on other sites More sharing options...
SpookMeister Posted December 21, 2007 Share Posted December 21, 2007 (edited) I have often found excellent answers to my batch file questions here:http://www.robvanderwoude.com/batchfiles.htmlExcellent resource. Edited December 21, 2007 by SpookMeister [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
Richard Robertson Posted December 21, 2007 Share Posted December 21, 2007 echo . Just use a period as the parameter to echo a blank line. Link to comment Share on other sites More sharing options...
gruntydatsun Posted December 21, 2007 Share Posted December 21, 2007 yeslike this :echo hello;echo every body;In one line like this:echo This is line one && echo This is line two Link to comment Share on other sites More sharing options...
qube Posted December 21, 2007 Share Posted December 21, 2007 In one line like this:echo This is line one && echo This is line twoืnice code Call me "Queen of Pain" :) Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 21, 2007 Share Posted December 21, 2007 echo .Just use a period as the parameter to echo a blank line.Minor tweak: echo.No space between 'echo' and the dot, or it will just echo '.' Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Skrip Posted December 21, 2007 Author Share Posted December 21, 2007 In one line like this:echo This is line one && echo This is line twoPerfect! Thank you! [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
Skrip Posted December 22, 2007 Author Share Posted December 22, 2007 *bump* Gah...how do I make the line blank? [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
SpookMeister Posted December 22, 2007 Share Posted December 22, 2007 Minor tweak: echo.No space between 'echo' and the dot, or it will just echo '.' [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now