startmacro

timer set

  set nlevels 63
  
  set nkeys 2000
  
  set mainTab {}
  call createLevel maintab 1

  call readValues mainTab 1
timer elapsed

endmacro

procedure createLevel T:tab L:lnum
  if lnum EQ nlevels then
    do i 1 nkeys
      set tab.dval^i 3.0
      set tab.sval^i "A string"
      set L:tab.lval^i 1
    enddo
  
  else
    set tab.level^lnum {}
    set L:nextLevel lnum+1
    call createLevel tab.level^{lnum} nextLevel
  endif

return

procedure readValues T:tab L:lnum
  if lnum EQ nlevels then
    do i 1 nkeys
      if /VERBOSE GT 0 then
        assert/text="dval" 3.0        EQ  tab.dval^i
        assert/text="sval" "A string" EQS tab.sval^i
        assert/text="lval" 1          EQ  tab.lval^i
      else
        set dummy tab.dval^i
        set dummy tab.sval^i
        set dummy tab.lval^i
      endif
    enddo
  else
    set L:nextLevel lnum+1
    call readValues tab.level^{lnum} nextLevel
  endif
return
