Author Topic: Writing a variable to event log  (Read 1823 times)

Khalarin

  • Newbie
  • *
  • Posts: 13
Writing a variable to event log
« on: July 16, 2020, 06:43:26 AM »
Hi there, I'm trying to do some looping and having real trouble getting the loop to stop, I've used your example in the Control flow post but when executed the loop doesn't terminate.

I'm really not sure if the var is been initialised properly and was wondering what the format is for getting "write value to event log" would be I've tried myVar [myVar] & [{myVar}] {[myVar]} which has previously worked when I've used
Code: [Select]
Write [Blue] '[{CMDSEGMENT:1}]' to log
I've literally copied the example and after an hour of head scratching I thought I would just ask for some help.

Code: [Select]

Set small int (condition) [myVar] value to 0
Start Loop While : [myVar] Does Not Equal 5
    Set small int (condition) [myVar] value as incremented by 1
    Write [Blue] '[{myVar}]' to log
End Loop

Evaluate 'Not Set' as Zero

It should be writing just 5 lines with the number contained within 'myVar' instead it indefinitely writes [myVar] until i stop it

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Writing a variable to event log
« Reply #1 on: July 16, 2020, 07:02:14 AM »
Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer; The "Text (and Text-To-Speech) Tokens" section contains information on tokens and their syntax.


Are you using the "Small Integer" tab of your "Loop Start" action?

Also note that for practical applications, I'd recommend using the "Loop Start - Repeat a Certain Number of Times" action (as also mentioned in the control flow topic), rather than manually keeping track of a value like this.

Khalarin

  • Newbie
  • *
  • Posts: 13
Re: Writing a variable to event log
« Reply #2 on: July 16, 2020, 07:42:52 AM »
Are you using the "Small Integer" tab of your "Loop Start" action?

Oh Son of a ...... No I wasn't I was using full integer *head-desk*

THANK YOU! lol

I will also review that page and reconsider the loop method =)