Q++Studio Macros : Language Reference

Navigation:  Macros >

Q++Studio Macros : Language Reference

Previous pageReturn to chapter overviewNext page

Q++Studio Macros are routines that are executed by Q++Studio to determine how to respond to the occurrence of a Macro Token. There is function inside Q++Studio associated with each type of token, not only Macro tokens, but what makes macro tokens different, and powerful, is that you are the one writing the function that tells Q++Studio how to respond to a given macro token.


Using the Q++Studio Macro Language you can :


Assign values to variables


Build complex expressions using these variables, as well as system variables.


Call over 50 functions ranging from math to date calculations to text manipulation.


Execute instructions conditionally, and in loops.


The purpose of each macro is to return 2 values :


a string value named sRESULT (some text)


and a Boolean value named bRESULT (true or false).


You then use the Macros Property of the associated DiaryGridLines to tell Q++Studio what to do to the token, or even the textbox that contains it, depending on the values of sRESULT and bRESULT.


Whether bResult is true or false determines the action that Q++Studio will apply to the token text, the entire text of the current textbox, or even to the attributes of the textbox such as frame, background, etc...


The value for sResult may be used to replace the current token, or be combined with other text to replace the current token.


Some examples :


Replace the token by sRESULT or a combination of sRESULT and some other text or even other tokens (eg. replace the token by On [d]-[mmm] : the value is sRESULT). The possible recursive use of other tokens makes the possibilities almost endless.


The value of bRESULT can determine if the text of the token should be changed to a different font and/or font size, or whether the textbox should have a different frame or background shade, or even be deleted, etc…


For more details on the actions that can be triggered based on the values of bResult and sResult, see the Macros Sciptline Property.

Topic 105123 updated on 03-May-2018.
Topic URL: https://www.qppstudio.net/webhelp/index.html?theq__macrolanguage.htm