473,503 Members | 1,685 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

About OO in VB

ABC
I have one base class (A) and a derived class (B)

Class A
...
...
...
Public Overrides Function GetText() as string
Return "A" & _text
end function

Public Function GetFormatText() as string
a = GetText()
End function
end class

Class B Inherits A
Public Overrides Function GetText() as string
Return "B" & _text
end function
End Class
When I call B.GetFormatText(), it return like as "A....." not my expected
"B....."

How can I fix it?
Nov 21 '05 #1
2 956
ABC,

Strange this returns for me "B".

(Maybe can you make next time an error free sample)

\\\
Class A
Public Overridable Function GetText() As String
Return "A"
End Function
Public Function GetFormatText() As String
Return GetText()
End Function
End Class
Class B
Inherits A
Public Overrides Function GetText() As String
Return "B"
End Function
End Class
///

I hope this helps,

Cor

"ABC" <abc.abc.com> schreef in bericht
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have one base class (A) and a derived class (B)

Class A
...
...
...
Public Overrides Function GetText() as string
Return "A" & _text
end function

Public Function GetFormatText() as string
a = GetText()
End function
end class

Class B Inherits A
Public Overrides Function GetText() as string
Return "B" & _text
end function
End Class
When I call B.GetFormatText(), it return like as "A....." not my expected
"B....."

How can I fix it?

Nov 21 '05 #2
ABC
Thank you.
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
ABC,

Strange this returns for me "B".

(Maybe can you make next time an error free sample)

\\\
Class A
Public Overridable Function GetText() As String
Return "A"
End Function
Public Function GetFormatText() As String
Return GetText()
End Function
End Class
Class B
Inherits A
Public Overrides Function GetText() As String
Return "B"
End Function
End Class
///

I hope this helps,

Cor

"ABC" <abc.abc.com> schreef in bericht
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have one base class (A) and a derived class (B)

Class A
...
...
...
Public Overrides Function GetText() as string
Return "A" & _text
end function

Public Function GetFormatText() as string
a = GetText()
End function
end class

Class B Inherits A
Public Overrides Function GetText() as string
Return "B" & _text
end function
End Class
When I call B.GetFormatText(), it return like as "A....." not my expected
"B....."

How can I fix it?


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2821
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
220
18803
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
8
2447
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
77
5622
by: nospam | last post by:
Reasons for a 3-tier achitecture for the WEB? (NOTE: I said, WEB, NOT WINDOWS. DON'T shoot your mouth off if you don't understand the difference.) I hear only one reason and that's to switch a...
125
14539
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
5
2981
by: eScrewDotCom | last post by:
www.eScrew.com eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is...
81
7221
by: Matt | last post by:
I have 2 questions: 1. strlen returns an unsigned (size_t) quantity. Why is an unsigned value more approprate than a signed value? Why is unsighned value less appropriate? 2. Would there...
0
2431
by: eScrewDotCom | last post by:
eScrew Welcome to eScrew! eScrew is eScrew and this is eScrew story. eScrew will tell you eScrew story if you promise eScrew to consider eScrew story as joke. eScrew story is very funny. eScrew...
7
3123
by: Edward Yang | last post by:
A few days ago I started a thread "I think C# is forcing us to write more (redundant) code" and got many replies (more than what I had expected). But after reading all the replies I think my...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.