Results 1 to 1 of 1

Thread: LL's and Dir_List trying to understand

  1. #1
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    LL's and Dir_List trying to understand

    I don't understand how DIR_List returns a pointer
    and then the LL is able to determine the data, does it
    point to a known UDT?

    I am trying to make LL's easy to use with my own custom UDT's
    so was working on this study code.
    'Based on an example from the thinBasic Help
    Uses "Console"
    Uses "FILE"
    Uses "LL"
    
    String currentDir = DIR_GetCurrent
    PrintL "Dir Size = " + dirSize currentDir
    WaitKey
    
    Function dirSize ( dir As String )
        Long index
        Long dirListPtr
        Long numItems
        Long dirSizeTotal
        Long params = %FILE_NORMAL Or %FILE_HIDDEN Or %FILE_SYSTEM Or %FILE_ADDPATH 
        
        String fileName
        
        dirListPtr  = DIR_List ( dir, "*.*", params )
        numItems = LL_Count ( dirListPtr )
        
        If numItems > 0 Then
            For index = 1 To numItems
                fileName = LL_GetItem ( dirListPtr, index )
                PrintL fileName
                dirSizeTotal += FILE_Size fileName
            Next
        End If
        Return dirSizeTotal
    End Function 
    
    '[!] <pay attention note: important>
    'DIR_List required ()
    'LL functions also required ()
    
    LLDirList.jpg
    Last edited by kryton9; 07-05-2017 at 12:15.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

Similar Threads

  1. A search engine that understand your language
    By ErosOlmi in forum Technology
    Replies: 0
    Last Post: 15-05-2008, 08:04

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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