Page 1 of 1

Recursion and file-IO in CelX ???

Posted: 10.03.2006, 23:56
by Chuft-Captain
Does anyone know if it's possible to write a recursive function in CelX scripts. I'd like to write a little script to reverse the order of bookmarks in favorites.cel.

Best way to do this would be to read each of the items in the file and write them back out recursively. (Might have to create a duplicate of the file first).

Or even better, someone could write this in C++ and include it as a permanent feature in the next release! (ie. Sort order option on the Bookmarks menu)

Any volunteers?? :)

Posted: 16.03.2006, 15:02
by cpotting
Creating functions (recursive or otherwise) and file I/O are both possible with Celx scripts. Cel scripting, however, does not support either.

Posted: 16.03.2006, 15:18
by Chuft-Captain
Thanks Clive,

I thought I might do this if others might find it useful, but at the moment the results of my poll: http://celestiaproject.net/forum/viewtopic.php ... highlight= suggest not. 4 votes from 210 views. (Or maybe it's just typical american voting apathy :wink:)

Might get around to this one day, but bigger fish to fry, so in the meantime I'll continue to edit favorites.cel as I've been doing up to now.

Thanks for the feedback though.
:)