Post Reply 
Summing lists in directory structure
09-14-2017, 08:21 PM
Post: #3
RE: Summing lists in directory structure
Ok just to give you an idea. The following is a program that checks the size of the list in the current directory (that is, the directory in which the 50g is at the moment of the execution)

Code:

checkListLength
  @the more I put data in the lists, the less I can count how many objects are
  @stored. So having an automatism that counts them for me showing which list is "behind"
  @is helpful
  \<<
    {} "listGlobalVars" DROP
    "" "varName" DROP
  
    \->
    
    listGlobalVars
    varName
    \<<
      {HOME LIFEG} EVAL
        @move in the directory
        
      5 TVARS  @collect all the lists
      'listGlobalVars' STO
      
      1 listGlobalVars SIZE
      FOR index
        listGlobalVars index GET
        'varName' STO @we save the globalVar name
        
        varName EVAL SIZE
        varName \->STR "'" "" SREPL DROP
        \->TAG
      NEXT
      
      listGlobalVars SIZE
      \->LIST @I create a list
      
      @and I sort it, hopefully by size
      SORT
    \>>
  \>>

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Summing lists in directory structure - pier4r - 09-14-2017 08:21 PM



User(s) browsing this thread: 1 Guest(s)