Topic: Troubleshooting Message

Hi,
I would like to insert a message at various points in my Scripts.  I would like to show a  message along with the value of a variable or a field.
-
I've used ShowMessage('This is a message from ...'); but I'm wondering if there is any way to add a variable or a field to this message?
-
My reasoning for wanting to do this is to be able to tell if a portion of the script file is being activated or ignored.
-
If this is not a worthwhile idea maybe someone can give a suggestion as how to perform this troubleshooting function.
-
Thanks, Frank

2 (edited by sibprogsistem 2020-11-15 19:51:56)

Re: Troubleshooting Message

papafrankc wrote:

Hi,
I would like to insert a message at various points in my Scripts.  I would like to show a  message along with the value of a variable or a field.
-
I've used ShowMessage('This is a message from ...'); but I'm wondering if there is any way to add a variable or a field to this message?
-
My reasoning for wanting to do this is to be able to tell if a portion of the script file is being activated or ignored.
-
If this is not a worthwhile idea maybe someone can give a suggestion as how to perform this troubleshooting function.
-
Thanks, Frank

ShowMessage('This is a message from' + You_var);

OR

if IDOK = MessageBox(Form1.Edit1.Text,'Вопрос',MB_OKCANCEL+MB_ICONINFORMATION) then

http://myvisualdatabase.com/forum/viewt … 553#p35553

3 (edited by ehwagner 2020-11-15 19:56:09)

Re: Troubleshooting Message

Frank,
I use this same method when trying to troubleshoot. Here is how to combine the two:

ShowMessage('Edit1 = ' + Form1.edit1.text);

You can substitute variables for the form fields. Keep in mind though that you may need to provide conversion functions if the variable is not a text string, ie intostr(intvar), datetostr(varDate), etc.

Re: Troubleshooting Message

Gentlemen,
Your solutions are exactly what I was looking for.
On one of my attempts I was trying to show an Integer along with a text message and I did get an error.
But I found the IntToStr function and that took care of it.
Now I have a tool to use in case I need it.
Thanks, Frank