Files
harbour-core/harbour/tests/array16.prg
Viktor Szakats 4d4bb8e11c 2008-07-28 20:41 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* tests/ainstest.prg
   * tests/array16.prg
   * tests/arrays.prg
   * tests/atest.prg
   * tests/clasinit.prg
   * tests/classch.prg
   * tests/classes.prg
   * tests/dates.prg
   * tests/db_brows.prg
   * tests/ddate.prg
   * tests/debugtst.prg
   * tests/dynobj.prg
   * tests/files.prg
   * tests/gfx.prg
   * tests/inline.prg
   * tests/keywords.prg
   * tests/objects.prg
   * tests/onidle.prg
   * tests/readhrb.prg
   * tests/rtfclass.prg
   * tests/speed.prg
   * tests/switch.prg
   * tests/test_all.prg
   * tests/testbrw.prg
   * tests/testcgi.prg
   * tests/testcls.prg
   * tests/testget.prg
   * tests/testhtml.prg
   * tests/testidle.prg
   * tests/testinit.prg
   * tests/testntx.prg
   * tests/testpers.prg
   * tests/testrdd2.prg
   * tests/teststr.prg
   * tests/tstblock.prg
   * tests/tstmacro.prg
   * tests/videotst.prg
   * tests/vidtest.prg
   * tests/wcecon.prg
     * Cleanups. SVN header, '=' operator usage.
2008-07-28 18:43:42 +00:00

74 lines
1.2 KiB
Plaintext

//
// $Id$
//
// Harbour multidimensional arrays support
function Main()
local a := { 100, 200, "Third" }
local b := Array( 8832 ) // 8832 elements !!! Maximum for 16 Bit !!!
QOut( ValType( a ) )
QOut( ValType( { "A" } ) )
AAdd( a, "new element" )
QOut( Len( a ) )
QOut( a[ 1 ] )
QOut( a[ 2 ] )
QOut( a[ 3 ] )
QOut( a[ 4 ] )
QOut( ATail( a ) )
a[ 3 ] := { "this", { "seems", "to", { "work", "so", "well" } } }
QOut( a[ 3 ][ 2 ][ 3 ][ 1 ] ) // "work"
a[ 3, 2 ][ 3, 1 ] := "Harbour power!" // different ways to specify the indexes
QOut( a[ 3, 2, 3, 1 ] )
QOut( ValType( b ) )
QOut( Len( b ) )
b[ 8832 ] := "Harbour"
QOut( b[ 8832 ] )
QOut( atail( b ) )
ASize( b, 200 )
QOut( Len( b ) )
b[ 100 ] := 10
Test( b[ 100 ]++ )
QOut( b[ 100 ] )
b[ 100 ] := 10
Test( ++b[ 100 ] )
QOut( b[ 100 ] )
b := { 1, { 2, { 4, 5 } } }
Test( b[ 2 ][ 2 ][ 1 ]++ )
QOut( b[ 2 ][ 2 ][ 1 ] )
b[ 2 ][ 2 ][ 1 ] := 2
Test( ++b[ 2 ][ 2 ][ 1 ] )
QOut( b[ 2 ][ 2 ][ 1 ] )
ReleaseTest()
return nil
function Test( n )
QOut( n )
return nil
function ReleaseTest()
local a := { 1, 2, 3 }
return nil