Normal Topic @LocalListDirectory issue (Read 455 times)
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
@LocalListDirectory issue
May 17th, 2016 at 7:08pm
Print Post Print Post  
I've started to use the @LocalListDirectory command as I've found it very convenient and easy to use.

I've run into one problem.  It seems this command will not work with one of my directories.  Are there certain conditions that will block this command from working properly?

Any help would be very welcome.
  
Back to top
 
IP Logged
 
NHUser
Full Member
***
Offline



Posts: 320
Location: Amherst, NH
Joined: Aug 2nd, 2010
Re: @LocalListDirectory issue
Reply #1 - May 18th, 2016 at 8:10pm
Print Post Print Post  
I've discovered the problem.  I was using the @LocalListDirectory command, then immediately used a "writeln()" command to see what was in the directory.

Unfortunately, there were so many files in the directory that the writeln() command became active before the @LocalListDirectory command was completed. 

I proved it by moving most of the files to a temporary directory and the command and the writeln() command worked fine.
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: @LocalListDirectory issue
Reply #2 - May 18th, 2016 at 8:50pm
Print Post Print Post  
Hey Paul,

Nope. That wasn't the issue. @LocalListDirectory() and well all Sbasic commands finish before the code moves on.

I would bet a steak dinner that the issue was with the WriteLN call. When you call WriteLN(), it's under the hood essentially the same as calling

Write(Your Data)
Write(A Linefeed)

What Write does is if the Sesame Slate currently has over I wanna say 32 thousand characters in it(But I may be wrong on the number), it clears the window and then puts the data in there and displays it.

So what's happening is
Write(Large list of files)
Current size of data in slate is less than 32 thousand characters, so write the data and display it
Write(A Linefeed)
Current size of data in slate is greater than 32 thousand characters, so clear the slate, write the new data and display it

So you're left with a blank window as it only has the line feed character in it. If you were to call Write() instead of Writeln() after calling @LocalListDirectory() you should see that it works with the large number of files.

Edit: Just checked the source the limit is 32KB so 32768 characters.

-Ray
« Last Edit: May 19th, 2016 at 1:33pm by Ray the Reaper »  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged