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.
LLDirList.jpg'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 ()
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
Bookmarks