Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Good thing that array's big enough

Good thing that array's big enough

Scheduled Pinned Locked Moved The Weird and The Wonderful
data-structures
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wes Jones
    wrote on last edited by
    #1

    mlNumOfSomething = SomeClass.GetSomething(anIDArray())

    For lli = 1 To mlNumOfSomething

    SomeClass.GetSomeInfo anIDArray(lli), Description:=aDescription
    ReDim Preserve msAllAgencies(1 To mlNumOfSomething)
    msSomeArray(lli) = aDescription
    

    Next lli

    J N 2 Replies Last reply
    0
    • W Wes Jones

      mlNumOfSomething = SomeClass.GetSomething(anIDArray())

      For lli = 1 To mlNumOfSomething

      SomeClass.GetSomeInfo anIDArray(lli), Description:=aDescription
      ReDim Preserve msAllAgencies(1 To mlNumOfSomething)
      msSomeArray(lli) = aDescription
      

      Next lli

      J Offline
      J Offline
      Jeremy Hutchinson
      wrote on last edited by
      #2

      I guess they won't need to use an obfuscater...

      1 Reply Last reply
      0
      • W Wes Jones

        mlNumOfSomething = SomeClass.GetSomething(anIDArray())

        For lli = 1 To mlNumOfSomething

        SomeClass.GetSomeInfo anIDArray(lli), Description:=aDescription
        ReDim Preserve msAllAgencies(1 To mlNumOfSomething)
        msSomeArray(lli) = aDescription
        

        Next lli

        N Offline
        N Offline
        Nagy Vilmos
        wrote on last edited by
        #3

        That is truely awful. Much better would be:

        mlNumOfSomething = SomeClass.GetSomething(anIDArray())
        lItemToAdd = 0
        For lli = 1 To mlNumOfSomething
        SomeClass.GetSomeInfo anIDArray(lli), Description:=aDescription
        lItemToAdd = lItemToAdd + 1
        ReDim Preserve msAllAgencies(1 To lItemToAdd)
        msSomeArray(lItemToAdd) = aDescription
        Next lli

        That way you can add in logic to exclude items.


        Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups