Training Code in 10 Lines or Less

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm
Location: Las Vegas, NV

Training Code in 10 Lines or Less

Post by deeverd » Tue Jan 22, 2008 7:29 pm

Hello Everyone,

Last week, I learned that Revolution 1.0 used to be free for users who wanted to produce script that was 10 lines or less, but had to be purchased to make bigger programs with it.

To support that marketing idea, I understand that extensive documentation came with it to give new programmers lots of examples of what all could be done in 10 lines of script or less.

Therefore, I was wondering if anyone still has a copy of those short scripts? I'd like to use them to help train teachers and students to get into Revolution. It sounds like perfect training material.

All the best, deeverd

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Jan 22, 2008 8:17 pm

Hi Deeverd,

Yes, there was a starters kit that allowed non-registered users to write scripts of 10 lines long. No, there was no extensive documentation to it. The documentation was essentially the same that comes with Rev nowadays.

Generally, scripts that do everything within 10 lines are extremely complex. The starters kit was a good way for people to find out how Revolution works, but didn't allow for creating any serious tools, without using a lot of difficult workarounds.

People who want to learn more about programming with Revolution can check out the following:

http://forums.runrev.com/phpBB2/viewtop ... =3797#3797

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

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

Post by FourthWorld » Tue Jan 22, 2008 9:59 pm

Like Mark pointed out, trying to fit everything you want to do within just 10 lines requires some tricky scripting, and many tasks can't be done at all within that limit.

Rev offers a 30-day trial to get folks started, during which there are no limits at all.

And there's Rev Media for just $49, which provides full scripting with the only limitations being that it doesn't build standalones (there's a Rev Player to run stacks) and has a backdrop present at runtime.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm
Location: Las Vegas, NV

Post by deeverd » Tue Jan 22, 2008 10:52 pm

Hello,

I'd be the first to agree that Revolution Media is an awesome deal, and I'm not lamenting that there is no longer a free version of Revolution for programs of 10 lines or less.

I was just hoping there were some interesting scripts out there that weren't too long or complex, which would be valuable for training educators who are new to Revolution.

For instance, it's quite easy to write a randomizer in less than 10 lines for teachers who want to randomly assign the order of student report presentations, or to create an alphabetizer in 10 lines or less to turn any text into an alphabetical list so students can see the words that compose it, or lots of useful things that can be done with little scripting and that are good in the classroom.

I had read on the net (not on the forum) that there were many examples of scripts with 10 lines or less that came with the original program, so I just wanted to find out if those small sample projects still existed.

Cheers, deeverd

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

Post by FourthWorld » Wed Jan 23, 2008 12:53 am

I see. To help get you going I started to write a simple slide show example for you, but it took longer than 10 lines. Here it is anyway - it's very crude, but may serve as a starting point for more complete things:

--
-- Slide Show example script
--
--
on mouseUp
-- Get path to folder:
answer folder "Select a folder of image:"
if it is empty then exit to top
put it into tPath
--
-- Get list of files:
put the directory into tSaveDir
set the directory to tPath
put the files into tFiles
set the directory to tSaveDir
--
-- Set up slide show window:
put the rect of this stack into tSaveRect
set the rect of this stack to the screenrect
--
-- Create image object to show the files in:
if there is not an img 1 then create img
--
-- Show files one at a time:
repeat for each line tFile in tFiles
lock screen
set the filename of img 1 to (tPath &"/"& tFile)
set the loc of img 1 to the loc of this cd
unlock screen
wait 5 secs
-- Allow a way to exit the slide show:
if the mouseClick is "true" then exit repeat
end repeat
--
set the rect of this stack to tSaveRect
end mouseUp
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

deeverd
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 165
Joined: Mon Jul 16, 2007 11:58 pm
Location: Las Vegas, NV

Post by deeverd » Thu Jan 24, 2008 2:55 am

Hi Richard,

That's awesome. Thanks. I'll start putting some of my own short scripts together, too, and then maybe post a bunch of them in the education section of the forum for anyone else to use in a similar manner. Looking very forward to trying your slide show script.

All the best, deeverd

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

Post by FourthWorld » Thu Jan 24, 2008 4:43 pm

deeverd wrote:That's awesome. Thanks. I'll start putting some of my own short scripts together, too, and then maybe post a bunch of them in the education section of the forum for anyone else to use in a similar manner.
That's a great idea. Maybe I could add a section to RevNet for examples like this (in Rev see Development->Plugins->GoRevNet).
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Off-Topic”