Author Topic: Sending a comma  (Read 251 times)

cpizu

  • Newbie
  • *
  • Posts: 1
Sending a comma
« 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

JTaylor

  • Pundit
  • *****
  • Posts: 786
    • Data & Stuff Inc.
Re: Sending a comma
« Reply #1 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

td

  • Tech Support
  • *****
  • Posts: 2185
    • WinBatch
Re: Sending a comma
« Reply #2 on: July 12, 2017, 06:49:39 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.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates