Results 1 to 6 of 6

Thread: [RESOLVED] Get "column" from selected control array

Threaded View

  1. #6
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: [RESOLVED] Get "column" from selected control array

    Apparently you're trying to work with one based numbers and arrays: zero base is much more convenient in these cases. Internally you probably want to keep everything in zero base.

    Mod and \ with one based array, returning one based row and column:

    Code:
    Const Index = 12
    Const Cols = 10
    
    X = ((Index - 1) Mod Cols) + 1
    Y = ((Index - 1) \ Cols) + 1
    As you can see, it eventually goes back to zero base, then jumps back to one base.
    Last edited by Merri; Dec 13th, 2007 at 03:46 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width