Code sharer

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
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Code sharer

Post by MaxV » Mon May 12, 2014 4:54 pm

Hello,
I'm writing a software to share Livecode scripts with syntax highlithing. I obtained my goal on HTML, now I'm upgrading it with phpbb version (like this forum). This is a possible result:

on mouseUp
#copy text
set the text of field field1 to temp
copy word 1 to -1 of field field1
set the visible of field "avviso" to true
wait 1 second
set the visible of field "avviso" to false
end mouseUp

Do you have any idea to mantain code indentation (spaces)? :?:
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Code sharer

Post by magice » Mon May 12, 2014 7:00 pm

I'm not sure if this will work or not, but maybe something like this:

Code: Select all

replace space  with "   " in myVariable

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Code sharer

Post by MaxV » Tue May 13, 2014 10:35 am

No, it works only on html, not on this forum.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Code sharer

Post by LCNeil » Tue May 13, 2014 12:21 pm

Hi Max,

Its a great idea to have code indentation in forum post. Unfortunately, the default phpBB install does not support indentation/tabs but I have since added a custom indent BBCode that allows indentation. This is should now be available from the custom BBcode menu bar. If you wish to add this to your LiveCode script, the following is the code used

Code: Select all

  [indent]20[/indent]
Please see below your script with indentation applied-


on mouseUp
#copy text
set the text of field field1 to temp
copy word 1 to -1 of field field1
set the visible of field "avviso" to true
wait 1 second
set the visible of field "avviso" to false
end mouseUp


Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Code sharer

Post by MaxV » Tue May 13, 2014 4:04 pm

PERFECT! Great idea! Thank you! :D
You can see the result here: http://forums.runrev.com/viewtopic.php?f=9&t=20389
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Code sharer

Post by MaxV » Tue May 13, 2014 4:40 pm

Today I can't upload script on http://livecodeshare.runrev.com/ (using revonline), however the stack code sharer is here: https://www.dropbox.com/s/a8ow1xk1iluln ... r.livecode
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Code sharer

Post by MaxV » Wed Nov 02, 2016 12:21 pm

LCNeil wrote:Hi Max,

Its a great idea to have code indentation in forum post. Unfortunately, the default phpBB install does not support indentation/tabs but I have since added a custom indent BBCode that allows indentation. This is should now be available from the custom BBcode menu bar. If you wish to add this to your LiveCode script, the following is the code used

Code: Select all

  [indent]20[/indent]
...
Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——
Hi Neil,
what do you think of http://qbnz.com/highlighter/ ? It's a mod for phpbb to add sytax highlighting to every code posted (it supports over 100 programming languages).
If you confirm me that it could be applied to this forum, I could start to work on the livecode parser file.
Please let me know
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Code sharer

Post by [-hh] » Wed Nov 02, 2016 9:27 pm

@MaxV
Great code, as always ;-)

@Neil
The new indent-tag is really useful, one now doesn't has to use this often lists.
For single lines I used option-space (this works, is effectively your ' ').
Hope you are fine (and the LC user offspring).
shiftLock happens

Post Reply