Skip to main content

Im wondering how it is possible to have the text of an error or informational message using the 'message' keyword or 'askmess' keyword be controlled by variables and not literal text.  We have a need where the contents of the message could change based on location of a file, for instance.  Consider the following example of what I would like to be able to do.  We would use the message in s_log_text to both display a message on the screen to the user, as well as write the text to a log file.

s_log_text = "File '%%s_filename%%%' saved successfully."
message/info s_log_text
activate "sl_logfile".o_write(s_log_text, s_log_filename)

Right now, if I were to execute this, the message box appears blank.  The only way I can seem to get this to work so far is to type out the text literally between double quotes, duplicating what is in s_log_text, with possible inconsistencies.  Is it possible to do what I want above?



------------------------------
Tim Colvin
Smyth Retail Systems Inc.
Alliance OH US
------------------------------

Im wondering how it is possible to have the text of an error or informational message using the 'message' keyword or 'askmess' keyword be controlled by variables and not literal text.  We have a need where the contents of the message could change based on location of a file, for instance.  Consider the following example of what I would like to be able to do.  We would use the message in s_log_text to both display a message on the screen to the user, as well as write the text to a log file.

s_log_text = "File '%%s_filename%%%' saved successfully."
message/info s_log_text
activate "sl_logfile".o_write(s_log_text, s_log_filename)

Right now, if I were to execute this, the message box appears blank.  The only way I can seem to get this to work so far is to type out the text literally between double quotes, duplicating what is in s_log_text, with possible inconsistencies.  Is it possible to do what I want above?



------------------------------
Tim Colvin
Smyth Retail Systems Inc.
Alliance OH US
------------------------------

The help page indicates it has to be a literal, but

message/info "%%s_log_text%%%" 

Should do the trick.

 

Regards,

Iain



------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------

The help page indicates it has to be a literal, but

message/info "%%s_log_text%%%" 

Should do the trick.

 

Regards,

Iain



------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------

Interesting because I'd tried this yesterday and it wasnt working.  And for some reason still doesnt work in the circumstance Im trying to get it to work.  however, in isolation, the concept works.

So Ive clearly got some digging to do.  This at least gives me the sanity check that it works.  Now I just have to figure out why its not working in this specific case.



------------------------------
Tim Colvin
Smyth Retail Systems Inc.
Alliance OH US
------------------------------

Interesting because I'd tried this yesterday and it wasnt working.  And for some reason still doesnt work in the circumstance Im trying to get it to work.  however, in isolation, the concept works.

So Ive clearly got some digging to do.  This at least gives me the sanity check that it works.  Now I just have to figure out why its not working in this specific case.



------------------------------
Tim Colvin
Smyth Retail Systems Inc.
Alliance OH US
------------------------------

Turns out I overlooked something in my code.  The documentation is pretty clear that the message can only be 512 characters.  In my specific case, Im grabbing some error text and dumping it to a log file and was mistakenly also trying to display that text in the message, which I didnt want to do.  Once I realized the mistake and corrected it, the message text works as advertised.

Thanks again for the sanity check.



------------------------------
Tim Colvin
Smyth Retail Systems Inc.
Alliance OH US
------------------------------