As promised, here's how to do it (the fine print explains the macros in case anyone's interested):
Requires
MLStockInfo 3.0.218 or later (Available from Cinemar) and
wscVBSEvaluate (Available on bhiga's website here:
http://www.tygatech.com/mainlobby/)
remember to enable WSC plugins in your MLS options
Instructions for creating cycling stock quotes:
1. Set up your stocks in MLStockInfo. The stocks that are used for this setup must be set to #Shares = 1.
2. Check the update setting in MLDateTime. This setting will govern how quickly the stocks cycle. (Default is 15 seconds)
3. Set up the following macros :
macro.stocks.stockquoteinit
Code: Select all
MLServeCmd.Macro|Macro|SetVariable|SQindex~001!SetVariable|SQboundary~12
Here's what it does:
MLServeCmd.Macro|SetVariable|SQindex~001 sets the number of the first stock in the rotation (in this case, mlstockinfo_symbol_001)
MLServeCmd.SetVariable|SQboundary~12 sets the number of stocks that will be displayed. once the counter SQindex reaches this boundary, it's reset to the starting number by macro.stocks.stockquote REMEMBER to set this number to the number of stocks that YOU want to display
macro.stocks.stockquote
Code: Select all
MLServeCmd.Macro|SetVariable|stockquote~{{SQindex}}!MLMath|ADD~SQindex~{{SQindex}}~1!wscVBSEvaluate|Len("{{SQindex}}") = 1~SQlen!MLConditional|IsEqual##{{SQlen}}##True##SetVariable|stockquote~00{{SQindex}}##SetVariable|stockquote~0{{SQindex}}!MLConditional|IsEqual##{{SQindex}}##{{SQboundary}}##SetVariable|SQindex~001##
Here's what it does:
MLServeCmd.SetVariable|stockquote~{{SQindex}} sets the variable {{stockquote}} to the same value as SQindex
MLServeCmd.MLMath|ADD~SQindex~{{SQindex}}~1 increments the value of SQindex by 1
MLServeCmd.wscVBSEvaluate|Len("{{SQindex}}") = 1~SQlen sets the variable {{SQlen}} to "True" if SQindex is one digit long
MLServeCmd.MLConditional|IsEqual##{{SQlen}}##True##SetVariable|stockquote~00{{SQindex}}##SetVariable|stockquote~0{{SQindex}} appends two leading zeros to SQindex if SQlen is "True" and one leading zero if it is "False" (this is a workaround to keep SQindex as a 3-digit number to match the MLStockInfo variables)
MLServeCmd.MLConditional|IsEqual##{{SQindex}}##{{SQboundary}}##SetVariable|SQindex~001## Resets SQindex to 001 when it equals SQboundary
4. Set up the following server rule:
Code: Select all
Whenever currentsecond changes value
then macro.stocks.stockquote
5. Add to MLStartup:
6. Last but not least, put the following code in the label of a text button where you want the stocks displayed:
Code: Select all
{{mlstockinfo_symbol_{{stockquote}}}} {{mlstockinfo_description_{{stockquote}}}} {{mlstockinfo_value_{{stockquote}}}} {{mlstockinfo_change_{{stockquote}}}}
Food for thought: you could have a group of stocks set up for this purpose with #Shares = 1 and still have others set up for other uses with #Shares set to anything you wanted. If, for example, you had stocks 015 through 030 set up for this, then the first macro would become:
MLServeCmd.Macro|Macro|SetVariable|SQindex~015!SetVariable|SQboundary~30
and the second one would set SQindex back to 015 instead of 001
Enjoy!
