WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: cpizu on July 12, 2017, 06:04:06 AM

Title: Sending a comma
Post by: cpizu on July 12, 2017, 06:04:06 AM
I'm trying to send a comma in the file my script is reading, I've tried everything and the only way I can get it to work is when I write it in the actual script, which I don't want to do.

I've tried:
TODAYI{,}82
TODAYI{","}82


I want to have it output TODAYI,82
Title: Re: Sending a comma
Post by: JTaylor on July 12, 2017, 06:38:50 AM
Assuming I understand and assuming you have a recent version of WinBatch....maybe something like:


  TODAYI:",":82

or take a look at StrCat().

Jim
Title: Re: Sending a comma
Post by: td on July 12, 2017, 06:49:39 AM
Quote from: cpizu on July 12, 2017, 06:04:06 AM
I'm trying to send a comma in the file my script is reading, I've tried everything and the only way I can get it to work is when I write it in the actual script, which I don't want to do.

I've tried:
TODAYI{,}82
TODAYI{","}82


I want to have it output TODAYI,82

Because of the braces, I assume by "it" you are referring to the SendKey function but specifying which WIL function or function you are using would be helpful.

In WIL string literals need to be quoted so to get TODAYI,82 you would simply use "TODAYI,82".  If TODAYI is a variable name or the contents of a WIL variable then the concatenation operator ( : ) or StrCat would be appropriate as suggested above.