main logo
Subject: Re: AW: here is the testproject...
Author: Ruslan Zasukhin
Posted: 2001/12/29 16:41:23
 
View Entire Thread
New Search


on 12/29/01 18:39, Stefan Groschupf at sg /at/ media-style .D.OT com wrote:

> Upps. What's happen? All as Property list defined Variables are now linear
> lists.
> No all ":" are missing? ;-(
> I had copy paste it in the word pad and there is no ":" after copy.
> Microsoft... ;-(
> I'm very sorry here are the files as RTF ..
>
> Thanks for your time...

Hi Stefan,

Okay, I see problem in DropRecord(),
I still don't know if bug in your code or in my..

But Stefan! As I see you do build list of distinct values, yes?
So why on earth you use DropRecord ???!!!!

You have loop as:

repeat while 1 < tempCursor.GetRecordCount()
nxt = tempCursor.GetField()
repeat while nxt = tempCursor.GetField()
tempCurs.DropRecord()
end repeat
myList.append( nxt )
tempCurs.DropRecord()
end repeat
--------------------------

Here there is many potential problems:

1) you build list in RAM, so you need just iterate cursor, and select
different values. Even there is no sense to use DropRecord() because this
only spend your time on cursor modification. You do not need this for your
task. People use DropRecord() if they want to get cursor itself that contain
distinct records.

2) I think source of problem is that you obtain value of field to nxt.
It can be empty string "". Now in internal loop you start droprecords()
And only check if value is NOT "". But you have forget to choose in this
internal loop if cursor still have records...So I think when your cursor
contain ONLY empty strings, you go into case that all records are dropped
but you still try to call DropRecord() and here probably come my bug.

I think you need loop just as:

------------------
Found = tempCursor.FirstRecord()

repeat while Found
nxt = tempCursor.GetField()
myList.append( nxt )

// skip all other the same values
repeat while tempCurs.NextRecord() and nxt = tempCursor.GetField()
// do nothing
end repeat
end repeat


Stefan, this is not 100% code, because I am not Lingo expert,
And I do not want break my mind...In C++ I'd could do it easy :-)
I hope you have catch idea.

-----------------------
But now I wonder why you really not use GetColumn() function that return you
list. Now you'd could just iterate list and remove the same values...may be
of course Director's lists are too slow...


--
Best regards,
Ruslan Zasukhin

-------------------------
Paradigma.

e-mail: ruslan@paradigmasoft.com
web : http://www.paradigmasoft.com

To subscribe to the Valentina mail list
send a letter to valentina-on /at/ lists .D.OT macserve.net
 
©2001 Ruslan Zasukhin
<-- Prior Message New Search Next Message -->