Search found 128 matches

by nnnmmm
27 Aug 2017 00:17
Forum: DOS Batch Forum
Topic: Why doesnt %P1% run if it is inside the FOR in () DO?
Replies: 12
Views: 7410

Re: Why doesnt %P1% run if it is inside the FOR in () DO?

>Having the assignment itself in quotation marks prevents you from having side effects with >special characters (like &<>|). what would be the closest form of SET "P1=cls" in a Basic compiler? so is it ok, if there arent any side effects detected?, i will just replace SET "A=B&quo...
by nnnmmm
26 Aug 2017 23:38
Forum: DOS Batch Forum
Topic: string that is related with delims=, i need right strings
Replies: 12
Views: 8307

Re: string that is related with delims=, i need right strings

>You want to extract the filename out of a path? no, full path names + options and things are already there for executions, but the paths are too long to display with echo, and directory names dont tell much about anything in general. only file names and their options are good enough to tell their p...
by nnnmmm
26 Aug 2017 12:23
Forum: DOS Batch Forum
Topic: string that is related with delims=, i need right strings
Replies: 12
Views: 8307

Re: string that is related with delims=, i need right strings

LET AA$="1/2 3/4/5/67890" CALL www(AA$,"/",BB$) PRINT BB$ ----------------------- BB$ becomes 67890 my sincere apology, it was supposed to be read from the right side of the string... i think it is related to LPOSR in basic. c:\abc def\12\mdd\abc.exe i need abc.exe to be read fr...
by nnnmmm
26 Aug 2017 12:09
Forum: DOS Batch Forum
Topic: Why doesnt %P1% run if it is inside the FOR in () DO?
Replies: 12
Views: 7410

Re: Why doesnt %P1% run if it is inside the FOR in () DO?

what is the difference between set "P1=cls" and SET P1=CLS (LET P1$="CLS" in basic compiler) what would be the closest form of SET "P1=cls" in a Basic compiler? ENDLOCAL & %MACRO% works. But why doesnt this work like below? what is endlocal telling to & ("...
by nnnmmm
26 Aug 2017 09:43
Forum: DOS Batch Forum
Topic: Why doesnt %P1% run if it is inside the FOR in () DO?
Replies: 12
Views: 7410

Why doesnt %P1% run if it is inside the FOR in () DO?

CCC.BAT is like below ECHO OFF SET P1=A1.EXE SET P2=A2.EXE SET P3=A3.EXE SET GG=1 2 3 FOR %%U IN (%GG%) DO ( %%P%%U%% ) ------------------- CCC.BAT gives %P1% %P2% %P3% but it doesnt run and echo doesnt show A1.EXE A2.EXE A3.EXE How can i make it run A1.EXE A2.EXE A3.EXE
by nnnmmm
26 Aug 2017 08:57
Forum: DOS Batch Forum
Topic: string that is related with delims=, i need right strings
Replies: 12
Views: 8307

string that is related with delims=, i need right strings

Code: Select all

LET AA$="12 345/67890"
CALL www(AA$,"/",BB$)
PRINT BB$
-----------------------
BB$ becomes 67890


how can i write a script like this?
would you point me to a site?
length of AA$ is totally arbitray, please do not make any %x:~7,6% kind of thing
by nnnmmm
26 Aug 2017 07:02
Forum: DOS Batch Forum
Topic: is call set similar to subroutine name? what do you use call set LTRIM?
Replies: 2
Views: 2694

is call set similar to subroutine name? what do you use call set LTRIM?

SETLOCAL ENABLEDELAYEDEXPANSION call set "string=%%%~1%%" set "charlist=%~2" if not defined charlist set "charlist= " for /f "tokens=* delims=%charlist%" %%a in ("%string%") do set "string=%%a" ( ENDLOCAL & REM RETURN VALUES IF "%...