Directory information
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 37
- Joined: Fri Sep 09, 2011 10:04 am
Directory information
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.
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
Re: Directory information
Dag Informatie (wat een geraffineerde naam
)
thanks for the stack, quite helpful!
Some hints:
Groetjes
Klaus

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
...
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 37
- Joined: Fri Sep 09, 2011 10:04 am
Re: Directory information
Updated the code and thx to klaus changed some mistakes.
added a matrix to get an overview.
added a matrix to get an overview.
- Attachments
-
- DirectoryInformatie.livecode.zip
- versie 2
- (4.8 KiB) Downloaded 202 times
Re: Directory information
Hi Informatie,
sorry still some more inconveniences
You need to use the CODE of the Mac folders, not the descriptions!
And please use QUOTES around all names all the time
But these three folders will only work on OS <=9 and return empty on OS X.
Best
Klaus
sorry still some more inconveniences

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

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
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 37
- Joined: Fri Sep 09, 2011 10:04 am
Re: Directory information
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.
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.
Re: Directory information
OK, I understand that, but using QUOTES for names is definitively the OFFICIAL and thus correct snytax.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.
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
-
- VIP Livecode Opensource Backer
- Posts: 37
- Joined: Fri Sep 09, 2011 10:04 am
Re: Directory information
I have updated the code, to make it more complete.
Let me think it's useful or missing some information
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
Re: Directory information
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"
Best
Klaus
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"

Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 37
- Joined: Fri Sep 09, 2011 10:04 am
Re: Directory information
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