Newly created alias is not an alias

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Newly created alias is not an alias

Alain Farmer
Hello,
I am using version 6.6.2
I am perplexed by the following:

   setDirectoryTo someFolder
   create alias "myAlias" to folder "existingFolder"
   if the result is not empty then die the result
   answer there is an alias "myAlias" -- returns false !?!
   answer there is an alias (someFolder & "myAlias") -- returns false !?!

Shouldn't the alias that I have just created test TRUE ?
Apparently the alias is not an alias.
It's the alias of a folder, and "there is a folder" returns true for the alias.
I 'get-it' but this is NOT useful.
I want to be able to distinguish between ALIAS and FOLDER (and FILE too).
Has anyone experienced this ?
Have you worked-out a workaround ?
Thank you,
Alain
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Newly created alias is not an alias

mwieder
Alain Farmer <alain_farmer@...> writes:

>    setDirectoryTo someFolder
>    create alias "myAlias" to folder "existingFolder"
>    if the result is not empty then die the result
>    answer there is an alias "myAlias" -- returns false !?!

I've never heard of a "there is an alias" reference. Instead try

create alias "myAlias" to folder "existingFolder"
if the aliasReference of "myAlias" is empty then
  die "it's not a reference!"
end if

--
 Mark Wieder
 [hidden email]



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
--
 Mark Wieder
 ahsoftware@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Newly created alias is not an alias

Kay C Lan
On Tue, Sep 2, 2014 at 7:29 AM, Mark Wieder <[hidden email]> wrote:
> I've never heard of a "there is an alias" reference. Instead try

The one true 'drawback' of a English like syntax; it certainly reads
like it should work ;-)

Of course LC's upcoming Open Language, will allow Alain to correct
this syntax shortfall and so you'll be able to say you heard it here
first ;-)

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Newly created alias is not an alias

Richmond Mathewson-2

On 2.09.2014 11:08, Kay C Lan wrote:

> On Tue, Sep 2, 2014 at 7:29 AM, Mark Wieder <[hidden email]> wrote:
>> I've never heard of a "there is an alias" reference. Instead try
> The one true 'drawback' of a English like syntax; it certainly reads
> like it should work ;-)
>
> Of course LC's upcoming Open Language, will allow Alain to correct
> this syntax shortfall and so you'll be able to say you heard it here
> first ;-)
>
>

Of course LC's upcoming Open Language will allow Alain to write
his code using French-like syntax . . .

Richmond.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Newly created alias is not an alias

Alain Farmer
In reply to this post by mwieder
Thank you, Mark, but the aliasReference is NEVER empty.

Therefore cannot use: if the aliasReference of it is empty
to test if something is an alias.:

on testAliases currentFolder

   --
   put currentFolder & "test/" into targetFolder
   put currentFolder & "test-alias" into aliasPath
   --

   if there is not a folder aliasPath then -- alias of a folder is a folder
      create alias aliasPath to folder targetFolder
      if the result is not empty then answer the result
   end if
   --
   answer aliasPath & cr & the aliasReference of aliasPath -- answers targetFolder
   answer targetFolder& cr & the aliasReference of targetFolder -- answers targetFolder -- instead of empty
   --
end testAliases



On Monday, September 1, 2014 7:29:56 PM, Mark Wieder <[hidden email]> wrote:
 


Alain Farmer <alain_farmer@...> writes:

>    setDirectoryTo someFolder
>    create alias "myAlias" to folder "existingFolder"
>    if the result is not empty then die the result
>    answer there is an alias "myAlias" -- returns false !?!

I've never heard of a "there is an alias" reference. Instead try

create alias "myAlias" to folder "existingFolder"
if the aliasReference of "myAlias" is empty then
  die "it's not a reference!"
end if

--
Mark Wieder
[hidden email]



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Newly created alias is not an alias

Alain Farmer
Explaining this has made me come-up with the solution:

function isAlias pathToAlias
   return the aliasReference of pathToAlias is not pathToAlias
end isAlias

on testAliases currentFolder
   --
   put currentFolder & "test/" into targetFolder
   put currentFolder & "test-alias" into aliasPath
   --
   if there is not a folder aliasPath then -- alias of a folder is a folder
      create alias aliasPath to folder targetFolder
      if the result is not empty then answer the result
   end if
   --
   answer isAlias(aliasPath) & cr & isAlias(targetFolder) -- answers: true & cr & false
   --
end testAliases



On Tuesday, September 2, 2014 2:18:04 PM, Alain Farmer <[hidden email]> wrote:
 


Thank you, Mark, but the aliasReference is NEVER empty.

Therefore cannot use: if the aliasReference of it is empty
to test if something is an alias.:

on testAliases currentFolder

   --
   put currentFolder & "test/" into targetFolder
   put currentFolder & "test-alias" into aliasPath
   --

   if there is not a folder aliasPath then -- alias of a folder is a folder
      create alias aliasPath to folder targetFolder
      if the result is not empty then answer the result
   end if
   --
   answer aliasPath & cr & the aliasReference of aliasPath -- answers targetFolder
   answer targetFolder& cr & the aliasReference of targetFolder -- answers targetFolder -- instead of empty
   --
end testAliases



On Monday, September 1, 2014 7:29:56 PM, Mark Wieder <[hidden email]> wrote:
 


Alain Farmer <alain_farmer@...> writes:

>    setDirectoryTo someFolder
>    create alias "myAlias" to folder "existingFolder"
>    if the result is not empty then die the result
>    answer there is an alias "myAlias" -- returns false !?!

I've never heard of a "there is an alias" reference. Instead try

create alias "myAlias" to folder "existingFolder"
if the aliasReference of "myAlias" is empty then
  die "it's not a reference!"
end if

--
Mark Wieder
[hidden email]



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Newly created alias is not an alias

Kay C Lan
In reply to this post by Alain Farmer
On Wed, Sep 3, 2014 at 2:18 AM, Alain Farmer <[hidden email]> wrote:
> Thank you, Mark, but the aliasReference is NEVER empty.
>
The Dictionary says:

Comments:
If the aliasPath does not exist, the aliasReference function returns
empty and the result is set to "can't get".

If you are seeing something different, submit a bug report.

http://quality.runrev.com/

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Newly created alias is not an alias

Alain Farmer
Hello Kay,
I tested it empirically.
In version 6.6.2, the aliasReference of a file/folder returns the path to file/folder itself; not empty as you suggest.
Either way, my function below works:

function isAlias pathToAlias
   return the aliasReference of pathToAlias is not pathToAlias
end isAlias


On Tuesday, September 2, 2014 11:33:14 PM, Kay C Lan <[hidden email]> wrote:
 


On Wed, Sep 3, 2014 at 2:18 AM, Alain Farmer <[hidden email]> wrote:
> Thank you, Mark, but the aliasReference is NEVER empty.
>
The Dictionary says:

Comments:
If the aliasPath does not exist, the aliasReference function returns
empty and the result is set to "can't get".

If you are seeing something different, submit a bug report.

http://quality.runrev.com/


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode