I would like to add some additional imformation to my MessageBox.Log ASCII file. In the docs I read “Logging Messages to a file (you can determine the file structure and what gets written there)” and “You can do this in the global PrimeLog embed point (before the parent call) in your Data DLL (for multi-dll applications).” CapeSoft MessageBox Complete Documentation but the answer does not say what should I add in that embed point.
I want to add the procedure name ( just to the log, I know I can add it to to the message displayed to end users but it may confuse them) and the BIOS name of the computer acquired from GetComputerName WinAPi call
How can I add additional data fields to messagebox ascii file?
Forget the “procedure name ( just to the log …)” - I found unticking “display the procedure and application name that called the Message()” does the trick. ‘Maintain the Procedure name in the Error Class’ checkbox adds the procedure name to the log only.
So the only question that stays is how do I add additional fields to the log?
Greg, put a comment in that embed point, like !Hi Gregg.
Then generate and/or compile your app.
Then open the APPNAME.CLW module and search for your comment.
This will give a look at the code in context and should help you determine how to proceed.
Post the code you find here if you need additional help.
In my APPNAME.CLW module I have this, but the below code does not add anything to messagebox.log
ThisMessageBox.PrimeLog procedure () !CapeSoft MessageBox Object Procedure
Code
!CapeSoft MessageBox Template Generated code to prime the logging records
!Because there is no File selected, record priming is handled in the object and
!the default ASCII file is used to log the records.
! My custom code start
TestField = 'My test fiels'
ExtraDetails = TestField & ComputerName
! My custom code end
parent.PrimeLog (ExtraDetails)
@Nardus_Swanevelder
Was wondering if “you can determine the file structure and what gets written there” only applies to TPS files. Your example seems to be referring to using dictionary TPS file for logging and I am using ASCII file.
ASCII file is convenient for me as I can easily rotate it on the server side and filter using commandline even if I have no Clarion tools at hand. Also I don’t have to worry about error 47 if I add columns to it.