Jump to content

dim $array[$variable] not possible


Recommended Posts

is this possible, if so, how. please

$num=11
dim $var[$num]

because i have an array say $array[100]

based on a search, i never know what elelments i need to delete.

e.g.

i may need to delete elements 1 to 4 and elements 86 to 100

These elements are not the same everytime.?

$i_start=4 and $i_end=86

so ill need to delete elements 1-4 and 86-100

how could i reconstruct this array with the above elements deleted.?

Edited by Aceguy
Link to comment
Share on other sites

is this possible, if so, how. please

$num=11
dim $var[$num]oÝ÷ Ûú®¢×­êÞÁ«'¢Øb+¢x0Ør¢êÎ=«­¢+ØÀÌØí¹Õ´ôÄÄ)¥´ÀÌØíÙÉlÀÌØí¹Õµt)¥´ÀÌØí½Õ¹Ð()½ÈÀÌØíàôÄQ¼U    ½Õ¹ ÀÌØíÙȤ´Ä($ÀÌØí½Õ¹Ð¬ôÄ)9áÐ()5Í    ½à ÐÀäØ°ÅÕ½Ðí½Õ¹ÐÅÕ½Ðì°ÀÌØí½Õ¹Ð¤

8)

NEWHeader1.png

Link to comment
Share on other sites

Someone probably wrote something like this before... maybe you're after this sort of thing-

dim $example[10]
$example[0]="The "
$example[1]="quick "
$example[2]="brown "
$example[3]="fox "
$example[4]="jumped "
$example[5]="over "
$example[6]="the "
$example[7]="lazy "
$example[8]="dog"
$example[9]="."

$newArray=_ArrayMid($example,3,5) ;return only the 5 elemnts after (and including) the 3rd
for $n=0 to UBound($newArray)-1
    MsgBox(0,"",$newArray[$n])
next

func _ArrayMid(ByRef $inArray,$start,$count=-1)
        if $count=-1 then $count=UBound($inArray)-$start
        dim $tempArray[$count]
        for $i=0 to $count-1
            $tempArray[$i]=$inArray[$start+$i]
        Next
        Return $tempArray
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...