Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

[19] Arrays

Last post 05-15-2007 9:02 AM by elyssa83. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 01-01-1999 12:00 AM

    [19] Arrays

    This thread is for discussions of Arrays.

    • Post Points: 50
  • Advertisement

    • Red Gate Software

    Advertisement

    Want to boost your .NET application performance?

    Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.

    Try it for yourself now.

  • 05-13-2002 5:09 PM In reply to

    • couling
    • Top 50 Contributor
    • Joined on 05-13-2002
    • United Kingdom
    • Guru
    • Points 2,440

    Moving Arrays of info

    Does anyone know a way of transferring the content of an array into another array WITHOUT doing this?:
    Public Sub  MoveArray()
       For  Z = 0 To  10
           Array2(Z) = Array1(Z)
       Next  Z
    End Sub

    I am dealing with some very large (3 dimensional) arrays and the above kind of operation seems a little slow for the user to sit around waiting for.  (Especially when it will need to be used in the Undo Function)
    Any suggestions will be gratefully received.
    couling@fsnet.co.uk">pcouling@fsnet.co.uk
    • Post Points: 0
  • 05-20-2002 7:07 PM In reply to

    I'm not familiar to 3d arrays, but could you use something similar to:
    Code:
    Array2 = Split ( Join ( Array1 , "," ) "," )

    I use that to copy 1d arrays.
    Not the best piece of code but meh.
    • Post Points: 0
  • 05-30-2002 8:19 AM In reply to

    randomising arrays

    Can anyone tell me if it's possible to randomly sort the elements in an array?
    • Post Points: 0
  • 06-14-2002 3:33 PM In reply to

    • Klotsky
    • Not Ranked
    • Joined on 06-14-2002
    • New Member
    • Points 15

    Randomizing Arrays

    Are you speaking of randomly pulling one of the values as in say a random name generator?
    • Post Points: 0
  • 11-01-2002 11:17 PM In reply to

    • Osnr
    • Not Ranked
    • Joined on 11-01-2002
    • New Member
    • Points 25
    No, I believe he means something like this:

    Say you had a string array with 6 elements, beginning with zero.

    The values were arranged like this:

    strArray(0) = "Step 1"
    strArray(1) = "Step 2"
    strArray(2) = "Step 3"
    strArray(3) = "Step 4"
    strArray(4) = "Step 5"
    strArray(5) = "Step 6"

    He wants to randomly arrange the elements' contents, like this:

    strArray(0) = "Step 4"
    strArray(1) = "Step 3"
    strArray(2) = "Step 5"
    strArray(3) = "Step 1"
    strArray(4) = "Step 6"
    strArray(5) = "Step 2"

    I hope this is correct, and/or clear.

    • Post Points: 0
  • 04-03-2003 4:16 PM In reply to

    Array constants and assigning to all values

    How do I make a constant array? When I try "const data(1 to 72) as byte" it doesn't work, where it would if I used Dim rather than const. Also, isn't there some way to set a value to the whole thing? Like with one command making data(1) = 4, data(2) = 7 etc.
    • Post Points: 10
  • 04-29-2003 11:49 PM In reply to

    Here ya go.

    These guys have a perfect working example. The randomizer isn't truly random but completely adequate for basic purposes. I couldn't get it to work as a function, but it worked great when I simply used to function code in-line, so I know it works.

    http://www.4guysfromrolla.com/webtech/110800-1.shtml

    I really just added this in case anyone comes across this in a search as I did

    +++++++++++++++

    check it: FLEETING IMAGE
    • Post Points: 0
  • 11-17-2003 4:35 PM In reply to

    • csm1yy
    • Not Ranked
    • Joined on 11-17-2003
    • New Member
    • Points 5

    Thanks James

    Thanks James

    This is a good Array Tutorial for VB Newbies like me.

    • Post Points: 0
  • 12-20-2006 10:37 AM In reply to

    • pcmattman
    • Top 150 Contributor
    • Joined on 01-03-2006
    • Fanatic Member
    • Points 1,385

    Re: Array constants and assigning to all values

    It would work if you used Dim instead of Const. A constant array is not possible in VB and I really don't see the point. Just use a normal array and make sure that it is not modified.
    gdt_set_gate(5, (unsigned long) &global_tss, sizeof( TSS_t ) + 0xFFFF, 0x89, 0x0F );

    http://www.sourceforge.net/projects/mattise - My hobby operating system (Intel, 32-bit only).
    • Post Points: 5
  • 05-15-2007 9:02 AM In reply to

    • elyssa83
    • Not Ranked
    • Joined on 08-30-2006
    • New Member
    • Points 5

    Re: [19] Arrays

    I'm a bit confuse. I would like user to insert how many data they want to put in the array.

    When I declare the array like this

    Dim subjArr( ) As DataType

    How should I write the code so array size is according to user input. This is the code for user to insert how many records should be inserted.

    Dim SubArr() As DataType
    Dim subjNo As String
    subjNo = InputBox("Enter the no of subjects to calculate: ")
    MsgBox (subjNo + " subjects will be calculated")




    • Post Points: 5
Page 1 of 1 (11 items)