NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: DonRidley on October 30, 2017, 03:45:32 AM
-
Hello All,
I have began the process of writing my own CLASS for the purposes of relocating the many small code snippets I use in my NTWS apps under one roof. It has been succesful so far and it has been an eye opening experience. I wished I would have tried this a long long time ago!!
Anyway, I have successfully used "inheritence" to use NT, String Theory, and other methods in my class. One thing I haven't figured out is how to pass a FileName, FieldName, Key, etc., to a procedure in my CLASS.
I'm pretty sure I can design my procedure with something like:
myprocedure(FILE pSomeFile, FIELD pSomeField, KEY pSomeKey)
But, and I guess my question boils down to this, how do I bring the Clarion ABC FileManger into my CLASS? How do I make my class inherit the FIleManager CLASS(s) the same way I did for NT and String Theory?
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PART TWO:
Once I get my CLASS up and running, I would like to share it with the NetTalk community. There has got to be some things I do that someone else will find useful. I will wrap my CLASS in a template to make it easier to use. I will provide the template to Bruce, and if he approves, I will share it here at NetTalkCentral.
One thing that I want to include in my CLASS is a table that I created that recreates most of the main features of the NT Planner. It has:
* Customized Right Side Headers via CSS
* Left Side Column with Clickable Cells that Open a Form as a Popup
* Right Data Cells that Open Popup Form
Why did I recreate the planner? Well, I loved the planner, but I was using it such a way that it was not intended on being used. I used it to track the monthly work schedule of the officers on my shift. (I am a law enforcement shift commander over another supervisor (sergeant) and around 10 officers.) I could never get the NT planner to display correctly. Let me clarify, I could get the top headers (the dates) to align with the data columns at, say, 100% zoom in the web browser. Zooming in or zooming out would break that alignment. So I created a very simple table and slowly added the features I loved about the NT planner.
Anyway, I will provide all of this to Bruce to do with what he wants. If he is ok with it, I will provide it to everyone. Or, maybe Bruce could add it to NT as another option for his cutomers. Basically it will be up to him as my CLASS relies on NT and it's his playground so to speak.
Anyway, I know I rambled on quite a bit but I hope to add something positive to NT that everyone can find useful. I have attached some screen captures.
Thank you for your time,
Don
-
>> and I guess my question boils down to this, how do I bring the Clarion ABC FileManger into my CLASS?
you add a FileManager parameter. so;
myprocedure(FILEMANAGER pSomeFileManager, FIELD pSomeField, KEY pSomeKey)
then in the code you can have
pSomeFileManager.Open()
pSomeFileManager.UseFile()
and so on.
the actual file handle (if you still need it) is pSomeFileManager.Me
>> I will provide the template to Bruce, and if he approves, I will share it here at
NetTalkCentral.
my approval is not necessary <g>.
Cheers
Bruce
-
I was told in comp.lang.clarion NG that it probably couldn't be done.
So, I CAN access a table in my dictionary by passing the table name, field name, etc., via parameters to my CLASS?
To say I cannot seems to go against the very idea that the ABC classes/OOP is based upon.
THANK YOU!!!!!!
UPDATE: Hey Bruce. Do you have an example of this in one of your NetTalk classes?
-
I keep getting, "No matching prototype available."
Calling procedure:
MyClass.TickerTape_Default(TickerTapeMessage,Tic:TickerIdKey,Tic:TickerMessage,pPacket)
Class Procedure
DonRidleyClass.TickerTape_Default PROCEDURE (FileManager pFM,KEY pKey,STRING pMarqueeText,*STRING pReturnPacket) ! Declare Procedure
! ----- st --------------------------------------------------------------------------
st StringTheory
packet StringTheory
p_web NetWebServerWorker ! Generated by NetTalk Extension (Class Definition)
CODE
Blah Blah Blah
-
>> I keep getting, "No matching prototype available."
So the "caller" and the "callee" need to be using parameters of the same type.
DonRidleyClass.TickerTape_Default PROCEDURE
(FileManager pFM,KEY pKey,STRING pMarqueeText,*STRING pReturnPacket)
So problem here, but then the caller MUST pass (explicitly) a
FileManager, Key, <something>, String
so the error is telling you that you aren't doing that.
>> Calling procedure:
>> MyClass.TickerTape_Default(
>> TickerTapeMessage,Tic:TickerIdKey,Tic:TickerMessage,pPacket)
Is TickerTapeMessage a FileManager object? Doesn't look like one. 'd be expecting something like Access:TickerTapeMessage there ...
is pPacket a String? Not a Cstring or StringTheory etc.
Incidentally, given that your class is using StringTheory you might find it easier to use StringTheory objects for return values - then they are not size restricted. so
DonRidleyClass.TickerTape_Default PROCEDURE (
FileManager pFM,KEY pKey,STRING pMarqueeText,StringTheory pReturnPacket)
In this case then pPacket would be a stringTheory object as well.
cheers
Bruce
-
Ah ok.
Great advice to use String Theory object!!
Thank you!!!!!!