Simple Noob question - may be why I'm so confused and lost

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
BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Simple Noob question - may be why I'm so confused and lost

Post by BarrySumpter » Sun Aug 28, 2011 7:38 am

Code: Select all

      
      -- why does this work
      set the defaultFolder to specialFolderPath("engine")
      put defaultFolder into theFolderName
      answer theFolderName  -- works on win32 showing a path
      
      -- but this doesn't
      put specialFolderPath("engine") into theFolderName
      answer theFolderName  -- shows blank win32
      -- this script may be why my research tests are off

All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Simple Noob question - may be why I'm so confused and lost

Post by Dixie » Sun Aug 28, 2011 8:04 am

Barry…

In the first block of your code you are setting the folder, i.e. the starting location from where you wish to start manipulating files and/or folders. In the second block of your code you are just calling the specialFolderPath() function but have not given it anything to work with, as it were.

Dixie

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Simple Noob question - may be why I'm so confused and lost

Post by BarrySumpter » Sun Aug 28, 2011 8:19 am

Dixie wrote: ...
In the second block of your code you are just calling the specialFolderPath() function but have not given it anything to work with, as it were.
...
Hi Dixie,
Thanks heaps for replying.

I'm not following at the moment.
Is there any way you could expand on that reply.

I had deduced that all variables are strings of characters.
Perhaps both the defaultFolder is something more thans a string
and the specialFolderPath returns something more than a string?

I found this examle in the dictionary:

Code: Select all

put specialFolderPath("asup") into appSupportFolder
So I had deduced my script should work.

Code: Select all

put specialFolderPath("engine") into theFolderName
Any further comment would be greatly appreciated.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Simple Noob question - may be why I'm so confused and lost

Post by Dixie » Sun Aug 28, 2011 8:49 am

Barry...

Try this...

Code: Select all

   put specialFolderPath("engine") & slash into tFolderName
   put tFolderName
It will show "/"... that you are at the folder containing the standalone engine, so from here you could carry on building a path to various resources that had been copied to the 'engine' folder when the standalone was built... So..

Code: Select all

   put specialFolderPath("engine") & slash & "barrysFolder/barrysText.txt" into tFolderName
   put tFolderName
would give you the path to 'barrysText.txt' file in the form of .... /barrysFolder/barrysText.txt... that was placed there when you built your app.

Dixie

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Simple Noob question - may be why I'm so confused and lost

Post by BarrySumpter » Sun Aug 28, 2011 9:18 am

...at the folder containing the standalone engine...
Well thats embarassing.
So specialFolderPath ("engine") means standalone engine.
Instead of Standalone Application.
Even though the IDE browser mode doesn't have a standalone engine.
OK. I was just accepting the fact that specialFolderPath("engine") means the app .exe path.
Now I understand the reason.
Thanks heaps for that.

I know I keep reading "its relative".
And I've always wanted to see it fully qualified.
So I can chase down my files using a file explorer.

Dinner guests. Can't finish. Gotta run for tonigh.

Thanks again for you support and patience.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

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

Re: Simple Noob question - may be why I'm so confused and lost

Post by Klaus » Sun Aug 28, 2011 10:54 am

specialfolderpath("engine")

This will currently only work on iOS and ANDROID, as undoubtfully stated in the LiveCode dictionary!

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Simple Noob question - may be why I'm so confused and lost

Post by BarrySumpter » Sun Aug 28, 2011 12:48 pm

I don't understand why this is so hard.
I'm starting to think like I'm in over my head again.

Is this script returning an error under win32 and I don't see it cause I'm not trapping for errors?
Or simply not updating the defaultFolder.

Code: Select all

set the defaultFolder to specialFolderPath("engine")
And since there is always something in defaultFolder
this script will always return something?

Code: Select all

    put defaultFolder into  theFolderName
    answer theFolderName
If the folder is not found, the specialFolderPath function returns empty.
If the folderIdentifier is either not supported on the current platform
or doesn't exist on the current system, the result is set to folder not found.

Found it:
set the defaultFolder to specialFolderPath("engine")
answer the result
-- on win32 returns: can't open directory

So, to me, set the defaultFolder to specialFolderPath("engine")
does execute on win32
but returns an error in 'the result'

I wonder which other LiveCode commands do this and I'm missing them.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Post Reply