export source code stack
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 142
- Joined: Thu Feb 21, 2013 8:47 am
export source code stack
Hi,
is there a plugin or any other 'easy' way to export all source of a live code stack.
Thanks for any answer.
Regards,
Marc
is there a plugin or any other 'easy' way to export all source of a live code stack.
Thanks for any answer.
Regards,
Marc
-
- VIP Livecode Opensource Backer
- Posts: 4015
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: export source code stack
Hi Marc,
if you are looking for a tool that lists all scripts of a stack then there is
http://livecodeshare.runrev.com/
look for "script reporter"
Kind regards
Bernd
if you are looking for a tool that lists all scripts of a stack then there is
http://livecodeshare.runrev.com/
look for "script reporter"
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 142
- Joined: Thu Feb 21, 2013 8:47 am
Re: export source code stack
Thank you Bernd,
I will have to get used to looking in livecodeshare. Especially now it is getting revamped
Regards,
Marc
I will have to get used to looking in livecodeshare. Especially now it is getting revamped
Regards,
Marc
-
- VIP Livecode Opensource Backer
- Posts: 48
- Joined: Sat May 24, 2008 2:27 pm
- Location: Indiana, USA
Re: export source code stack
I haven't been able to get 'Script Reporter' to work with Livecode 7. Has anyone been able to get it to work or is there any other program that would export all the source code for the stacks.
-
- VIP Livecode Opensource Backer
- Posts: 4015
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: export source code stack
Hi Thomas,
There are two "scriptReporters" in livecodeshare.
One is by the original author Stewart Lynch from 2009, that one works reasonably fast.
And a second one by David Glass from 2011. David took Stewart's stack and did some cosmetic changes to it (among those to set the font and fontSize, which is slow)
You have the option to try "ScriptReporter" from Stewart or block line
378 in the stack script of script reporter by David in handler "getScript"
--formatScript "Display"--field "AllScripts"
text will not be the size and font of the preferences that you can select in David's stack.
Or you could be very patient...
Kind regards
Bernd
it works but is very slow because for longer scripts it changes text font and size for every line. That is slow in LC 7.I haven't been able to get 'Script Reporter' to work with Livecode 7
There are two "scriptReporters" in livecodeshare.
One is by the original author Stewart Lynch from 2009, that one works reasonably fast.
And a second one by David Glass from 2011. David took Stewart's stack and did some cosmetic changes to it (among those to set the font and fontSize, which is slow)
You have the option to try "ScriptReporter" from Stewart or block line
378 in the stack script of script reporter by David in handler "getScript"
--formatScript "Display"--field "AllScripts"
text will not be the size and font of the preferences that you can select in David's stack.
Or you could be very patient...
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 4015
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: export source code stack
Thomas,
there is another thing that does not work as expected when dispalying all scripts:
in the stack script replace function GetIconVal with the script below:
it now looks for space instead of ">".
it will then list the object names. This applies to both "ScriptReporters" and works in 6.7.5 rc 2 and 7.0.5 rc2
Kind regards
Bernd
there is another thing that does not work as expected when dispalying all scripts:
in the stack script replace function GetIconVal with the script below:
Code: Select all
function GetIconVal lnNo
put the htmltext of of line LnNo of fld Display into dta
put offset("src=",dta) + 5 into st
put offset(" ",dta,st) into fn
return char st to st + fn-2 of dta
end GetIconVal
it will then list the object names. This applies to both "ScriptReporters" and works in 6.7.5 rc 2 and 7.0.5 rc2
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 48
- Joined: Sat May 24, 2008 2:27 pm
- Location: Indiana, USA
Re: export source code stack
I made the changes and now trying to have it output the source of a simple 'clock' app (as a test before running it on an important file) - and it has been running for ~2 hrs. How long should it take to do this ?
-
- VIP Livecode Opensource Backer
- Posts: 4015
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: export source code stack
Hi Thomas,
you found a bug in ScriptReporter. In one of your graphics script there were only two empty lines. Script reporter chokes on this script because
never leaves the repeat loop
I added this to the code
It now handles multiple empty lines as the only content of a variable graciously
What I meant with "very patient" was not 2 hours but more like a minute or two.
I upload your edited ScriptReporter with above addition.
Please tell us if this works for you.
Kind regards
Bernd
you found a bug in ScriptReporter. In one of your graphics script there were only two empty lines. Script reporter chokes on this script because
Code: Select all
repeat while the number of words in line -1 of tScript = 0
delete last line of tScript
end repeat
I added this to the code
Code: Select all
-- Sarah: remove any blank lines at the end & make sure there are enough to space entries
-- Bernd: added "AND the number of lines of tScript > 0" because it would run endlessly if script has only 2 empty lines in it
repeat while the number of words in line -1 of tScript = 0 AND the number of lines of tScript > 0
delete last line of tScript
end repeat
What I meant with "very patient" was not 2 hours but more like a minute or two.
I upload your edited ScriptReporter with above addition.
Please tell us if this works for you.
Kind regards
Bernd
- Attachments
-
- Script Reporter-EditedBN.livecode.zip
- (104.46 KiB) Downloaded 233 times
-
- VIP Livecode Opensource Backer
- Posts: 48
- Joined: Sat May 24, 2008 2:27 pm
- Location: Indiana, USA
Re: export source code stack
Thank you. I had to delete the substacks that were password protected - or else the program displayed an error on line 47 of stack "Script Reporter" with the error [stack "Script Reporter": execution error at line 47 (Stack: stack is password protected), char 20].bn wrote:Hi Thomas,
you found a bug in ScriptReporter. ... Please tell us if this works for you.
Kind regards
Bernd
Once I did that - since I didn't want the code of the password protected substacks (ChartMaker/flcDatePicker/Zygodact) - then the program worked wonderfully. It took about 3 minutes to display the code and about 10 minutes to print to PDF. But, I now have 192 pages of code and 6002 lines that I can view/review.
Again, thank you !
-
- VIP Livecode Opensource Backer
- Posts: 4015
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: export source code stack
Thomas,
3 minutes is too long, I changed the scripts again and reinstated the formatting. Now the preferences for display font/fontSize and print font/fontSize work again.
Since I also changed from going through each line of the field to set those text properties I resorted to set them in the styledText array. This speeds things up considerably.
It took about 2 seconds for displaying all scripts (after having been imported). Also changing text font/size in the preferences now takes about a couple of seconds for being displayed.
All the changes I made are in the stack script in handler "formatScript", I marked the changes.
I think this version of "ScriptReporter" is fast enough for Livecode 7 to be actually usable.
Kind regards
Bernd
3 minutes is too long, I changed the scripts again and reinstated the formatting. Now the preferences for display font/fontSize and print font/fontSize work again.
Since I also changed from going through each line of the field to set those text properties I resorted to set them in the styledText array. This speeds things up considerably.
It took about 2 seconds for displaying all scripts (after having been imported). Also changing text font/size in the preferences now takes about a couple of seconds for being displayed.
All the changes I made are in the stack script in handler "formatScript", I marked the changes.
I think this version of "ScriptReporter" is fast enough for Livecode 7 to be actually usable.
Kind regards
Bernd
- Attachments
-
- Script Reporter-EditedBN_2.livecode.zip
- (104.54 KiB) Downloaded 287 times
-
- VIP Livecode Opensource Backer
- Posts: 48
- Joined: Sat May 24, 2008 2:27 pm
- Location: Indiana, USA
Re: export source code stack
Yes, that works wonderfully.
Thank you so much !
Thank you so much !