Page 1 of 1

Command lines count in celx scripts

Posted: 27.10.2008, 22:42
by ANDREA
Sorry to trouble with this probably silly question, but it's a big problem for me.
I tried to modify a celx script, in order to shorten it.
Launching it everything goes OK, but at half of the script it stops with this error message:
"In line 116=Second argument to celestia:print must be a number"

Well, I counted the lines as normally we do, i.e. one after the other starting from the beginning, but line 116 is way BEFORE the point in which the error message popped on the screen.
Moreover, I have no commands written as celestia:print
Where is the trick?
Please help me, I'm getting mad to understand how it works. :cry:
Thanks a lot.
Bye

Andrea :D

Re: Command lines count in celx scripts

Posted: 27.10.2008, 23:03
by Vincent
Andrea,

Could you provide the whole script? That would help.

Re: Command lines count in celx scripts

Posted: 28.10.2008, 00:35
by ANDREA
Vincent wrote:Andrea, Could you provide the whole script? That would help.
Sure, Vincent, you can find it here:
http://ftp.tiscali.it/andrea_celestia/futuro_del_sole-no2.celx
BTW, it's your script future_of_our_sun_celestia1.5 that I translated in Italian and slightly modified mainly to shorten it a bit, due to time problems (just one hour to show Sun birth, life and death, alas!). :(
Thanks a lot, Vincent.
Bye

Andrea :D

Re: Command lines count in celx scripts

Posted: 28.10.2008, 09:39
by Vincent
Andrea,

First of all, you may want to use notepad 2 to edit your scripts.
Unlike the version of notepad provided with Windows, notepad 2
offers many features dedicated to code and script editing.

Then, to fix the issue you're getting with your Italian version of the script,
just replace line 497 ('Seconda fase di Gigante rossa' section):

Code: Select all

displaySunInfo(sun_age,sun_radius, sun_lum, sun_temp, 2)
with:

Code: Select all

displaySunInfo(text23, sun_age,sun_radius, sun_lum, sun_temp, 2)


and line 506:

Code: Select all

displaySunInfo(sun_age,sun_radius, sun_lum, sun_temp, 4)
with:

Code: Select all

displaySunInfo(text23, sun_age,sun_radius, sun_lum, sun_temp, 4)

In both cases, the text argument was missing in the displaySunInfo function,
which is declared in line 116 and called many times all along the script.

Re: Command lines count in celx scripts

Posted: 28.10.2008, 13:28
by ANDREA
Vincent wrote:Andrea, First of all, you may want to use notepad 2 to edit your scripts. Unlike the version of notepad provided with Windows, notepad 2 offers many features dedicated to code and script editing.
Thank you Vincent, I forgot that notepad2 gives the line number on left (and many more advantages over Microsoft Notepad, BTW), and this is very useful for this purpose.

Vincent wrote:Then, to fix the issue you're getting with your Italian version of the script,
just replace line 497 and line 506.
In both cases, the text argument was missing in the displaySunInfo function,
which is declared in line 116 and called many times all along the script.
OK, now I can understand the function of the line 116, i.e. it gives the general rule for text displaying all along the script. :oops:
I changed the lines as you suggested and now all works flawlessly.
Thanks a lot, VERY appreciated. :wink:
Bye

Andrea :D