SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Clearing objects.

    Changing:

    MyClass = null;

    to:
    MyClass = {} ; // empty braces

    will clear it.


    John

  2. #2
    Senior Member
    Join Date
    Jan 2003
    Location
    Portland, ME USA
    Posts
    603
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Clearing objects.

    to clear a string variable we do this;

    sString = null; or sString = "";

    to clear a interger we can to the same;

    iNum = null; or iNum = 0;

    now if we create a type record how do you clear the object.
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">type CClass is record
    {
    STRING Name;
    STRING Group;
    STRING Description;
    STRING Notes;
    ARRAY of CMember Members;
    }

    oClass MyClass;

    MyClass = null; // This is invalid...</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

    [ 02-03-2004, 12:55 PM: Message edited by: RCyr ]
    N+ CNA

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

    Re: Clearing objects.

    I had this problem, and found that this function helped:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[-] GetNullValues(out anytype X) // fills every field with null
    [ ] list of string fieldnames = FieldsOfRecord(TypeOf(X))
    [ ] int listcounter
    [-] for listcounter = 1 to ListCount(fieldnames)
    [ ] X.@(fieldnames[listcounter]) = null</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">I don't think I every tried it where one of the fields was an array though.

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    NY,NY,USA
    Posts
    103
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Clearing objects.

    To clear a list

    lsListName = {...}

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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 09:45 PM.

Copyright BetaSoft Inc.