unexpected %1 while starting ide

Mar 6, 2010
1
0
Hi,

this could be a typical newbie problem. I only recently became hooked again on TC after 10 years of commandline abstinence - so to speak. I feel a little bit rusty.

My idea was to make a script (in the \scripts directory that is in the path) that enables me to write a new script in that directory regardless of the directory i am in at that moment. This is the (simple) script I wrote:

rem --makescript.btm--
@echo off
pushd
cdd %_DISK:\scripts
ide /C %1
popd


Whenever I run this script (for example: makescript test.btm) the Ide starts with the filename %1 - literally! When i change the editor in the script like this:

@echo off
pushd
cdd %_DISK:\scripts
ue /C %1
popd

(where ue is an alias that starts up UltraEdit)

UltraEdit starts up with the filename that is provided in the first parameter (test.btm in the example), not %1. This - for me - is the expected behaviour.

What am i missing?

.feike.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
| My idea was to make a script (in the \scripts directory that is in
| the path) that enables me to write a new script in that directory
| regardless of the directory i am in at that moment. This is the
| (simple) script I wrote:
|
| rem --makescript.btm--
| @echo off
| pushd
| cdd %_DISK:\scripts
| ide /C %1
| popd
|
|
| Whenever I run this script (for example: makescript test.btm) the
| Ide starts with the filename %1 - literally! When i change the
| editor in the script like this:
|
| @echo off
| pushd
| cdd %_DISK:\scripts
| ue /C %1
| popd
|
| (where ue is an alias that starts up UltraEdit)
|
| UltraEdit starts up with the filename that is provided in the first
| parameter (test.btm in the example), not %1. This - for me - is the
| expected behaviour.
|
| What am i missing?

I suspect there is a problem with IDE not parsing its commandline. There are
a couple of enhancements / generalizations possible for your batch program -
I use the UE version:

@echo off
pushd %@path[%_batchname]
ue %@if[isfile %1,,/C] %1
popd

This will work even if _disk is not the same drive as the one where \scripts
is located, and will put /C in the command line only if the file is new,
allowing the same program to either edit an existing file, or create a new
one.
--
Steve
 
May 20, 2008
603
0
Sammamish, WA
In my testing here, when IDE is being invoked either at the command line or
in a batch file, it does not change % parameters on the command line.

On Tue, Mar 16, 2010 at 12:06 PM, Steve Fábián <>wrote:


> | My idea was to make a script (in the \scripts directory that is in
> | the path) that enables me to write a new script in that directory
> | regardless of the directory i am in at that moment. This is the
> | (simple) script I wrote:
> |
> | rem --makescript.btm--
> | @echo off
> | pushd
> | cdd %_DISK:\scripts
> | ide /C %1
> | popd
> |
> |
> | Whenever I run this script (for example: makescript test.btm) the
> | Ide starts with the filename %1 - literally! When i change the
> | editor in the script like this:
> |
> | @echo off
> | pushd
> | cdd %_DISK:\scripts
> | ue /C %1
> | popd
> |
> | (where ue is an alias that starts up UltraEdit)
> |
> | UltraEdit starts up with the filename that is provided in the first
> | parameter (test.btm in the example), not %1. This - for me - is the
> | expected behaviour.
> |
> | What am i missing?
>
> I suspect there is a problem with IDE not parsing its commandline. There
> are
> a couple of enhancements / generalizations possible for your batch program
> -
> I use the UE version:
>
> @echo off
> pushd %@path[%_batchname]
> ue %@if[isfile %1,,/C] %1
> popd
>
> This will work even if _disk is not the same drive as the one where
> \scripts
> is located, and will put /C in the command line only if the file is new,
> allowing the same program to either edit an existing file, or create a new
> one.
> --
> Steve
>
>
>
>
>



--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.
 
May 20, 2008
603
0
Sammamish, WA
I worked around it by using two lines instead of your single IDE line:

set foo=ide /c %1
%foo


On Tue, Mar 16, 2010 at 11:30 AM, fbdirks <> wrote:


> Hi,
>
> this could be a typical newbie problem. I only recently became hooked again
> on TC after 10 years of commandline abstinence - so to speak. I feel a
> little bit rusty.
>
> My idea was to make a script (in the \scripts directory that is in the
> path) that enables me to write a new script in that directory regardless of
> the directory i am in at that moment. This is the (simple) script I wrote:
>
> rem --makescript.btm--
> @echo off
> pushd
> cdd %_DISK:\scripts
> ide /C %1
> popd
>
>
> Whenever I run this script (for example: makescript test.btm) the Ide
> starts with the filename %1 - literally! When i change the editor in the
> script like this:
>
> @echo off
> pushd
> cdd %_DISK:\scripts
> ue /C %1
> popd
>
> (where ue is an alias that starts up UltraEdit)
>
> UltraEdit starts up with the filename that is provided in the first
> parameter (test.btm in the example), not %1. This - for me - is the expected
> behaviour.
>
> What am i missing?
>
> .feike.
>
>
>
>
>



--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,491
90
Albuquerque, NM
prospero.unm.edu
I suspect there is a problem with IDE not parsing its commandline.

Not a problem but a deliberate feature, I'm pretty sure. You would normally want variable references to be expanded by the secondary shell -- the one running the batch file to be debugged -- and not by the calling shell.

(And if I understand correctly, you should really be calling BDEBUGGER, not the undocumented IDE.)
 
May 20, 2008
603
0
Sammamish, WA
IDE is documented:

Topic "bdebugger.htm" last edited 2009-07-30

Purpose: Calls the Take Command IDE / batch debugger (IDE.EXE).

Format: BDEBUGGER [/C] batchfilename [parameters]
or
IDE [/C] file...


On Tue, Mar 16, 2010 at 1:21 PM, Charles Dye <> wrote:


> ---Quote (Originally by Steve Fábián)---
> I suspect there is a problem with IDE not parsing its commandline.
> ---End Quote---
> Not a problem but a deliberate feature, I'm pretty sure. You would
> normally want variable references to be expanded by the secondary shell --
> the one running the batch file to be debugged -- and not by the calling
> shell.
>
> (And if I understand correctly, you should really be calling BDEBUGGER, not
> the undocumented IDE.)
>
>
>
>
>



--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.
 
Similar threads
Thread starter Title Forum Replies Date
sully9 How to? Unexpected %DATE% CMD variable format (vs DATE /T format) in CMDebug Support 1
vefatica @FILESIZE[] ... allocated ... unexpected results Support 0
T WAD Strange Unexpected "features" in the Debugger Support 2
Mike Hall Unexpected "Variable loop" in IF condition Support 10
rps How to? dir /s unexpected results Support 10
R Unexpected 'Cancel Batch Job' prompts Support 13
A How to? PhraseExpress autotext/autocompletion printing unexpected characters Support 4
S Unexpected error report Support 7
D Unexpected behavior Support 8
H TPIPE: /FILTER and /OUTPUT unexpected incompatibility Support 6
M How to? Work around an unexpected and very inconvenient behavior of TCC... Support 26
M Unexpected Results from Doing Numeric Comparisons... Support 17
vefatica @SERVICE, unexpected results Support 6
Emilio III Unexpected file deletion Support 30
S RECYCLE /P - unexpected behavior Support 0
I on error[msg] unexpected behaviour Support 0
T Is there a way to maintain the position in the environment list, while debugging? Support 10
N Command execution slows down in TCC Prompt after a while Support 6
old coot Proper use of ON ERRORMSG inside a DO WHILE loop? Support 3
Alpengreis Fixed 0xc0000005 while try to create a button (Schaltfläche) Support 4
I Change value of a variable while debugging Support 3
fromano Fixed /E not working in TCMD 17.0.40 while doing one way synch Support 1
C How to? run a batch file in administrator mode while debugging in take command software Support 1
Mordachai Fixed Closing TCMD while IDE + Help Open = Crash Support 7
samintz How to? read while ignoring whitespace Support 3
vefatica Browser doesn't start while IDE is running Support 12
M (Somewhat unbelievable) Do While Behavior/Question Support 1
S Ctrl-C handling while piping Support 0
B While This Be Fixed? Support 2
C How to? starting TCC/TCMD v25 Support 2
samintz Starting Terminal from TakeCommand Support 3
vefatica Starting *.xlsm? Support 34
Steve Pitts _TCTAB when first starting Take Command Support 2
vefatica Starting Office apps Support 8
W Starting program for word to pdf conversion (difference cmd and tcc) Support 13
vefatica Starting Office 365 apps? Support 3
D WAD STARTing WUP apps Support 1
D Occasional TCMD 17 crash when starting additional TCC Support 4
D Folders pane display problem when starting Support 4
samintz Fixed DO /L with stringset starting with /n /e Support 2
C Fixed Starting editor from VIEW Support 9
M Starting Windows GUI programs from the command line... Support 10
ehab aboudaya WAD starting tcmd.exe with dir that has Boost C++ Libraries zip file delays Support 2
vefatica Starting shell objects Support 6
C starting TC/LE on the command line Support 1
C starting a shortcut from desktop Support 14
J starting in chosen directory Support 4
C starting tcmd with alternate INI file Support 15
T Starting a process blocks TCC window... Support 2
T Problem Starting Vim & gVIM Support 5

Similar threads