PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → OOPs Upgrade to 7.5 problems
OOPs Upgrade to 7.5 problems
Débuté par Simon Grantham, 15 mai 2003 19:30 - Aucune réponse
Posté le 15 mai 2003 - 19:30
Hurray for 7.5 english being shipped. I have had the early jump on conversions
to 7.5 as I have been obliged to sit at my sister company and upgrade a 5.5
application en francais. Due to loss of functionality in object oriented
wlanguage, I have had 100's of conversion created bugs. The following are
the main problems and work arounds. Here's what you might come across and
if you discover better ways...help.

1. Can no longer call base class method that is VIRTUAL.

If you want to call a base class method from a virtual (superceding) derived
class method (or from any other method within the derived class), the base
class method must be declared as GLOBAL as opposed to VIRTUAL or just implicitly
public.

2. Can no longer specify scope operator on external object.

The syntax DERIVED_OBJECT:BASE_CLASS::BASE_PROCEDURE() no longer passes syntax
checking. This one's really bad as it means you can only call the base class
procedure of the implicit object of a method. If the capability is required
to force call of a base class method (as it is in any reasonably useful library)
you will to provide either an extra argument to the derived method indicating
you want a relay to the base method. (Or have duplicate copies of the base
method with different names so that one of them is not virtual.) You cannot
relay through the base class by doing:

PROCEDURE MyBaseMethodAlternateEntry(MyArg)
Tmp is MyBaseClass dynamic = object
Tmp:MyBaseMethod(MyArg)

since the third line will generate a syntax error saying you have to use
the form MyBaseMethod::Display() which you now can't do with Tmp.

3. Late binding has been restricted (rather superceded by inappropriate syntax
checking)

This one's going to seriously impact the use of your collections libraries.
You can no longer do late binding on an object returned from an anonymous
collection where the object is defined as anything other than 'object'.

For example:

PushListItem is class // Define a stack element class
Next is PushListItem dynamic // Link list entry
END

PushList is class // Define a stack class
Head is PushListItem dynamic // List of linked items
END
PROCEDURE PushList::Push(Item) // push onto list
Item:Next = :Head
:Head = Item
END


MyListItemClass is class // Okay now we use it
object PushListItem // so this is a pushable item
END
PROCEDURE MyListItemClass::Display(Txt)
//for testing a late binding
Info(Txt) // just display text
END

// Now execute
MyList is PushList
MyItem is MyListItemClass dynamic = new MyListItemClass
MyList:Push(MyItem) // Push an item

MyList:Head:Display("Test") // display top of stack ///**** Syntax error

The above code generates a syntax error indicating that Display is not a
method of PushListItem even though MyListItemClass is a derived class. You
can solve this by changing the definition of Head to the anonymous 'Head
is object'. ** You cannot solve the problem by defining a method to return
Head eg. PROCEDURE TOP_OF_STACK() RESULT = :HEAD as you will get a run-time
error indicating that Display is not a member of MyListItemClass. (which
is clearly a wlanguage bug.)

Hope this helps for anyone actually doing object libraries in WinDev, and
as I said, if you can find better solutions, please post 'em.