Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug on calling typed method with CAVO 2.6 - be carefull please

11 views
Skip to first unread message

Claudio Di Nucci

unread,
Nov 17, 2002, 2:24:08 AM11/17/02
to
Hi folks.

Here is quoted the Larry's answer and the mail that I have sent to DataPro
support for
a problem that arise when I move my applications to CAVO 2.6, RP 3.3 and
ClassMate 2.04.

Hi Claudio,

There is something broke in VO 2.6. For some reason it does not work
correctly with default paramters. Change your drawText calls from:


self:oPrinter:DrawText(cText,,nColPos,self:oPrinter:PRow,self:aColWidths[nCo

l+1],nAvgCharHeight,_or(DT_EXPANDTABS,DT_NOPREFIX,DT_RIGHT,DT_WORDBREAK))

to:


self:oPrinter:DrawText(cText,-1,nColPos,self:oPrinter:PRow,self:aColWidths[n

Col+1],nAvgCharHeight,_or(DT_EXPANDTABS,DT_NOPREFIX,DT_RIGHT,DT_WORDBREAK))

(notice second parameter) and it should work OK. This probably breaks a
lot
of code...

Larry


-----Original Message-----
From: Claudio Di Nucci [mailto:cdn...@tin.it]
Sent: Saturday, November 02, 2002 8:08 AM
To: DataPro Support
Subject: CM Demo - ArrayBrowser: Preview Report doesn't work anymore on
ClassMate 2.04


Hi folks.

I downloaded and installed Classmate 2.04 and ReportPro 3.3.

After installation I run CM Demo - ArrayBrowser and when I have executed
the
report preview, the preview window report only the first row with some
title
and nothing else.

I use the same technique for preview the browser content in all my
applications.

Why does this happen ?

My developping environment is : Pentium III 600 Mhz with 256Mb and
Windows
2000 SP2 - CAVO 2.6 Classmate 2.04 and ReportPro 3.3

Thanks in advance and as Stan "The Man" Lee should say

EXCELSIOR :-)

Claudio Di Nucci

Putting -1(the default value) in the second parameter as Larry said all
works fine, but I have a lot of custom code that have this kind of problem
(I'll modify it) and I don't know if there are in the ReportPro dll.

Thus my new develops with VO 2.6 are stopped until this bug is fixed.

The problem seems related only with calling typed methods (and ClassMate
have typed methods) that have parameter with default value and not with
calling function that have parameter with default value.

The problem not affect VO 2.5x.

I have mailed this problem to bugsh...@cavo.com, but they answer nothing
until now.

My hope is that this bug will solve very soon with a 2.6a release and not in
three or four months with 2.7 release

Regards and as Stan "The Man" Lee should say

EXCELSIOR :-)

Claudio Di Nucci


Geoff Schaller

unread,
Nov 17, 2002, 4:52:20 AM11/17/02
to
Claudio,

This is not likely to be a fault with 2.6 but rather a fault within CM. The
method described is a CM method, not a VO one. VO'ers not using CM need not
be concerned.

Geoff


"Claudio Di Nucci" <cdn...@tin.it> wrote in message
news:suHB9.18871$744.6...@news1.tin.it...

Ginny Caughey

unread,
Nov 17, 2002, 11:46:53 AM11/17/02
to
Geoff,

The code Claudio showed was VO code. Larry is not quick to blame VO for things
CM does unless he KNOWS that VO behavior is responsible, so I trust his
assessment. I hope bugshunter has a report of it.

--
Ginny


"Geoff Schaller" <geof...@bigpond.net.au> wrote in message
news:oFJB9.7717$nK4....@news-server.bigpond.net.au...

Marc

unread,
Nov 17, 2002, 12:47:49 PM11/17/02
to
Claudio,

In the following program, VO2.5 shows 'xyz' and -1
What does it show in 2.6?

class test
~"ONLYEARLY+"
declare method DoTest
~"ONLYEARLY-"

method Init() class Test
return self

method DoTest(cText as string, nChars := -1 as longint) as void pascal class test
~"ONLYEARLY+"
?cText
?nChars
pause()
return
~"ONLYEARLY-"

function start
local oTest as Test
~"ONLYEARLY+"
oTest := Test{}
oTest:DoTest('xyz')
return
~"ONLYEARLY-"

-Marc-

Ginny Caughey

unread,
Nov 17, 2002, 1:50:17 PM11/17/02
to
Hi Marc,

I get xyz and -1 in 2.6 also, so whatever is causing the problem Larry is seeing
isn't demonstrated here.

--
Ginny


"Marc" <Ma...@Fpss.Net> wrote in message news:3DD7D645...@Fpss.Net...

Robert van der Hulst

unread,
Nov 17, 2002, 2:58:54 PM11/17/02
to
Hi Ginny,

On Sun, 17 Nov 2002, at 11:46:53 [GMT -0500] (which was 17:46 where I live)
you wrote about: 'Bug on calling typed method with CAVO 2.6 - be carefull please'

> The code Claudio showed was VO code. Larry is not quick to blame VO for things
> CM does unless he KNOWS that VO behavior is responsible, so I trust his
> assessment. I hope bugshunter has a report of it.

I like to add a warning: default parameters for methods were never
officially supported. They work for functions, because VO inserts the
default values in the calling code.

For method calls it will only work in situations where the method
calls is guaranteed to be early bound (so you should use the ONLYEARLY
pragma). And if you are not careful and have a late bound call the
results are unpredictable. You may get a NIL for a typed parameter
getting all kinds of weird results, including GPS's


--
Robert van der Hulst
AKA Mr. Data
Vo2Jet & Vo2Ado Support
www.sas-software.nl
mrd...@sas-software.com

Ginny Caughey

unread,
Nov 17, 2002, 3:28:27 PM11/17/02
to
Good point, Robert. I have never used default parameters in methods, and I'm not
finding any problems with my 2.6 code, but I think it is important for people to
be aware of this behavior. I didn't realize how ONLYEARLY affected the behavior,
so thanks for this info.

--
Ginny


"Robert van der Hulst" <mrd...@sas-software.com> wrote in message
news:149888017390....@sas-software.nl...

Denis Mitrofanov

unread,
Nov 18, 2002, 6:08:14 AM11/18/02
to
Geoff

> This is not likely to be a fault with 2.6 but rather a fault within CM.
The
> method described is a CM method, not a VO one. VO'ers not using CM need
not
> be concerned.

I think you wrong. I have the same constructions in MDReport. No warnings or
errors while compilation (I always use High warning level). And all works
fine in VO2.5b3.

In VO2.6 I found NIL where default method parameter was expected.

1. If some functionality/features are not allowed, compiler must reacts
appropriately.
2. It is a good practice - not to remove features available in previous
versions, but document them and include in next release.
3. I doubt that backward compatibility tests were done for VO2.6. Fully
correct code which works fine on VO2.5b3 is not working in VO2.6. In both
cases no warnings/messages from compiler.

I always sayd that quality of VO compiler is far from even 'good'. It is sad
that it continues and in version 2.6. Remember the childish error in numeric
conversion (Str...).

Denis.


Geoff Schaller

unread,
Nov 18, 2002, 7:13:02 AM11/18/02
to
No its not. This is not a VO method.

"Ginny Caughey" <ginny....@wasteworks.com> wrote in message
news:ar8h3r$fne4b$1...@ID-144704.news.dfncis.de...

Johel de Souza Filho

unread,
Nov 18, 2002, 7:16:36 AM11/18/02
to
Denis,

> 3. I doubt that backward compatibility tests were done for VO2.6. Fully
> correct code which works fine on VO2.5b3 is not working in VO2.6. In both
> cases no warnings/messages from compiler.

Yes, I've found something like that. But I'm still testing to be sure it was
not my mistake...

Johel


Ginny Caughey

unread,
Nov 18, 2002, 9:35:15 AM11/18/02
to
Geoff, both Dennis and Robert have seen the same problem, and they aren't
testing CM. It's a problem with either the VO compiler or runtime and it's ok to
acknowledge that VO isn't perfect - that's how it gets better. ;-)

--
Ginny


"Geoff Schaller" <geof...@bigpond.net.au> wrote in message

news:iP4C9.13526$nK4....@news-server.bigpond.net.au...

Marc

unread,
Nov 18, 2002, 1:23:28 PM11/18/02
to
Ginny,

FWIW, I've had seen flakyness with these inline defaults even with 2.5.
Maybe it was due to what Robert has stated or some other VO voodoo.

Officially supported or not, a lot of existing code uses this feature
and if it's worse in 2.6, then it may be a show stopper.

-Marc-

Ginny Caughey

unread,
Nov 18, 2002, 1:40:13 PM11/18/02
to
Marc,

I think the main thing is that the compiler (in 2.7 anyway) should complain if
it encounters code like this that the runtime can't support. I've never run into
it myself with either version, but I don't use default parameters. I'm not sure
why it should be worse in 2.6, but it seems to be from what everybody is telling
me.

--
Ginny


"Marc" <Ma...@Fpss.Net> wrote in message news:3DD93020...@Fpss.Net...

Nathan Robeson

unread,
Nov 18, 2002, 3:39:13 PM11/18/02
to
Robert,

Is there any issue at all using VO native Init() Methods (all Late Bound)
and use default parameters?

If so eveyones in real trouble.

Nathan

"Robert van der Hulst" <mrd...@sas-software.com> wrote in message
news:149888017390....@sas-software.nl...

Robert van der Hulst

unread,
Nov 18, 2002, 5:05:29 PM11/18/02
to
Hi Nathan,

On Mon, 18 Nov 2002, at 14:39:13 [GMT -0600] (which was 21:39 where I live)
you wrote about: 'Bug on calling typed method with CAVO 2.6 - be carefull please'

> Is there any issue at all using VO native Init() Methods (all Late Bound)
> and use default parameters?

> If so eveyones in real trouble.

They don't work. Try the following sample:

CLASS TEST
EXPORT aa
EXPORT bb

METHOD Init (_aa := "" , _bb := 123 ) CLASS Test
SELF:aa := _aa
SELF:bb := _bb

FUNCTION start
LOCAL oTest AS Test
oTest := Test{}
? otest:aa, otest:bb
oTest := Test{,2}
? otest:aa, otest:bb
oTest := Test{'xx',}
? otest:aa, otest:bb
wait

You will see that for missing parameters always a NIL will be shown

Geoff Schaller

unread,
Nov 19, 2002, 6:00:21 AM11/19/02
to
Sure - I'm not arguing but the original post was made in the context of CM
code using a method not of the GUI classes. Mostly, GUI class methods are
not strongly typed so do not suffer the problems being discussed here.

I just love the way blame is sheeted around without proper explanation.

Geoff


"Ginny Caughey" <ginny....@wasteworks.com> wrote in message

news:aratov$grj90$1...@ID-144704.news.dfncis.de...

Ginny Caughey

unread,
Nov 19, 2002, 7:21:54 AM11/19/02
to
Geoff,

> I just love the way blame is sheeted around without proper explanation.

Huh? Only YOU incorrectly blamed CM.

Ginny


Marc

unread,
Nov 19, 2002, 11:24:54 AM11/19/02
to
Ginny,

This is very worrisome.

What does the following modification (without early binding in start()) show?

class test
~"ONLYEARLY+"
declare method DoTest
~"ONLYEARLY-"

method Init() class Test
return self

method DoTest(cText as string, nChars := -1 as longint) as void pascal class test
~"ONLYEARLY+"
?cText
?nChars
pause()
return
~"ONLYEARLY-"

function start
local oTest as Test

//~"ONLYEARLY+"


oTest := Test{}
oTest:DoTest('xyz')
return

//~"ONLYEARLY-"

-Marc-

Malcolm Gray

unread,
Nov 19, 2002, 12:18:23 PM11/19/02
to
Marc wrote:
> Ginny,
>
> This is very worrisome.
>
> What does the following modification (without early binding in
> start()) show?

I havn't tried it but it should surely be a runtime error and compile
time warning?


Ginny Caughey

unread,
Nov 19, 2002, 1:10:43 PM11/19/02
to
Marc,

I get xyz and -1 with 2.6. I assume that it takes a large amount of code to get
this to fail.

--
Ginny


"Marc" <Ma...@Fpss.Net> wrote in message news:3DDA65D6...@Fpss.Net...

Robert van der Hulst

unread,
Nov 19, 2002, 2:06:55 PM11/19/02
to
Hi Marc,

On Tue, 19 Nov 2002, at 08:24:54 [GMT -0800] (which was 17:24 where I live)
you wrote about: 'Bug on calling typed method with CAVO 2.6 - be carefull please'

> This is very worrisome.

> What does the following modification (without early binding in start()) show?


Your code returns what it is supposed to return. Now see the following
sample.

CLASS test
DECLARE METHOD DoTest

METHOD Init() CLASS Test
RETURN SELF

METHOD DoTest(cText AS STRING, nChars := -1 AS LONGINT) AS VOID PASCAL CLASS test
~"ONLYEARLY+"
?cText
?nChars
Pause()
RETURN
~"ONLYEARLY-"

FUNCTION start
LOCAL oTest AS USUAL


//~"ONLYEARLY+"
oTest := Test{}
oTest:DoTest('xyz')

RETURN
//~"ONLYEARLY-"


I removed the ONLYEARLY pragma in the class definition and
changed the AS TEST in START() to AS USUAL. Without the ONLYEARLY
pragmas in START() the code compiles fine, but fails at runtime. The
call to DoTest() is late bound and the default parameter is not used.
If you include the ONLYEARLY pragma in START() the compiler will warn
you that the call to DoTest is late bound, thus avoiding the runtime
error.
This is the point that I wanted to make: if you are making a late
bound call without knowing it, you can get problems.

It may look obvious in this example but what if I change Start to
this:

Function Start
MakeATestObject():DoTest('xyz')
Return

Function MakeATestObject AS TEST
return Test{}

In this case it is not so obvious that the result of MakeATestObject
is a usual (pointing to an object) and that the call is Latebound.
Adding the ONLYEARLY pragma in the Start() function will definitely
help here, and the code should be changed to the following to get the
correct results.

Function Start
local oTest as Test
oTest := MakeATestObject()
oTest:DoTest('xyz')
Return

0 new messages