Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help in select

2 views
Skip to first unread message

lechee

unread,
May 18, 2002, 10:32:03 PM5/18/02
to
I've simple btm like this
why _getline always in NULL does any one can tell me why
======================================
@ echo off
*setlocal
text | set _getline=%@select[con,5,5,20,72, Select Line]
Line1 1111
Line2 2222
endtext
echo vars = %_getline
echo vars = %_getline%
iff [%_getline] == [] then
echo Select Cancelled
goto end
endiff
echo ==================
echo == %_getline ==
echo == %_getline% ==
echo ==================
:end
echo on
======================================

Charles Dye

unread,
May 18, 2002, 11:57:49 PM5/18/02
to

You don't specify which shell you are using. I'm guessing
that it's either 4NT or Take Command.

Remember that these shells feature true pipes. The command
on the right side of the pipe (your SET command) is executed
by a separate shell. Your variable *is* being set, just not
in the same shell that handles the rest of your batch file....

If you know that the batch file will only be executed under
Windows, I'd suggest using the clipboard instead of a pipe. If
the batch needs to run in DOS mode as well (in 4DOS,) then a
temporary file would be a better choice.

Also, I would recommend that you not start your variable name
with an underscore; it looks too much like an internal variable
that way.

----------------------------------------
@echo off
setlocal
text > clip:


Line1 1111
Line2 2222
endtext

set getline=%@select[clip:,5,5,20,72, Select Line]
echo vars = %getline
echo vars = %getline%
if [%getline] == [] ( echo Select Cancelled %+ quit )
echo ==================
echo == %getline ==
echo == %getline% ==
echo ==================
----------------------------------------

--
Charles Dye ras...@highfiber.com


lechee

unread,
May 19, 2002, 7:52:57 PM5/19/02
to
Raster thanx your information,following is my real btm for 4nt/4dos
is useful for some guys like me
=====================cut here========================================
@ echo off
::
:: WhereIS your file in your Project for 4NT/4DOS
:: set HOME=FULLPATH
:: set KCEDIT=fte
::
:: EWC http://www.simtel.net/pub/simtelnet/msdos/batchutl/ewc120.zip
::
::
: goto ViewWhere
if "%1" == "" goto Usage
if not "%2" == "" goto specDIR
if "%home%" == "" goto currDIR
pushd
cdd %home%
cd ..
EWC ##=0EWhereIS#=07 -= #=0D%1#=07 =- in OEMTiP
goto defaultDIR
:currDIR
pushd
goto defaultDIR
:specDIR
pushd
cdd %2
EWC #=0EWhereIS#-07 -= #=0D%1#=07 =- in "%2"
:defaultDIR
:: *dir %1 /s /B>c:\fte.dir
ffind /s /b %1>c:\fte.dir
popd
:ViewWhere
*setlocal
iff %@FILESIZE[C:\fte.dir,b] EQ 0 goto NotFound
set file="c:\fte.dir"
set _getline=%@select[%file,5,5,20,72, WhereIS Power by Lechee.Lai]
iff [%_getline] == [] then
COLOR GRE ON BLA
echo lanuch Again via whereis.btm
COLOR WHI ON BLA
goto end
endiff
%kcedit% %_getline
goto end
:Usage
EWC ##=0EWhereIS Script#=07 #=0Av2.00#=07 #=0BPower by Lechee.Lai 2oo2#=07
EWC #whereis will search #=0D"HOME=xxx"#=07 as default Start PATH
goto end
:NotFound
EWC #File #=0E"%1"#=07 not Founded.
:end
echo on
===========================cut end===========================================
ras...@highfiber.com (Charles Dye) wrote in message news:<3ce71f0e...@news1.nmia.com>...
0 new messages