----boundary-LibPST-iamunique-1284230826_-_-
Content-type: text/plain
Hallo Helmut,
> Hallo Rene
>
> Just two questions:
>
>> 1) Why did you choose to only link an integer to the view? There are
>>at least three values that are
>> interesting for the bar, namely min, cur and max (there's a good
>>argument for the other properties,
>> too, but even more for these three)? cur does not have a meaning
>>aside from min and max, IMHO.
>
>Because it is easier to use. Up/Down Field also use an INTEGER without >min, cur, max. You can change min and max via the property inspector.
Right. But that would not be a good argument for, let's say, a currency field, would it?
Imagine the following scenario:
My program reads data from a DB, and writes a report in MS Excel from these data.
There are 35000+ (this value changes for every execution of the command) lines to be read, and 20+ Excel-Workbooks with up to 20 Worksheets per Workbook to be written.
Naturally, this results in a long running command (10 minutes).
The user has no problem with this fact, and in the meantime he does not want to use the BB Framework, but he wants to know the percentage of work already done.
So, my command first checks how many lines are to be read. That's the "max" value of the progress bar. And then, whenever one line has been processed, the "cur" value is increased. The only one who could use a property inspector at run-time and change the value of the max-property is the USER. And now, Helmut, what would YOU say, if f.i. Microsoft would ask you to count the number of files to be installed yourself and then manually update the "max" property of a progress bar, in order to tell you the percentage of processed parts of an installation process! I bet, you, like any other user, would call them stupid for even thinking about it.
>What does IMHO mean?
In My Humble Opinion (meiner bescheidenen Meinung nach)
>> 2) For all values of max >1207 and min = 0 and cur =max-1 a TRAP
>>20 happens in f.DrawRect at CtlsProgress.DrawBars, and size is
>>negative!
>
>Change 2 times the line
> size := size * (c.cur - c.min) DIV (c.max - c.min);
>against
> size := SHORT(LONG(size) * (c.cur - c.min) DIV (c.max - >c.min));
>and it will work.
It does.
>I have no problem with the behaviour of INTEGER calculation. It is an
>efficient implementation. Wrap around is useful for logical programming
>with INTEGER.
Sorry Helmut, I doubt that. I doubt that it is *logical*. Now, while *you* may not have problems with the behavior, certainly Bruno Essmann had them when he first implemented CtlsProgress, or he would have written the size more correctly.
Now to my doubts about logic.
First, if this was the primary thought behind INTEGER math in CP, then the expression
a:= MAX(INTEGER)+1;
where a : INTEGER should be valid, and the result should be a = MIN(INTEGER).
But that is not the case. Try it out! It's prohibited by the compiler.
On the other hand,
a:=MAX(INTEGER);
a:=a+1;
where a : INTEGER is valid (the compiler lets it pass), though it is the same action, only in two lines, instead of in one.
Either BOTH are to be prohibited, or BOTH are to be allowed.
Also, I can't see why we need to make the statements like
size := SHORT(LONG(size) * (c.cur - c.min) DIV (c.max - c.min)).
The language report says:
operator first operand second operand result type
+ - * DIV MOD <= INTEGER <= INTEGER INTEGER
integer type integer type LONGINT
In our current example this is how the variables are filled:
size:=1780950;
c.min:=0;
c.max:=1207;
c.cur:=1206;
That means:
size := SHORT(1780950 * (1206 - 0) DIV (1207- 0)).
DIV is performed after the multiplication, therefor:
size:= SHORT(2147825700 DIV 1207);
MAX(INTEGER) = 2147483647
2147825700 > 2147483647 => there IS a LONGINT Value in the calculation, and therefor the result, according to the language report SHOULD be already LONGINT, and hence no need to explicitely write "LONG".
But if you omit the "LONG" in the above, the value of size = 1780950, while WITH "LONG" you get size = 1780948!
So, SOMETHING is not ok here, it seems.
Rene
-------------------------------------------
Versendet durch AonWebmail (webmail.aon.at)
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
blackbox-request{([at]})nowhere.xy
To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
owner-blackbox{([at]})nowhere.xy
Current posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-1284230826_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291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