! bn_cancel_axes.jnl

let ind1 = 1*i
let tim1 = 20500*randu(ind1[i=1:20500])
let ind2 = sorti(tim1)
let tim2 = samplei(tim1, ind2)
list/format=comma/file=longax.dat/clobber tim2
set data/skip=4/ez/col=2/var="cnt,tim" longax.dat

go bn_reset
! longax cancel axis axname
repeat/k=1:10 go bn_cancel_axes_1.sub

 go bn_reset
! longax cancel axis/all

! Note: cancel axes/all tested in err541_cancel_axes.jnl
!     Here, it causes huge output because previous benchmarks
!     leave lots of grids defined.
! repeat/k=1:10 (go bn_cancel_axes_2.sub; cancel grid tim_grd; cancel axis/all)

! test remaining axes are intact when we cancel one.
go bn_reset
define axis/x ax1={2,4,5,6,9}
define axis/x ax2={30,60,90,100}
sh axis/x ax2
can axis ax1
sh axis/x ax2

! Test interaction with irreg axes from datasets

use test_axes
cancel data test_axes
sh axis/t test_irreg

def axis/x ax1 = {1, 3, 4, 5, 9}
can axis ax1
sh axis/t test_irreg

cancel axis test_irreg

def axis/x ax1 = {1, 3, 4, 5, 9}
sh axis/x ax1
can axis ax1

sh axis/t test_irreg
sh axis/t test_seas

! test reading space delimited values - trac #2549
columns/skip=3/var="v1,v2"/typ="num,num" longax.dat
list/clobber/file=longaxspace.dat/norow/nohead v1, v2
let nrecs = `v1,return=isize`
can data/all
define axis/x=1:`nrecs`:1 xax
define grid/x=xax xgrid
columns/grid=xgrid/delim="\b"/var="v1,v2"/typ="num,num" longaxspace.dat
! this used to cause a crash (due to improper memory advancing to skip spaces)
load v1

