You are not logged in.

#1 05 Jul 2016 16:14

fix_j
Member
Registered: 01 Jun 2016
Posts: 5

Online script editor [scriptcomposer.com] -> feedback needed

I have developed a free online script editor for various types of scripting (cmd, sh, ksh, etc). big_smile
Hope you are interested to try it out and give me some feedback.

https://scriptcomposer.com

Some of the features:
-  Syntax highlighting
-  Shows help while typing (after space)
-  Insert code (examples)
-  Detects variables as you type
-  And more…
   


Thanks in advance!


Bart

Last edited by fix_j (05 Jul 2016 16:20)

Offline

#2 05 Jul 2016 21:37

Batcher
Member
Registered: 20 Jul 2015
Posts: 56

Re: Online script editor [scriptcomposer.com] -> feedback needed

This is something I've been looking for for a while however I'm having some trouble running the code. The run buttons seem to do nothing for me. I'm testing it on an Samsung device so this might be part of the problem but I'll try it later on my computer. I have also noticed that when I select windows 7 the run option disappears.

Last edited by Batcher (05 Jul 2016 21:58)

Offline

#3 06 Jul 2016 14:07

Shadow Thief
Member
Registered: 12 Jul 2012
Posts: 205

Re: Online script editor [scriptcomposer.com] -> feedback needed

Is the Run button supposed to do something? Even a simple "Hello World" isn't producing any output.

Arrays aren't getting picked up by the variable list, and there is no syntax highlighting when you use a variable like !array[%counter%]!

If I press enter and then delete on an empty script, the line is no longer accessible but the line numbering remains.

Offline

#4 06 Jul 2016 15:40

bluesxman
Member
From: UK
Registered: 29 Dec 2006
Posts: 1,129

Re: Online script editor [scriptcomposer.com] -> feedback needed

If I paste in a script, or navigate a longish script with PgUp / PgDn / Ctrl+Home / Ctrl+End I get a weird overlay effect.

weird overlay effect ... this image will expire ... sorry if you missed it

As Shadow Thief implies, variables are not picked up universally.  Here are a couple that are not detected:

set foo.bar=hi
set /a i+=1

The help text of the current command context is off screen for me (requires scrolling).

If I press the ":: remove" button when no comment is on the current line, the cursor moves backwards through the script adding extra newlines.

If I am at the end of a line as press ":: add" the "::" appears on the next line with the cursor in the middle.

Last edited by bluesxman (06 Jul 2016 22:03)


cmd | *sh | ruby | chef

Offline

#5 06 Jul 2016 22:07

fix_j
Member
Registered: 01 Jun 2016
Posts: 5

Re: Online script editor [scriptcomposer.com] -> feedback needed

Variable detection
- improved the detection; operators and a dot in variable name now works
- how could arrays best be shown in the variable overview, just the name or also the position included?


Run button
This button is for debugging your script on your system (or another system), it requires that you are logged in and have saved your script.
Next step is to download the debugger script (go to script in the menu) and run this script on your system (or another system).
After the debugger script has connected to the server you can press the run button, your saved script will then be downloaded and executed on your system.
The run results from your script will be come visible in the debugger console.


I will pickup the other issues as soon as possible.
Thanks for the feedback so far, this is great big_smile

Offline

#6 07 Jul 2016 11:37

bluesxman
Member
From: UK
Registered: 29 Dec 2006
Posts: 1,129

Re: Online script editor [scriptcomposer.com] -> feedback needed

Variables can contain lots of different characters, not sure you're going to be able to easily capture all possibilities via the character combinations available.  You're probably going to want to figure out a rule to determine where the variable must end, this differs when using "/a" for example (some characters you can use in normal variables are unavailable.)

Broadly, I think the rule is that the variable ends at the first "=", except if "/a" is applied, then it ends at the first arithmetic operator - further operators before the "=" are invalid syntax.

Here are some examples of working and non-working captures.

::works
set "a.a=1"
set "b=1"
set /a "c+=1" :: correctly captures "c" for "/a" variant
set /a "g+g=1" :: invalid syntax for "/a", not captured (this is correct but possibly just lucky -- see d+d below)
set "i==1" :: valid syntax, captures "i" ("i" would contain "=1")

::doesn't work
set "d+d=1" :: should capture "d+d"
set "e+=1" :: has no "/a", so should capture "e+"
set /a "h==1" :: invalid syntax for "/a", but captures 'h'

Last edited by bluesxman (07 Jul 2016 13:02)


cmd | *sh | ruby | chef

Offline

#7 07 Jul 2016 21:18

fix_j
Member
Registered: 01 Jun 2016
Posts: 5

Re: Online script editor [scriptcomposer.com] -> feedback needed

Overlay effect
PgUp / PgDn / Ctrl+Home / Ctrl+End are now handled differently.

Variable detection
I will make some adjustments tomorrow to include the examples you provided.
Some syntax validation will be also included tomorrow, so these are some bad patterns?
set /a "g+g=1"
set /a "h==1"
set /a "x=test"
set /a "x[1]=test"

Thnx!

Offline

#8 08 Jul 2016 14:17

bluesxman
Member
From: UK
Registered: 29 Dec 2006
Posts: 1,129

Re: Online script editor [scriptcomposer.com] -> feedback needed

set /a "x[1]=test"

This is valid syntax, but it's debatable as to what you should capture.
The issue here is that arrays are not handled natively, but can be fudged/approximated with some lateral thinking.

Handling all eventualities could prove tricky.  For example, this code creates valid variables (and I could make much more convoluted but still valid code):

C:\> set x=something
C:\> set y_%x%=other
C:\> set y_%x:some=no%=more
C:\> set y_
y_nothing=more
y_something=other

You are probably going to have to settle for the most common forms.

Last edited by bluesxman (08 Jul 2016 14:20)


cmd | *sh | ruby | chef

Offline

#9 11 Jul 2016 21:34

fix_j
Member
Registered: 01 Jun 2016
Posts: 5

Re: Online script editor [scriptcomposer.com] -> feedback needed

New update, the editor should be more stable. No more overlays (I hope). big_smile
Also detects more variables now but still misses some you have provided, some more tweaking to do for me!

So what you are saying is that any type of character except a space is allowed before the '=' sign as a variable name?

Offline

#10 11 Jul 2016 23:09

Shadow Thief
Member
Registered: 12 Jul 2012
Posts: 205

Re: Online script editor [scriptcomposer.com] -> feedback needed

Actually, spaces can be part of variable names well.

@echo off

set "this is a perfectly valid variable name=whoa"
echo %this is a perfectly valid variable name%
pause

Last edited by Shadow Thief (11 Jul 2016 23:10)

Offline

#11 03 Aug 2016 22:38

fix_j
Member
Registered: 01 Jun 2016
Posts: 5

Re: Online script editor [scriptcomposer.com] -> feedback needed

Back again  big_smile

Took me a while but I build a new editor with some improvements:
+ handles big scripts with ease > 10000 lines
+ auto complete for commands and variables
   autocomplete1.png

Offline

Board footer

Powered by