Implementing Interfaces in clarion 11 ABC

Hi,
I need to learn about Interfaces and using them - mostly for Net Talk Application.
NT14 has a handy Interface called:

iNetSessions               Interface()
Save                         PROCEDURE (),Long,Proc,Virtual
Save                         PROCEDURE (*String p_SessionID),Long,Proc,Virtual
Load                         PROCEDURE (),Long,Proc,Virtual
_GetSessions                 PROCEDURE (Long pFilter, String pFilterData, Long pOffset, Long pLimit, StringTheory rResult),Virtual
_SessionRecords              PROCEDURE (),Long,Virtual
_SessionExpired              PROCEDURE (Long pRecordNumber),String,Virtual
_SessionExpired              PROCEDURE (*String p_SessionID),Byte,Virtual
_SessionExpired              PROCEDURE (),Byte,Virtual

… a bunch more interfaces.
The procedures are defined in netwebsessions.inc and netwebsessions.clw

I tried this code in my NT app::

Myint               CLASS,IMPLEMENTS(iNetSessions)
END

However, I get 60 Procedure is not defined error messages.
I want to implement two of the procedures in order to see what is in my session queues:

NetSessionsQueue.iNetSessions._SessionRecords              PROCEDURE()
  code
  return records(self._sessionqueue)
!------------------------------------------------------------------------------
NetSessionsQueue.iNetSessions._SessionDataRecords          PROCEDURE()
  code
  return records(self._sessiondataqueue)

Any help will be appreciated!
Thanks,
Ron

Yeah, that’s the thing about Interfaces. By implementing that interface, you’re guaranteeing to the consumer that the procedures in the interface exist. So even if they don’t do anything, you still have to create them.

Or you could derive from a class that already implements that interface and use derived methods.

Myint CLASS,IMPLEMENTS(iNetSessions)
END

If uou implement an interface you need to implement all the methods.

However if you derive your class from the existing one rhen you can just do the overrides you want. Eg

Include('netwebsessions.inc'),once

Myint CLASS(NetSessionsQueue),IMPLEMENTS(iNetSessions)
END
1 Like

Hi Bruce,
Set it up your way.
Now I get an ISL error:0
Yikes, never seen that before… not sure what to do …
Thanks,
Ron

Hi Ron,
I derive NetSessionQueue class in one of my projects.
Show us your complete line for you class definition.

There is this post on ISL Errors coding classes. Renaming the Class fixed it.

Google “Clarion ISL Error” there are some others.

Maybe I’m thinking of a different odd error, but adding a new Global variable STRING(255) fixed that by shifting addresses.

HI,
This is the data section:

Include('netwebsessions.inc'),once
MySERVERClass       CLASS(NetSessionsQueue),IMPLEMENTS(iNetSessions)
  END

Tried renaming but that did not solve anything.
Ron