Setting variable to an Extended ASCII Character

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
AndrewT
Junior Coder
Posts: 38
Joined: Thu Sep 17, 2015 6:06 pm

Setting variable to an Extended ASCII Character

Post by AndrewT » Wed Aug 15, 2018 9:45 pm

Why doesn't this code work?

Code: Select all

Let>fnd={Ascii(150)}
This also doesn't work.

Code: Select all

If>{%Target% = Ascii(150)}
I get the error "Unknown Identifier ASCII." How else can I set a variable to extended ASCII code?

Any help would be appreciated.

AndrewT

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Setting variable to an Extended ASCII Character

Post by Marcus Tettmar » Wed Aug 15, 2018 11:28 pm

It doesn't work because there is no such function "Ascii".

You could do:

Code: Select all

VBEval>Chr(150),theChar
...
If>{%Target% = %theChar%}
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

AndrewT
Junior Coder
Posts: 38
Joined: Thu Sep 17, 2015 6:06 pm

Re: Setting variable to an Extended ASCII Character

Post by AndrewT » Thu Aug 16, 2018 1:22 pm

Ok, I guess I was misunderstanding this.

https://www.mjtnet.com/manual/index.html?ascii.htm

AndrewT

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Setting variable to an Extended ASCII Character

Post by Marcus Tettmar » Mon Aug 20, 2018 5:56 pm

That function *SENDS* characters to the active window. It does the same as Send/SendText but instead of giving it the characters to send you give it the ascii codes of the characters you want to send.

It doesn't determine the character from the ascii code (unless you want to send it to e.g. Notepad and then copy that to the clipboard.

VBScripts CHR function takes an ascii code and returns the character.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts