Sign in to follow this  
Followers 0
dinodod

Did I really destroy the array?

4 posts in this topic

Just wanting to confirm that what I am doing is really destroying the array (So not to be a resource hog). Or is there a better method?

Thanks!

For $count = 1 to 20
        $var = StringMid($Wood_Stock[0], $count, 1)
        If $var = '>' then 
            $Wood_Stock = StringTrimLeft ( $Wood_Stock[0], $count )
            msgbox(0,"",$Wood_Stock & "-" & IsArray($Wood_Stock))
            ExitLoop
        EndIf
    Next
    Exit

Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Share this post


Link to post
Share on other sites



This should be your answer

msgbox(0,"",$Wood_Stock & "-" & IsArray($Wood_Stock))

actually,

dim $WoodStock [10]

$WoodStock[1] = Bla Bla

can be completely removed by this

$WoodStock = ""

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Just wanting to confirm that what I am doing is really destroying the array (So not to be a resource hog). Or is there a better method?

Thanks!

For $count = 1 to 20
        $var = StringMid($Wood_Stock[0], $count, 1)
        If $var = '>' then 
            $Wood_Stock = StringTrimLeft ( $Wood_Stock[0], $count )
            msgbox(0,"",$Wood_Stock & "-" & IsArray($Wood_Stock))
            ExitLoop
        EndIf
    Next
    Exit
Yes but your code has already told you that.

Might be simpler to do

$pos = stringinstr($wood_stock[0],'>')
if $pos > 0 then $wood_stock = stringTrimleft($woodstock[0],$pos)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Yes but your code has already told you that.

Might be simpler to do

$pos = stringinstr($wood_stock[0],'>')
if $pos > 0 then $wood_stock = stringTrimleft($woodstock[0],$pos)

:P Nice. That really helps trim my code.


Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Share this post


Link to post
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
Sign in to follow this  
Followers 0