Split a line of script into multiple lines?

marc_renault shared this question 9 months ago
Answered

Sometimes when writing GeoGebra script, my lines become very long and it would be nice to split them across multiple lines (like using the \ at the end of a line in Python). Is there a way to do this in GeoGebra script? Short example of what I'd like:

If(i < 10, {SetValue(a, a+i), \ 
            SetValue(i, i+1),  \ 
            RunClickScript(loop)} )

Comments (7)

photo
1

you can show view in new window and expand the window

photo
1

Thanks for the suggestion, but I don't see this. I'm using GeoGebra 5, and I'm writing the script in the "On Click" tab of the scripting properties of a button. I can't seem to find the "show view in new window" option - maybe this is in a later version of GeoGebra?

Anyway, I know I can expand the window very wide to accommodate a long line of text. I was just hoping for something a little neater.

photo
1

Move the mouse near the x (close properties) appears a button

photo
1

Ha! That's funny I never noticed that little icon before :-). At any rate, I've always edited script in its own window, but that's a nice trick for moving the view into/out of the main window.

photo
photo
1

But anyway: The possibility of splitting the script lines makes sense.

photo
1

Sorry, we won't be adding that

photo
1

Oh, well. It's good to have a definitive answer, at least. But if you do find yourself with extra time and decide to add this feature, I'm sure there are at least half a dozen people that would appreciate it :-).

photo
© 2019 International GeoGebra Institute