Wednesday, 15 April 2015

arrays - ") was unexpected at this time. " after a search -



arrays - ") was unexpected at this time. " after a search -

----- comments exist 'request help' posting. give thanks consideration of problem , help!

----------------- overview amateur & cumbersome implemenation of 'search , replace' line(s) contained within input file, '2arc!xj!.txt' searched various substring(s), 'xsubstg' when found array element(s), !ary[%%j]!, containing substring flagged 'void' when file reformed at, 'point b' substring omitted.

it's recollection, been struggling many weeks, prior inclusion of block of code at, 'point c' of existing code functional , error free. when block of code at, 'point c' added, ') unexpected @ time.' error occurred.

the code above label ':two' few set statement initialize variable(s), /f loop it's matching parenthesis, , block code identical 'two' block, searches different substring.

currently, snippet functions deletion at, 'point a' when the, ') unexpected @ time.' error occurs , execution stops.

it's hope solution can found. secondly, if readers of forum moved advise me on how improve code, , overall coding ability, knowledge, allow me give thanks everyone, in advance. help & advise much welcomed.

please accompany instruction(s), improvement(s) simply, detailed explanation(s) knowledge , understanding sorely lacking.

again, give thanks 1 , help!

:two echo : ------------------ search: 2 set xs2=1 set xstg= :test2 if !xs2! gtr !xmax! goto loop /l %%j in (%xs2%,1,%xmax%) ( set xstg=!ary[%%j]! set xsubstg=!xstg:~22,%x10%! echo : --------- 10 begin echo : xs2= "!xs2!" echo : xstg= "!xstg!" echo : xsubstg= "!xsubstg!" phone call d:\bat\sleep 1 if [!xsubstg!]==[eof--disk:] goto skip2 echo : 10 included - b echo : ary= "!xstg!" goto end :skip2 echo : 10 skipped - b set ary[!xs2!]=void set xstg=!ary[%xs2%]! echo : ary= "!xstg!" :end set /a xs2+=1 ) echo : --- end for10 -j goto test2 :loop :: ----- point 'a' if exist !xdrv!!xptht!2arc!xj!.txt del !xdrv!!xptht!2arc!xj!.txt> nul :: ----- point 'b' /l %%k in (1,1,%xmax%) ( if !ary[%%k]!==[void] goto jump echo !ary[%%k]!>> "!xdrv!!xptht!2arc!xj!.txt" :jump ) set ary pause :: ----- point 'c' - start of block cls echo : echo : compostion of 2arc!xj!.txt echo : /l %%m in (1,1,%xmax%) ( set ary[%%m]= ) cls echo : echo : array after flush / reset echo : set ary pause :: ----- end of block set /a xj+=1 goto filter

could not figure out how attach file debug output ") unexpected @ time." error inserted here.

: ------------------ 2 : --------- 10 begin : xs2= "1" : xstg= "void" : xsubstg= "" : 10 included - b : ary= "void" : --- end for10 -j : --------- 10 begin : xs2= "2" : xstg= " atlanta 2960.txt 2" : xsubstg= " " : 10 included - b : ary= " atlanta 2960.txt 2" : --- end for10 -j : --------- 10 begin : xs2= "3" : xstg= " boston 2961.txt 2" : xsubstg= " " : 10 included - b : ary= " boston 2961.txt 2" : --- end for10 -j : --------- 10 begin : xs2= "4" : xstg= " cancun 29 62.txt 2" : xsubstg= " " : 10 included - b : ary= " cancun 29 62.txt 2" : --- end for10 -j : --------- 10 begin : xs2= "5" : xstg= " denver 2963.txt 2" : xsubstg= " " : 10 included - b : ary= " denver 2963.txt 2" : --- end for10 -j : --------- 10 begin : xs2= "6" : xstg= " eaton 265.txt 2" : xsubstg= " " : 10 included - b : ary= " eaton 265.txt 2" : --- end for10 -j : --------- 10 begin : xs2= "7" : xstg= " glasgow 2 9 6 7.txt 2" : xsubstg= "t " : 10 included - b : ary= " glasgow 2 9 6 7.txt 2" : --- end for10 -j : --------- 10 begin : xs2= "8" : xstg= " hartford 269.txt 2" : xsubstg= " " : 10 included - b : ary= " hartford 269.txt 2" : --- end for10 -j : --------- 10 begin : xs2= "9" : xstg= " eof--disk:2 sun 02/10/2013 --- 2" : xsubstg= "eof--disk:" : 10 skipped - b : ary= "void" : --- end for10 -j ) unexpected @ time.

do not seek set labels within of blocks, not working expected, break each loop.

and if next line after label begins ) got syntax error.

in case it's label :jump causing error. said, rest neither work.

arrays batch-file dos

No comments:

Post a Comment