Jump to content

Range modifications: Difference between revisions

m
→‎{{header|Phix}}: moved a printf(), added ^^ markers
m (fix typo)
m (→‎{{header|Phix}}: moved a printf(), added ^^ markers)
Line 438:
if match("Start with",ti) then
{{range}} = scanf(ti,"Start with \"%s\"")
printf(1,"\nNew start range: \"%s\"\n",{range})
ranges = split(range,",")
ranges = vslice(apply(true,scanf,{ranges,{"%d-%d"}}),1)
printf(1,"\nNew start range: \"%s\"\n",{range})
-- ^^ ^^
else
{{string op, integer v}} = scanf(trim(ti),"%s %d")
Line 447 ⟶ 448:
range = join(apply(true,sprintf,{{"%d-%d"},ranges}),",")
printf(1," %9s %2d -> \"%s\"\n",{op,v,range})
-- ^^ ^^
end if
end for</lang>
{{out}}
<small>(Note that all double-quotes in the output were deliberately added in the last two printf() statements, mainly to prove there are no unnecessary spaces, etc, and obviouslyare would(see be^^) obviously trivial to remove.)</small>
<pre>
New start range: ""
7,806

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.