save stack as filename failing most of the time

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

save stack as filename failing most of the time

Dr. Hawkins
I have a routine that I haven't used in probably over a year to prepare for
compilation.

In it, it pulls the filename of the stack, and adds "to_compile." in a
variable.

So far, so good.

But then

save stack "mcp" as filNam

fails about three times out of four.

*something* happens, as I can see the finder window flicker, but I can't
tell what it is.

filNam is something like
/Users/hawk/Documents/dhbk/16/1612/161230/dochawkbk.161230a.to_compile.livecode

yet no such file is there.


--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
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: save stack as filename failing most of the time

Dr. Hawkins
Just saw it happen.

Apparently, it is simply ignoring the new name--I see the ~ stack renaming,
and then the new stack is created with the original name, not the contents
of filNam, and the ~ stack deleted.
--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
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: save stack as filename failing most of the time

Rick Harrison
I just tried the save statement from within a stack
and I too have found that the stack is not getting saved!
Has anyone reported this as bug?  Is there a work around?

Thanks,

Rick

> On Dec 30, 2016, at 6:06 PM, Dr. Hawkins <[hidden email]> wrote:
>
> Just saw it happen.
>
> Apparently, it is simply ignoring the new name--I see the ~ stack renaming,
> and then the new stack is created with the original name, not the contents
> of filNam, and the ~ stack deleted.
> --
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> _______________________________________________
> 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: save stack as filename failing most of the time

Dr. Hawkins
On Tue, Jan 3, 2017 at 2:01 PM, Rick Harrison <[hidden email]>
wrote:

> I just tried the save statement from within a stack
> and I too have found that the stack is not getting saved!
> Has anyone reported this as bug?  Is there a work around?
>

This one was so bizarre that I need to make sure I wasn't crazy.

Now *Bug 19042* <http://quality.livecode.com/show_bug.cgi?id=19042> - "save
as" reserves stack with same filename

"save as" would be my goto  for a workaround, but that obviously won't do
it . . .

maybe send a sequence to the shell to move the old stack to a new name,
then save, then another shell to rename the new stack, and another to move
the original back?
--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
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: save stack as filename failing most of the time

Bob Sneidar-2
In reply to this post by Rick Harrison
Not sure this helps you but I use Save this stack all the time and I can see the stack in the finder append a tilde (~), create a new stack file then the file with the tilde goes away. My changes are always there afterwards.

Bob S


On Jan 3, 2017, at 14:01 , Rick Harrison <[hidden email]<mailto:[hidden email]>> wrote:

I just tried the save statement from within a stack
and I too have found that the stack is not getting saved!
Has anyone reported this as bug?  Is there a work around?

Thanks,

Rick

_______________________________________________
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: save stack as filename failing most of the time

Dr. Hawkins
On Tue, Jan 3, 2017 at 3:38 PM, Bob Sneidar <[hidden email]>
wrote:

> Not sure this helps you but I use Save this stack all the time and I can
> see the stack in the finder append a tilde (~), create a new stack file
> then the file with the tilde goes away. My changes are always there
> afterwards.
>

That's what's happening here--but it shouldn't be.  On a save-as, there is
no reason to move the old file; it should be proceeding directly to writing
the new filename.



--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
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: save stack as filename failing most of the time

Dr. Hawkins
Now I'm seeing "put" fail to put things in the message box, which I suspect
is related.

And the application browser insists that there is a substack to one of my
stacks that shouldn't be there.  It strives saving and duplication, but
when I open that stack by itself, it shows no sub stack.  "the sub stacks
of" also reveals no substack.

--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
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: save stack as filename failing most of the time

J. Landman Gay
On 1/4/17 4:37 PM, Dr. Hawkins wrote:
> "the sub stacksof" also reveals no substack.

Is that a typo? Does "substacks of" also fail?

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.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: save stack as filename failing most of the time

Dr. Hawkins
On Wed, Jan 4, 2017 at 3:39 PM, J. Landman Gay <[hidden email]>
wrote:

> On 1/4/17 4:37 PM, Dr. Hawkins wrote:
>
>> "the sub stacksof" also reveals no substack.
>>
>
> Is that a typo? Does "substacks of" also fail?
>

failed autocorrect?

It was actually "substacks of"


--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
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: save stack as filename failing most of the time

Brian Milby via use-livecode
In reply to this post by J. Landman Gay

> On Jan 3, 2017, at 6:38 PM, Bob Sneidar <[hidden email]> wrote:
>
> Not sure this helps you but I use Save this stack all the time and I can see the stack in the finder append a tilde (~), create a new stack file then the file with the tilde goes away. My changes are always there afterwards.
>
> Bob S
>

Hi again,

1. Create a new stack

2. Put a button on it.

3. Edit the button to insert the following code:

on mouseUp

save this stack as  “TestSaveStack"

end mouseUp


4. Test the button

It just doesn’t work at all.  No stack gets saved!

I’m using LC Indy version 8.1.2










_______________________________________________
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: save stack as filename failing most of the time

Brian Milby via use-livecode
If you change it to
on mouseup
save this stack as "TestSaveStack"
put it && the result
put cr & the files after msg
end mouseup
does it return an error?
If not, does it show the file?

If the default folder is set to an unwritable folder you should receive an
error. If not, you should see the saved stack in the files.
the defaultfolder on startup (windows) seems to be
C:/Users/myUserName/AppData/Local/RunRev/Documentation
Cache/9_0_0_dp_1_community/IDE

Not exactly where one would look for it. Also, the "recent files" of the
file menu doesn't reflect the save.

On Thu, Jan 5, 2017 at 9:20 AM, Rick Harrison via use-livecode <
[hidden email]> wrote:

>
> > On Jan 3, 2017, at 6:38 PM, Bob Sneidar <[hidden email]>
> wrote:
> >
> > Not sure this helps you but I use Save this stack all the time and I can
> see the stack in the finder append a tilde (~), create a new stack file
> then the file with the tilde goes away. My changes are always there
> afterwards.
> >
> > Bob S
> >
>
> Hi again,
>
> 1. Create a new stack
>
> 2. Put a button on it.
>
> 3. Edit the button to insert the following code:
>
> on mouseUp
>
> save this stack as  “TestSaveStack"
>
> end mouseUp
>
>
> 4. Test the button
>
> It just doesn’t work at all.  No stack gets saved!
>
> I’m using LC Indy version 8.1.2
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> 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: save stack as filename failing most of the time

Brian Milby via use-livecode
Hi Mike,

Using your code in the button shows in the message box
TestSaveStack

Which is the name of the file.

Searching my entire hard drive doesn’t show
any file named “TestSaveStack”.

There is no error reported for "the result”.

Rick


> On Jan 5, 2017, at 11:32 AM, Mike Bonner via use-livecode <[hidden email]> wrote:
>
> If you change it to
> on mouseup
> save this stack as "TestSaveStack"
> put it && the result
> put cr & the files after msg
> end mouseup
> does it return an error?
> If not, does it show the file?
>
> If the default folder is set to an unwritable folder you should receive an
> error. If not, you should see the saved stack in the files.
> the defaultfolder on startup (windows) seems to be
> C:/Users/myUserName/AppData/Local/RunRev/Documentation
> Cache/9_0_0_dp_1_community/IDE
>
> Not exactly where one would look for it. Also, the "recent files" of the
> file menu doesn't reflect the save.
>
> On Thu, Jan 5, 2017 at 9:20 AM, Rick Harrison via use-livecode <
> [hidden email]> wrote:
>
>>
>>> On Jan 3, 2017, at 6:38 PM, Bob Sneidar <[hidden email]>
>> wrote:
>>>
>>> Not sure this helps you but I use Save this stack all the time and I can
>> see the stack in the finder append a tilde (~), create a new stack file
>> then the file with the tilde goes away. My changes are always there
>> afterwards.
>>>
>>> Bob S
>>>
>>
>> Hi again,
>>
>> 1. Create a new stack
>>
>> 2. Put a button on it.
>>
>> 3. Edit the button to insert the following code:
>>
>> on mouseUp
>>
>> save this stack as  “TestSaveStack"
>>
>> end mouseUp
>>
>>
>> 4. Test the button
>>
>> It just doesn’t work at all.  No stack gets saved!
>>
>> I’m using LC Indy version 8.1.2
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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

_______________________________________________
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: save stack as filename failing most of the time

Brian Milby via use-livecode
Hi all,

> Am 05.01.2017 um 18:47 schrieb Rick Harrison via use-livecode <[hidden email]>:
>
> Hi Mike,
>
> Using your code in the button shows in the message box
> TestSaveStack
>
> Which is the name of the file.
>
> Searching my entire hard drive doesn’t show
> any file named “TestSaveStack”.
>
> There is no error reported for "the result”.
>
> Rick

just made a test with LC 8.1.2 and 9.0 dp4 and both of these scripts result in a livecode stack on my desktop!

1.
...
put specialfolderpath("desktop") & "/teststack.livecode" into tFileName
save this stack as tFilename
...

2.
...
set the filename of this stack to (specialfolderpath("desktop") & "/teststack.livecode")
save this stack
...

macOS 10.12.2


Best

Klaus
--
Klaus Major
http://www.major-k.de
[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
Reply | Threaded
Open this post in threaded view
|

Re: save stack as filename failing most of the time

Brian Milby via use-livecode
In reply to this post by Brian Milby via use-livecode
On Thu, Jan 5, 2017 at 9:47 AM, Rick Harrison via use-livecode <
[hidden email]> wrote:

>
> Searching my entire hard drive doesn’t show
> any file named “TestSaveStack”.
>

Do you get the same result if you make a stack in a known location, perhaps
InitialTestStack, and then use the button.

What I see is the stack saving under it's original name.

Also, yesterday the first time I hit this line of code, it worked properly,
and failed every time after that.

--
Dr. Richard E. Hawkins, Esq.
(702) 508-8462
_______________________________________________
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: save stack as filename failing most of the time

Brian Milby via use-livecode
In reply to this post by Brian Milby via use-livecode
Since there is no error, and it shows "TestSaveStack" my guess is it IS
saving the file correctly, but a folder along the way to where the file is
saved is hidden (hence being unsearchable.)  If you set the folder to a
known location (prior to the save) and then save it, it will probably be
right where you expect.
Or if you specify a full path, that will probably work too.

Am I the only one who saves the current filename of the stack (assuming it
has one)  sets the filename, tell it to save itself, and reset the filename
back to the original?  Actually nevermind, I see Klaus did it both ways.

On Thu, Jan 5, 2017 at 10:47 AM, Rick Harrison via use-livecode <
[hidden email]> wrote:

> Hi Mike,
>
> Using your code in the button shows in the message box
> TestSaveStack
>
> Which is the name of the file.
>
> Searching my entire hard drive doesn’t show
> any file named “TestSaveStack”.
>
> There is no error reported for "the result”.
>
> Rick
>
>
> > On Jan 5, 2017, at 11:32 AM, Mike Bonner via use-livecode <
> [hidden email]> wrote:
> >
> > If you change it to
> > on mouseup
> > save this stack as "TestSaveStack"
> > put it && the result
> > put cr & the files after msg
> > end mouseup
> > does it return an error?
> > If not, does it show the file?
> >
> > If the default folder is set to an unwritable folder you should receive
> an
> > error. If not, you should see the saved stack in the files.
> > the defaultfolder on startup (windows) seems to be
> > C:/Users/myUserName/AppData/Local/RunRev/Documentation
> > Cache/9_0_0_dp_1_community/IDE
> >
> > Not exactly where one would look for it. Also, the "recent files" of the
> > file menu doesn't reflect the save.
> >
> > On Thu, Jan 5, 2017 at 9:20 AM, Rick Harrison via use-livecode <
> > [hidden email]> wrote:
> >
> >>
> >>> On Jan 3, 2017, at 6:38 PM, Bob Sneidar <[hidden email]>
> >> wrote:
> >>>
> >>> Not sure this helps you but I use Save this stack all the time and I
> can
> >> see the stack in the finder append a tilde (~), create a new stack file
> >> then the file with the tilde goes away. My changes are always there
> >> afterwards.
> >>>
> >>> Bob S
> >>>
> >>
> >> Hi again,
> >>
> >> 1. Create a new stack
> >>
> >> 2. Put a button on it.
> >>
> >> 3. Edit the button to insert the following code:
> >>
> >> on mouseUp
> >>
> >> save this stack as  “TestSaveStack"
> >>
> >> end mouseUp
> >>
> >>
> >> 4. Test the button
> >>
> >> It just doesn’t work at all.  No stack gets saved!
> >>
> >> I’m using LC Indy version 8.1.2
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> 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
>
> _______________________________________________
> 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: save stack as filename failing most of the time

Brian Milby via use-livecode
In reply to this post by Brian Milby via use-livecode
Hi again,

Ok, so first looked at the settings for the defaultFolder,
and then I set the defaultFolder to where I wanted
everything to be saved.  I chose to use my desktop
to be super easy.  

It turned out that the defaultFolder somehow strangely
got set to a RunRev Application Support folder within
the Library folder, and yes it was a hidden folder, so
that did explain why the search of my hard drive didn’t
reveal the location of the newly created stack.

So upon choosing and setting the default folder to
be the desktop, the stack then saved as promised
to my desktop to my great relief.

Thank you folks for your help and patience on this!
No need for a bug report.

Rick
_______________________________________________
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: save stack as filename failing most of the time

Brian Milby via use-livecode
livecode has been unable to reproduce the bug.  Could someone who was able
to make a stack to manifest this please upload?

*Comment # 1 <http://quality.livecode.com/show_bug.cgi?id=19042#c1> on bug
19042 <http://quality.livecode.com/show_bug.cgi?id=19042> from Panos
Merakos <[hidden email]>*

Hi Richard,

Thank you for the report. I have tried to reproduce this bug with no success. I
have created a stack called "panos.livecode" with a button with the following
script:

on mouseUp
  save this stack as "/Users/panos/Desktop/panos.to_compile.livecode"
end mouseUp

Clicking the button creates a new "panos.to_compile.livecode" stack on Desktop
folder.

Can you please attach a sample stack that demonstrates the problem for you?

Best regards,
Panos
_______________________________________________
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: save stack as filename failing most of the time

Brian Milby via use-livecode
I tried, but it works fine for me every time in LC8.1.2 (Build 14013) (I no longer have RC3 installed), on MacOS Sierra 10.12.2.

This is the test script I used:

on mouseUp

put"/Users/paulhibbert/Documents/001 Test Folder/paultest.xx.to.Compile.livecode" into tFileName

replace "xx" with char -4 to -1 of the seconds in tFileName

save stack "paultest" as tFileName

if the result is empty then

answer "Success!"

else

answer "Save Failed!" && the result

end if

end mouseUp


Initially I tried with the same file name, just overwriting each time, that never failed, so I added the last four digits of the seconds to make a more unique name, but that never failed either. I also tried this from within the test stack, and then with a separate stack to issue the save command, they both worked fine too.

If there’s anything else you can think that is worth trying, just ask.

Paul

> On 10 Jan 2017, at 07:45, Dr. Hawkins via use-livecode <[hidden email]> wrote:
>
> livecode has been unable to reproduce the bug.  Could someone who was able
> to make a stack to manifest this please upload?
>
> *Comment # 1 <http://quality.livecode.com/show_bug.cgi?id=19042#c1> on bug
> 19042 <http://quality.livecode.com/show_bug.cgi?id=19042> from Panos
> Merakos <[hidden email]>*
>
> Hi Richard,
>
> Thank you for the report. I have tried to reproduce this bug with no success. I
> have created a stack called "panos.livecode" with a button with the following
> script:
>
> on mouseUp
>  save this stack as "/Users/panos/Desktop/panos.to_compile.livecode"
> end mouseUp
>
> Clicking the button creates a new "panos.to_compile.livecode" stack on Desktop
> folder.
>
> Can you please attach a sample stack that demonstrates the problem for you?
>
> Best regards,
> Panos
> _______________________________________________
> 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