rpl/javascript editor

Discuss your code, get questions answered

rpl/javascript editor

Postby pili » Mon Jan 31, 2011 3:20 pm

Hi there,

First, this is a great app.
Is there a way to edit the javascript code in a proper page as opposed in the "definition" line?
how do i change the behaviour of the keys?(i use the dark skin and the shift key doesn't make a click sound when pressed and the color doesn't change much).

thanks
pili
 
Posts: 3
Joined: Mon Jan 31, 2011 3:04 pm

Re: rpl/javascript editor

Postby oliver » Mon Jan 31, 2011 4:19 pm

Hi Pili,

Glad to hear you like the app.

To write JS or RPL you definitely want the expanded edit line. Double-tap the edit line to expand it, and type and edit away.
Tabs and newlines will be kept, but *only* if you don't collapse the edit line before entering it. That is, edit your code and press enter (do not double-tap again to collapse the expanded edit line).

If you type JavaScript, your code will be syntax-checked and any error location indicated, before enter will succeed. RPL will always enter, and only gets checked when you run it.
Once entered, you save (STO) your code into a name and then you can run it by referring to its name: either typed, or by tapping its key.

You can refer to functions in another folder by prepending the folder name and ".". That works on the command line and in RPL or JS code. For example, if you have downloaded the Bench folder, you can call Bench.start on the command-line or RPL, or Bench.start() from JS.

To edit your code, either recall (RCL) and edit (EDIT), or visit (VISIT) your variable. If you have formatting characters in your code, you will automatically enter the expanded edit line.
A short-cut for recall and edit is: 2nd-level and soft-key in question. That's much quicker and you'll be using this all the time if you're programming.

I guess I need to make clearer how writing code in-app works. After all, this is the app's strongest feature.
The definition line is pretty useless for writing code. (Unless it's a quick one-liner.)
It's probably surprising that you can simply start writing a JavaScript function definition on the edit line, but that's how it's meant to work. Half of the demos were actually written on the device. Study those (via 2nd-level and soft-key) and you'll have a good overview of programming in the app.

Cheers.
oliver
Site Admin
 
Posts: 433
Joined: Sat May 01, 2010 2:11 pm

Re: rpl/javascript editor

Postby oliver » Mon Jan 31, 2011 4:22 pm

The alternate (shift) key is meant to not make a sound and I meant it to not stick out so much color-wise when active. Both probably poor decisions, as you're not the first to point this out. I'll revise and/or make it customizable. For now, you could go with your own set of custom button images, as shown in the Quick Tour.
The button designs aren't good and there'll be better ones. Guess, I'm focusing on function before form.

[EDIT: The 2nd-level key (aka "alternate", "shift") now makes a sound in v.1.3 and up.]
oliver
Site Admin
 
Posts: 433
Joined: Sat May 01, 2010 2:11 pm

Re: rpl/javascript editor

Postby pili » Mon Jan 31, 2011 4:47 pm

Hi,

I see now.

thanks
pili
 
Posts: 3
Joined: Mon Jan 31, 2011 3:04 pm


Return to Programming

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron