Reference Guide > T Routines > TmGetMessage Function
  

TmGetMessage Function
Loads a string resource file into the resource database and extracts a message string from the database.
Usage
message = TmGetMessage( [message_file], message_code)
Parameters
message_file—(optional) The name of a string resource file where the messages are stored. If this file has not already been loaded, it will be loaded before the message is retrieved.
message_code—String used to identify a message in a string resource file.
Returned Value
message—A string containing the message that was extracted from the string resource file.
Keywords
None.
Discussion
You only need to supply the filename for the message_file input parameter. The pathname is assumed to be the following, where !Lang represents the value of the !Lang system variable in PV‑WAVE:
(UNIX) <wavedir>/xres/!Lang/vdatools
(WIN) <wavedir>\xres\!Lang\vdatools
Where <wavedir> is the main PV-WAVE directory.
Although the message file is passed to each call of TmGetMessage, the specified string is only loaded once.
Example
This example shows a portion of the string resource file for the WzPlot VDA Tool: wzglobal.ads. An excerpt from the source code for the WzPlot VDA Tool shows how TmGetMessage is used to load this file into the resource database and extract a string from the database. In this example, the string is extracted and printed in the Message Area of the WzPlot window whenever a new variable is passed to WzPlot.
String resource file excerpt:
!       Data Import Messages (in wzglobal.ads)
!
imported_var:   Imported Variable: 
WzPlot source code:
; Get the appropriate message text from the string resource file. 
msg = TmGetMessage('wzglobal.ads', 'imported_var')
; Build a message string with the variable name. 
msg = msg + variable_list(j)
; Display the message in the VDA Tool's Message Area. 
WoAddMessage, tool_name, Message=msg
See Also
WoAddMessage

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.