Author Topic: Parameter output to the event log?  (Read 3285 times)

MonkeyMagic75

  • Newbie
  • *
  • Posts: 8
Parameter output to the event log?
« on: November 03, 2020, 04:49:48 AM »
Hi,
How do I write out a parameters value to the event log?
Im using the write function but can only output the literal variable name string but not the value. Ive looked for escape keys but can't find any. Could some post an example please?
Thanks.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4647
  • RTFM
Re: Parameter output to the event log?
« Reply #1 on: November 03, 2020, 09:53:55 AM »
Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer.

For the "Write a Value to the Event Log" action, you'll want to use one of the type-specific tokens to retrieve the value of your variable, E.G.
Code: [Select]
Write [Blue] '{TXT:My Value}' to log


This topic may contain useful information on tokens, though it is a not a substitute for reading the official documentation.

MonkeyMagic75

  • Newbie
  • *
  • Posts: 8
Re: Parameter output to the event log?
« Reply #2 on: November 03, 2020, 01:54:10 PM »
Awesome, thank you.

liebeFrankie

  • Newbie
  • *
  • Posts: 1
Re: Parameter output to the event log?
« Reply #3 on: March 17, 2024, 05:16:26 AM »
Just to be completely clear (which I did not find from the previous posts):

To write an integer variable's contents to the log,
Write [Yellow] '{EXP:{INT:myvariable}}' to log

At least this works today (while the stuff I found earlier in this thread did not).

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4647
  • RTFM
Re: Parameter output to the event log?
« Reply #4 on: March 17, 2024, 05:21:51 AM »
There is no reason to involve the "{EXP:}" token.

Code: [Select]
Write [Yellow] '{INT:myvariable}' to logwill work just fine.


Not sure what you mean by
Quote
At least this works today (while the stuff I found earlier in this thread did not).

Did you notice
Quote
you'll want to use one of the type-specific tokens to retrieve the value of your variable
?

I.E. the token you'd use, would be specific to the type of variable value you're trying to retrieve, which in your case is the "{INT:}" token to retrieve an integer value, and in my example is the "{TXT:}" token to retrieve a text value.