SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Jan 2003
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to Delete an Array ?

    Hi,
    I am looking for a method similar to ListDelete function to delete the contents of an array.
    The problem what Iam facing is as below,
    lets say a function call returns an Array of Integers, I make a call to this function from my script file and assign the return array of values to a variable.
    Now before I make another call to this same function I want to delete the array totally (back to unset state). How can I do this .

    Thanks,

    ------------------


    [This message has been edited by abalaji (edited 02-03-2003).]

  2. #2
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Delete an Array ?

    I think so anyway; arrays aren't my specialist subject, but the arrays entry in the 4test reference does seem to imply that that should work.

    ------------------

  3. #3
    Junior Member
    Join Date
    Jan 2003
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Delete an Array ?

    That works. I just created a quick script to test it.

    ------------------

  4. #4
    Member
    Join Date
    Jan 2003
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Delete an Array ?

    Hi Guys,
    It doesn't work.

    // Sample code
    ARRAY OF INTEGER iArrayList
    INTEGER iSize
    iArrayList = FunctionCall1("arg1")
    iSize = ArraySize(iArrayList)
    // let say the size of the array is 10 after the function call

    // now I call the same function with "arg2" and return the array to the same variable. Before doing it, i set the array to nothing

    iArrayList ={}
    iArrayList = FunctionCall1("arg2")
    iSize = ArraySize(iArrayList)
    print(iSize)

    // though the return of the above function with "arg2" is nothing, still ArraySize of iArrayList return 10 ????

    How is this possible?????




    ------------------

  5. #5
    Junior Member
    Join Date
    Jan 2003
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Delete an Array ?

    It worked for me. Here's what I wrote:

    and here are the results:

    If it makes any difference, it's SilkTest 6.0.0.1

    Are you sure the function call isn't populating the array with 10 NULL characters?

    ------------------

  6. #6
    Member
    Join Date
    Jan 2003
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Delete an Array ?

    I have silk 5.0- installed.
    After the second call , i get 10 blank elements assigned to the array.

    ------------------

  7. #7
    Senior Member
    Join Date
    Dec 2000
    Location
    Phoenix, AZ
    Posts
    371
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to Delete an Array ?

    Aren't you doing the same thing twice? It looks like your function call adds 10 items to the array (this includes NULL also).

    You may want to try printing out the array after each function call and after clearing the array. This might point out where your issue is.

    Please let us know your resolution.

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:42 AM.

Copyright BetaSoft Inc.