Confusing Coding Conundrum

new topic     » topic index » view thread      » older message » newer message

Hello All!

As some of you may be aware, I've been working an
IDE for Euphoria.  Since the project is finally
starting to come together somewhat, I suppose it
is time to announce its development publicly.
The name that I have chosen for it is "Vision
Euphoria" -- I would really liked to have called
it "Visual Euphoria," but that name has been
taken.  It will be a fairly large and complex
program, and it will not be completed until some
time in November, thanks to my hectic schedule;
however, at least now the program is not 99%
vaporware.  The completed package will be
shareware, and the price will be under $30 --
completely honor based (no nag screens or broken
code).

Vision Euphoria will consist of a core program,
assisted by various support programs that
(hopefully) will make programming in win32lib.ew
and Euphoria in general very easy.  One
such "support program" is the Euphoria Database
Editor, which assists in the formation and
editing of files created using database.e.  It is
now 80% operational, and should be available for
download (all support programs will be freeware)
within the next two weeks.  I have a little bit
of coding left, as well as some brief
documentation ... its comprehensive documentation
will be packaged with Vision Euphoria.  The
program is very straightforward and simple, and
even without a 150 page manual, it should be
understandable to anyone vaguely familiar with
Euphoria.

I have a confusing problem at this point,
however, and I'm hoping that somebody out there
in Euphorialand can point me in the right
direction.

Within EDB, I have a find feature, which allows
the user to find either Euphoria strings or
objects (integers, sequences, atoms, etc.)  I've
gotten the program to find any object as long as
it's not nested in a layer of sequences, but I'm
having a problem accurately displaying its
location.

The object displayed in the data mle has been
sprint'ed so that it can be shown.  When the
program finds a match for the search object, it
needs to be highlighted (selected).  Thanks to
information graciously supplied by Mr. Fritz, I
have a mechanism to highlight.  But I can't
figure out how to convert the position of the
match into its position within the sprint'ed
object.

Example:

TheDarnObject: {23,45,65,71,33,14,19,
{30,30,32},12,16,4,0}

User wants to find:  16 --------------------------
--^

Now then, my first approach would be to get the
index of the matched element, in this case 10,
then count the commas in the sprinted version.
One I got to the ninth one, just one position
over and there it is.  But the nested sequence
bites me in the backside, as I would need to
factor in the nested sequence's length.  Not a
problem for this example.  But what if there are
dozens of layers of nested sequences?  No good.

If someone can help me out, it would be very
appreciated!  The answer is more than likely
right there in front of me, and I'm too flustered
to see it.  At any rate, as soon as I get this
problem solved, and throw in some printing code,
she'll be ready to go!


Travis Beaty
Claude, Texas


-----

"The fastest line is the one that you're not in."

                              -- Murphy's Law

______________________________________________________
Get your free web-based email at http://www.xoom.com
Birthday? Anniversary? Send FREE animated greeting
cards for any occasion at http://greetings.xoom.com

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu