Xojo Conferences
XDCMay2019MiamiUSA

Compile Error:-> There is no class with this name (Real Studio getting started Mailinglist archive)

Back to the thread list
Previous thread: LiveScroll Slider Bug
Next thread: Editable cells


RB Database   -   tom.russell transport.alstom.com
  Compile Error:-> There is no class with this name   -   Brent Shire
   RE: Compile Error:-> There is no class with this name   -   Joseph Claeys
   Re: Compile Error:-> There is no class with this name   -   Craig Sutherland
   Re: Compile Error:-> There is no class with this name   -   Stuart Malin
    Re: Compile Error:-> There is no class with this name   -   GAmoore aol.com
    Re: Compile Error:-> There is no class with this name   -   Brent Shire
     RE: Compile Error:-> There is no class with this name   -   RBNUBE

Compile Error:-> There is no class with this name
Date: 24.01.05 04:11 (Mon, 24 Jan 2005 13:11:04 +1000)
From: Brent Shire
I am new to REAL Basic, but have been coding for 15 years with around 6
years in VB and around 2 years with VB.NET.

However, this compiler error message has me totally stumped. I have read
the user guide twice, language reference for days now, past forum posts etc.
I am certain I have done all that has been documented (but obviously not) to
no avail.

Background:
-----------------

I am using REAL Basic Standard 5.5.4 for Windows (registered not demo) on
Windows XP service pack 2. I am using standard controls, classes etc that
came with RealBASIC, although I have purchased 3rd party stuff (eg MBS
plug-in) - but I have not used as yet, but fully intend to later on.

I have a window object called winAccountStatuses. It has a multi-column
list box. First column is reference code, second column is reference
description. It gets it contents from a MS Access XP (SP3) database table
(this part of the code works fine). I have a push button ("Add") on the
form/window so the user can add a new record. A blank row is added to the
listbox, and the reference code cell is made editable. The user can enter
text. All works fine so far. I want to write a function that validates
what the user types into the reference code. (eg. mandatory field, max char
etc - now don't tell me you can do this in the IDE properties window - I
know - but I just want to write a quick function to get this working while I
am learning - later on I will code the actual validation, ie. first 3 char
must be alpha, followed by 2 char that must be digits etc etc)

The problem:
------------------

In the Window Editor for winAccountStatuses, I right clicked and selected
New Method. Entered a name, parameter, return type and scope. (see code
below) The function scope only needs to be private as certain events (eg.
Action for the OK pushbutton, CellLostFocus for the listbox) of controls in
the winAccountStatuses window will be the only area using it (naturally - as
its a custom validation routine specific to this window/form).

But when compile (debug/run), the compiler reports the following error:

"There is no class with this name winAccountStatuses.RefCodeValidated:
Function RefCodeValidated(iRow as Integer) as Boolean"

********** OFFENDING CODE *******************
Private Function RefCodeValidated(iRow as Integer) as Boolean
'*** Reference Code is mandatory and should not contain more than 10
characters

'Declare variables
dim sRefCode as string
dim iRefCodeLen as integer
dim bResult as Boolean

'Initialise variables
bResult = false
sRefCode = trim(lbAccountStatuses.cell(iRow,COL_REFCODE))
iRefCodeLen = Len(sRefCode)

'Validation Rules
if iRefCodeLen = 0 then
modSoftpacLibrary.MessageBox "Please enter a reference code."
elseif iRefCodeLen > MAXCHAR_REFCODE then
modSoftpacLibrary.MessageBox Trim(Str(iRefCodeLen)) + _
" characters have been entered for Reference Code. Please ensure
there is only a maximum of " + _
Trim(Str(MAXCHAR_REFCODE)) + " characters."
else
bResult = true 'valid
end if

'If not valid then put cursor back to field so the user can make necessary
change
if not bResult then
lbAccountStatuses.ActiveCell.SetFocus
end if

'return the validation result
return bResult
End Function
****************************************************

The Solution:
------------------
??? - Well you think that would be simple! Obviously not to someone like me
who is frustrated and my emotions are getting in the way for me to see
objectively what is causing the problem :-(


Kindest Regards - Brent














_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

RE: Compile Error:-> There is no class with this name
Date: 24.01.05 04:26 (Sun, 23 Jan 2005 21:26:36 -0600)
From: Joseph Claeys
I think you need to increase the scope. Give it a try and see what
happens...

~joe

-----Original Message-----
From: <email address removed>
[mailto:<email address removed>] On Behalf Of Brent
Shire
Sent: Sunday, January 23, 2005 9:11 PM
To: <email address removed>
Subject: Compile Error:-> There is no class with this name

I am new to REAL Basic, but have been coding for 15 years with around 6
years in VB and around 2 years with VB.NET.

However, this compiler error message has me totally stumped. I have read
the user guide twice, language reference for days now, past forum posts etc.
I am certain I have done all that has been documented (but obviously not) to
no avail.

Background:
-----------------

I am using REAL Basic Standard 5.5.4 for Windows (registered not demo) on
Windows XP service pack 2. I am using standard controls, classes etc that
came with RealBASIC, although I have purchased 3rd party stuff (eg MBS
plug-in) - but I have not used as yet, but fully intend to later on.

I have a window object called winAccountStatuses. It has a multi-column
list box. First column is reference code, second column is reference
description. It gets it contents from a MS Access XP (SP3) database table
(this part of the code works fine). I have a push button ("Add") on the
form/window so the user can add a new record. A blank row is added to the
listbox, and the reference code cell is made editable. The user can enter
text. All works fine so far. I want to write a function that validates
what the user types into the reference code. (eg. mandatory field, max char
etc - now don't tell me you can do this in the IDE properties window - I
know - but I just want to write a quick function to get this working while I
am learning - later on I will code the actual validation, ie. first 3 char
must be alpha, followed by 2 char that must be digits etc etc)

The problem:
------------------

In the Window Editor for winAccountStatuses, I right clicked and selected
New Method. Entered a name, parameter, return type and scope. (see code
below) The function scope only needs to be private as certain events (eg.
Action for the OK pushbutton, CellLostFocus for the listbox) of controls in
the winAccountStatuses window will be the only area using it (naturally - as
its a custom validation routine specific to this window/form).

But when compile (debug/run), the compiler reports the following error:

"There is no class with this name winAccountStatuses.RefCodeValidated:
Function RefCodeValidated(iRow as Integer) as Boolean"

********** OFFENDING CODE ******************* Private Function
RefCodeValidated(iRow as Integer) as Boolean
'*** Reference Code is mandatory and should not contain more than 10
characters

'Declare variables
dim sRefCode as string
dim iRefCodeLen as integer
dim bResult as Boolean

'Initialise variables
bResult = false
sRefCode = trim(lbAccountStatuses.cell(iRow,COL_REFCODE))
iRefCodeLen = Len(sRefCode)

'Validation Rules
if iRefCodeLen = 0 then
modSoftpacLibrary.MessageBox "Please enter a reference code."
elseif iRefCodeLen > MAXCHAR_REFCODE then
modSoftpacLibrary.MessageBox Trim(Str(iRefCodeLen)) + _
" characters have been entered for Reference Code. Please ensure
there is only a maximum of " + _
Trim(Str(MAXCHAR_REFCODE)) + " characters."
else
bResult = true 'valid
end if

'If not valid then put cursor back to field so the user can make necessary
change
if not bResult then
lbAccountStatuses.ActiveCell.SetFocus
end if

'return the validation result
return bResult
End Function
****************************************************

The Solution:
------------------
??? - Well you think that would be simple! Obviously not to someone like me
who is frustrated and my emotions are getting in the way for me to see
objectively what is causing the problem :-(

Kindest Regards - Brent









_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Compile Error:-> There is no class with this name
Date: 24.01.05 05:50 (Sun, 23 Jan 2005 22:50:19 -0600)
From: Craig Sutherland
On Jan 23, 2005, at 9:11 PM, Brent Shire wrote:
> I am new to REAL Basic, but have been coding for 15 years with around 6
> years in VB and around 2 years with VB.NET.
>snip<
> I have a window object called winAccountStatuses. It has a
> multi-column
> list box. First column is reference code, second column is reference
> description. It gets it contents from a MS Access XP (SP3) database
> table
> (this part of the code works fine). I have a push button ("Add") on
> the
> form/window so the user can add a new record. A blank row is added to
> the
> listbox, and the reference code cell is made editable. The user can
> enter
> text. All works fine so far. I want to write a function that
> validates
>snip<
> In the Window Editor for winAccountStatuses, I right clicked and
> selected
> New Method. Entered a name, parameter, return type and scope. (see
> code
> below) The function scope only needs to be private as certain events
> (eg.
> Action for the OK pushbutton, CellLostFocus for the listbox) of
> controls in
> the winAccountStatuses window will be the only area using it
> (naturally - as
> its a custom validation routine specific to this window/form).
> But when compile (debug/run), the compiler reports the following error:
> "There is no class with this name winAccountStatuses.RefCodeValidated:
> Function RefCodeValidated(iRow as Integer) as Boolean"
> ********** OFFENDING CODE *******************
> Private Function RefCodeValidated(iRow as Integer) as Boolean
> 'Declare variables
> dim sRefCode as string
> dim iRefCodeLen as integer
> dim bResult as Boolean
>
> 'Initialise variables
> bResult = false
> sRefCode = trim(lbAccountStatuses.cell(iRow,COL_REFCODE))
> iRefCodeLen = Len(sRefCode)
>
> 'Validation Rules
> if iRefCodeLen = 0 then
> modSoftpacLibrary.MessageBox "Please enter a reference code."
> elseif iRefCodeLen > MAXCHAR_REFCODE then
> modSoftpacLibrary.MessageBox Trim(Str(iRefCodeLen)) + _
> " characters have been entered for Reference Code. Please
> ensure
> there is only a maximum of " + _
> Trim(Str(MAXCHAR_REFCODE)) + " characters."
> else
> bResult = true 'valid
> end if
>
> 'If not valid then put cursor back to field so the user can make
> necessary
> change
> if not bResult then
> lbAccountStatuses.ActiveCell.SetFocus
> end if
>
> 'return the validation result
> return bResult
> End Function
> Kindest Regards - Brent
> Brent

Brent,

What is the code in the Action Event of button Add that calls the
RefCodeValaidated method?

Craig

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Compile Error:-> There is no class with this name
Date: 24.01.05 19:10 (Mon, 24 Jan 2005 10:10:19 -0800)
From: Stuart Malin

On Jan 23, 2005, at 7:11 PM, Brent Shire wrote:

<snip>

> But when compile (debug/run), the compiler reports the following error:
>
> "There is no class with this name winAccountStatuses.RefCodeValidated:
> Function RefCodeValidated(iRow as Integer) as Boolean"
>
> ********** OFFENDING CODE *******************
> Private Function RefCodeValidated(iRow as Integer) as Boolean

Is this Function located in a class that is named AccountStatuses ?

Do you have other methods in that class which are called and do not
generate the compiler error?

Where is the line that the error is reported against? And what does it
look like?

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Compile Error:-> There is no class with this name
Date: 23.01.05 23:23 (Sun, 23 Jan 2005 22:23:42 EST)
From: GAmoore aol.com
I have gotten that error. I think i misspelled integer as intger, or some
other simple mistake.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

Re: Compile Error:-> There is no class with this name
Date: 25.01.05 00:24 (Tue, 25 Jan 2005 09:24:03 +1000)
From: Brent Shire
Thanks for the tips so far.

> I have gotten that error. I think i misspelled integer as intger, or some
other simple mistake.

Sometimes it is as simple as that. I doubled checked, but my eyes haven't
picked up any spelling mistakes as yet.

> I think you need to increase the scope. Give it a try and see what
happens...

Yes, that's what I thought too. Changed the scope to public (might as well
go for the whole hog), and same error message appeared.

> What is the code in the Action Event of button Add that calls the
RefCodeValaidated method?

The action event code for Add button is:

Sub Action()
me.Enabled = false //don't want the user to add another row while
adding a row!
lbAccountStatuses.AddRow ""
lbAccountStatuses.Selected(lbAccountStatuses.LastIndex) = true
lbAccountStatuses.EditCell lbAccountStatuses.ListIndex, COL_REFCODE
//COL_REFCODE is a constant with a value of 0
End Sub

The action event code for the OK button is:

Sub Action()
if RefCodeValidated(lbAccountStatuses.ListIndex) then
'*** TO DO: write code to add new row to database table. Until then
close window/form.
close
end if
End Sub

I decided in the end to export the code, deleted the validation function
rountine, added a new method again and called it the same name, return type
etc, then copied and pasted the code back in. Recompiled - no errors! Does
that mean Real BASIC Windows IDE is buggy/flaky?

- Brent


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

RE: Compile Error:-> There is no class with this name
Date: 25.01.05 03:07 (Mon, 24 Jan 2005 21:07:02 -0500)
From: RBNUBE
The only thing I've noticed flaky about RB is that tab panels are a bit
buggy within the IDE. Things move out of position through one panel to
another. Other than that, the IDE and the applications it generates
seem very solid...at least as solid as your programming.


-----Original Message-----
From: <email address removed>
[mailto:<email address removed>] On Behalf Of
Brent Shire
Sent: Monday, January 24, 2005 6:24 PM
To: <email address removed>
Subject: Re: Compile Error:-> There is no class with this name

Thanks for the tips so far.

> I have gotten that error. I think i misspelled integer as intger, or
> some
other simple mistake.

Sometimes it is as simple as that. I doubled checked, but my eyes
haven't picked up any spelling mistakes as yet.

> I think you need to increase the scope. Give it a try and see what
happens...

Yes, that's what I thought too. Changed the scope to public (might as
well go for the whole hog), and same error message appeared.

> What is the code in the Action Event of button Add that calls the
RefCodeValaidated method?

The action event code for Add button is:

Sub Action()
me.Enabled = false //don't want the user to add another row while
adding a row!
lbAccountStatuses.AddRow ""
lbAccountStatuses.Selected(lbAccountStatuses.LastIndex) = true
lbAccountStatuses.EditCell lbAccountStatuses.ListIndex, COL_REFCODE
//COL_REFCODE is a constant with a value of 0 End Sub

The action event code for the OK button is:

Sub Action()
if RefCodeValidated(lbAccountStatuses.ListIndex) then
'*** TO DO: write code to add new row to database table. Until
then
close window/form.
close
end if
End Sub

I decided in the end to export the code, deleted the validation function
rountine, added a new method again and called it the same name, return
type etc, then copied and pasted the code back in. Recompiled - no
errors! Does that mean Real BASIC Windows IDE is buggy/flaky?

- Brent

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>