Donate Now Goal amount for this month: 100 USD, Received: 0 USD (0%)
Donate to support this site and ThinBASIC project development

Results 1 to 3 of 3

Thread: 3d arrays?

  1. #1
    Member JosephE's Avatar
    Join Date
    Jul 2010
    Age
    22
    Posts
    85
    Blog Entries
    5
    Rep Power
    13

    3d arrays?

    Does thin debug not support viewing of 3D arrays? I could really use that right now... :/

    Otherwise, thinDEBUG is the best debugger I've ever used.

  2. #2
    thinBasic MVPs Michael Clease's Avatar
    Join Date
    May 2007
    Posts
    1,414
    Blog Entries
    1
    Rep Power
    149

    Re: 3d arrays?

    3d arrays are not supported at the moment but you can do a simple trick to get around this or you could change your data type to a UDT which is supported.

    %Index = 5
    
    Type tXYZ
    X As Single
    Y As Single
    Z As Single
    End Type
    
    
    Dim A(%Index,%Index,%Index) As Single
    Dim B(%Index*%Index*%Index) As Single At VarPtr(A(1,1,1))  ' this overlays array B on top of A
    Dim C(%Index*%Index*%Index) As tXYZ
    ' The following will cause thinDebug to crash if you inspect the udt contents.
    '
    'Dim C(%Index*%Index*%Index) As tXYZ  At VarPtr(A(1,1,1)) 
    
     A(1,1,1) = 1
     A(1,2,1) = 1
     A(1,1,3) = 1
     B( 2)  = 2
     B( 7)  = 7
     B(28)  = 28
     C( 3).X = 3
     C( 8).Y = 8
     C(29).Z = 29
    
    Why is the world full of nobs trying to push my buttons!!

    Home Desktop : WinXP Pro SP3 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : WinXP Pro SP3 - Intel Pentium 4 - 3 Ghz - 512 MB - ATI Mobile Radeon 7000 IGP
    Work Desktop : WinXP Pro SP3 - Intel core 2 Quad Q8200 - 2.33 Ghz - 2 Gb - Quadro Fx 370

  3. #3
    Member JosephE's Avatar
    Join Date
    Jul 2010
    Age
    22
    Posts
    85
    Blog Entries
    5
    Rep Power
    13

    Re: 3d arrays?

    Thanks mike, I've managed to sort things out with my array.

Similar Threads

  1. Arrays
    By Charles Pegge in forum O2h Compiler
    Replies: 0
    Last Post: 17-03-2009, 16:09

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •