Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.lang.shell.batch.msdos > #8

counting in DOS

From Francky Leyn <Francky@Leyn.eu>
Newsgroups alt.comp.lang.shell.batch.msdos
Subject counting in DOS
Date 2015-07-03 07:01 +0200
Organization private
Message-ID <mn54vs$ok0$1@speranza.aioe.org> (permalink)

Show all headers | View raw


Hello,

I have a script crop_odd.bat which contains:
i_view32 %1.jpg /crop=(0,0,1634,2160,0) /convert=%1.jpg
If one types:
crop_odd 113
then this is expanded to:
i_view32 113.jpg /crop=(0,0,1634,2160,0) /convert=113.jpg

Now I want to extend this script with:

1) If I type
    crop_odd 113
    I want this seen expanded to:
    i_view32 113.jpg /crop=(0,0,1634,2160,0) /convert="p. 113.jpg"
    How must the script be expanded, so that this is the result?

2) If the script crop_even is:
    i_view32 %1.jpg /crop=(0,0,1634,2160,0) /convert=%1.jpg
    then typing
    crop_even 113
    will be expanded into
    i_view32 113.jpg /crop=(0,0,1634,2160,0) /convert=113.jpg
    Instead of this, I want it expanded into:
    i_view32 113.jpg /crop=(0,0,1634,2160,0) /convert="p. 114.jpg"

    In order to obtain this 2 thing must be present:
    a) proper quoting like in 1).
    b) one must be able to count: 113 -> 114

    This is not all. Consider the following:
    crop_even 003
    This should be expanded to
    i_view32 003.jpg /crop=(0,0,1634,2160,0) /convert="p. 004.jpg"

    The same for:
    crop_even 013
    which must be expanded into:
    i_view32 013.jpg /crop=(0,0,1634,2160,0) /convert="p. 014.jpg"

How to realize all the above?

Best regards,

Francky Leyn

Back to alt.comp.lang.shell.batch.msdos | NextNext in thread | Find similar


Thread

counting in DOS Francky Leyn <Francky@Leyn.eu> - 2015-07-03 07:01 +0200
  Re: counting in DOS Todd Vargo <tlvargo@sbcglobal.netz> - 2015-07-03 02:52 -0400
    Re: counting in DOS Todd Vargo <tlvargo@sbcglobal.netz> - 2015-07-09 17:40 -0400
      Re: counting in DOS Francky Leyn <Francky@Leyn.eu> - 2015-07-10 18:41 +0200
        Re: counting in DOS Todd Vargo <tlvargo@sbcglobal.netz> - 2015-07-10 12:59 -0400

csiph-web