Directory information

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Informatie
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 37
Joined: Fri Sep 09, 2011 10:04 am

Directory information

Post by Informatie » Mon Oct 10, 2011 8:47 am

I created a simple program to show what your current directory structure is.

If nothing is shown the directory key word is not relevant for the env you run the progam in.

for me it was helpfull.
Attachments
DirectoryInformatie.livecode.zip
Directory information
(3.54 KiB) Downloaded 212 times

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Directory information

Post by Klaus » Mon Oct 10, 2011 12:01 pm

Dag Informatie (wat een geraffineerde naam :-) )

thanks for the stack, quite helpful!

Some hints:

Code: Select all

...
## Always use QUOTES around names -> ... fld "Enginepath"!
 put specialfolderpath("Engine") into field Enginepath

## This does not work!
## The engine presumes that enginepath is a variable!
## And since it has not been initialized in any way yet, its content is the string "enginepath"!
## So it is NOT empty and thus one does not see this dialog.
   if enginepath is empty then

## Use:
## if fld "Enginepath" = emtpty then...
      put "You are not running IOS" into enginepath
   end if
...
Groetjes

Klaus

Informatie
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 37
Joined: Fri Sep 09, 2011 10:04 am

Re: Directory information

Post by Informatie » Mon Oct 10, 2011 11:01 pm

Updated the code and thx to klaus changed some mistakes.

added a matrix to get an overview.
Attachments
DirectoryInformatie.livecode.zip
versie 2
(4.8 KiB) Downloaded 202 times

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Directory information

Post by Klaus » Tue Oct 11, 2011 3:29 pm

Hi Informatie,

sorry still some more inconveniences 8)

You need to use the CODE of the Mac folders, not the descriptions!
And please use QUOTES around all names all the time :D

Code: Select all

---- CONTROL
   put specialfolderpath("ctrl") into field "Controlpath"
   if field "Controlpath" is empty then
      put teerste &&t notrun &&t m && "," && tmo into field "Controlpath"
   end if
   
   ---- APPLE
      put specialfolderpath("aexƒ") into field "applepath"
         if field "applepath" is empty then
      put teerste && tnotrun && tm into field "applepath"
   end if
   
   ---- EXTENSION
      put specialfolderpath("extn") into field "extensionpath"
      if field "extensionpath" is empty then
      put teerste && tnotrun && tm into field "extensionpath"
   end if
But these three folders will only work on OS <=9 and return empty on OS X.


Best

Klaus

Informatie
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 37
Joined: Fri Sep 09, 2011 10:04 am

Re: Directory information

Post by Informatie » Wed Oct 12, 2011 10:11 am

THX Klaus,

You are right the QUOTES I have forgotten, but LC doesn't seem to bother, strange for a learning newby and learning fast.
I'll follow teh academy now.

I'll make the changes and walk through the code again.

DJ
Platform MAC OSX, snow leopard.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Directory information

Post by Klaus » Wed Oct 12, 2011 11:34 am

Informatie wrote:THX Klaus,

You are right the QUOTES I have forgotten, but LC doesn't seem to bother, strange for a learning newby and learning fast.
OK, I understand that, but using QUOTES for names is definitively the OFFICIAL and thus correct snytax.

The engine may be forgiving in smaller projects, but it MAY bite you when you least exspect it!
I have bitten by my sloppiness in a similar case in the past, that's why I'm "evangelizing" this so passionately ;-)


Bset

Klaus

Informatie
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 37
Joined: Fri Sep 09, 2011 10:04 am

Re: Directory information

Post by Informatie » Sat Oct 29, 2011 6:07 am

I have updated the code, to make it more complete.
Let me think it's useful or missing some information
Attachments
DirectoryInformatie.livecode_14.zip
Directory information 1.4
(6.76 KiB) Downloaded 260 times

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Directory information

Post by Klaus » Sat Oct 29, 2011 12:26 pm

Hi DJ,

OK, just a tiny cosmetic thing:
"Empty because you are not running Mac OS < 9"

Should read:
"Empty because you are not running Mac OS < 10"
8)


Best

Klaus

Informatie
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 37
Joined: Fri Sep 09, 2011 10:04 am

Re: Directory information

Post by Informatie » Sat Oct 29, 2011 9:09 pm

Thz klaus again I'll like this it's a good learning curve.
Attachments
DirectoryInformatie.livecode_15.zip
CHANGED THE < 9 IN <10
(6.88 KiB) Downloaded 277 times

Post Reply