Delete stack problem

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
adxsoft
Posts: 26
Joined: Wed Apr 11, 2018 12:25 pm

Delete stack problem

Post by adxsoft » Thu Apr 26, 2018 1:06 pm

Background to my question

I have modified the great 'Script Reporter' app to additionally bulk export scripts from my .livecode and .rev files in a folder called "My Projects". I scrape the Script Reporter output for each livecode/rev application into individual text files and an overall text file. Each export text file is timestamped and there is a text comparison card added to review differences between versions of my scripts.

The stack for each livecode/rev file is opened using 'go invisible'. The scripts within the newly loaded stack are retrieved and the stack is then closed (so it remains in memory).

Once all the livecode/rev files have been processed there is a repeat loop which deletes all the stacks in memory (except Script Reporter itself)

The Problem


Whenever a stack is opened and the stack name is the same as a previously loaded stack a prompt displays asking whether to purge the previous stack with the same name. this requires the user to click the 'Purge' button.

I would like to avoid this by deleting the previous stack from memory before loading the next livecode/rev file to stop the Purge prompt from coming up.

I have tried ...

a) 'delete stack nameofpreviouslyloadedstack' before I load the next file but it does not remove the previous stack from memory. Tried this in LC 8.1.8 and LC 9.0.0

b) replacing 'close stack x' with 'delete stack x' but Purge message still comes up

Any ideas would be appreciated

Cheers
Allan at ADXSoft

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Delete stack problem

Post by FourthWorld » Thu Apr 26, 2018 3:32 pm

Be sure to use delete only on mainstacks. And probably best after first closing all substacks. Beyond that we'd need to see the code, or better, a simplified example that exhi the problem.

What do you do with these script reports?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

adxsoft
Posts: 26
Joined: Wed Apr 11, 2018 12:25 pm

Delete stack problem

Post by adxsoft » Fri Apr 27, 2018 1:26 am

Thanks for the fast reply.

Strangely the delete stacks are working as expected once I have saved the app as a standalone Mac app. Its only when I run the code in the IDE the warning prompts for save, purge or cancel occur on opening stacks. Maybe its a timing situation.

Anyway I have a reasonable working application now.

Attached is the livecode app which is a modification of the Script Reporter app with an extra icon called 'Open Folder". Open a folder with .livecode or .rev files and choose 'Extract" and then "Continue" and it should create a folder "**Script History" and a folders for each .livecode/.rev file with a timestamped script report.

Note the EXAMINE option is still experimental. It is trying to do side by side comparisons and it very slow on large scripts.

---------------------

I use the extracted script reports of the code in my livecode/rev apps for
- timed snapshots of scripts for version history and comparison.
- searching via spotlight or Easyfind on Mac
- locating any apps where I have some reusable code

Each timestamped .livecode or .rev script report from the source folder is placed in a folder with the name "MyAppName Scripts" eg myLivecodeApp Scripts.

All reports are concatenated into an overall timestamped report and stored in a folder called "**Script History" in the source folder

I realise that this is not true version control but at least it gives me the information to easily rebuild an app or trace its history.
Attachments
Script Reporter ADXSoft Mods v1-2.livecode.zip
(109.7 KiB) Downloaded 192 times

Post Reply

Return to “Talking LiveCode”