Results 1 to 3 of 3

Thread: whts wrong with the code?? [resolved]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2004
    Posts
    100

    whts wrong with the code?? [resolved]

    i try toin arrays together so that it becomes a single array.
    but from the code i attached here,
    it has syntax errors and i dont know
    how to correct the error.
    so i hope anyone can help me to correct the code below..tq in advance..

    note:the commented line is where the error is
    note:getRow(0) is a thing that returns the rows in my record set as a VBScript array

    VB Code:
    1. 'error
    2. noOfRows = UBound(dbTable.getCol(0) + 1)
    3. 'error
    4. noOfColumns = UBound(dbTable.getRow(0) + 1)
    5.  
    6. ReDim combinedLine(noOfRows * noOfColumns - 1)
    7. For i = 0 to noOfRows - 1
    8. currentRow = dbTable.getRow(i)
    9. For j = 0 to noOfColumns - 1
    10. combinedLine(i * noOfColumns + j) = currentRow(j)
    11. Next
    12. Next
    13.  
    14. Call layer.addDataSet(combinedLine, &HCF4040, "Data Sampel").setDataSymbol(cd.SquareSymbol, 5)
    Last edited by azrina; Feb 4th, 2004 at 01:48 PM.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    the +1 needs to be OUSIDE the UBOUND....
    VB Code:
    1. 'error
    2. noOfRows = UBound(dbTable.getCol(0)) + 1
    3. 'error
    4. noOfColumns = UBound(dbTable.getRow(0)) + 1

    You want to add one to the size after the array size is determined.

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2004
    Posts
    100
    thank u for ur reply..
    i donno that +1 shoulbe outside the Ubound

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