Sign in to follow this  
Followers 0
sumit

Please correct the syntax error

12 posts in this topic

#1 ·  Posted (edited)

Please correct this code

$asdf = 5
Send("  value of asdf = $asdf")
Edited by sumit

Share this post


Link to post
Share on other sites



$asdf = 5
Send("    value of asdf = {" & $asdf & "}")

Share this post


Link to post
Share on other sites

$asdf = 5
Send("    value of asdf = {" & $asdf & "}")

Thanks a lot friend

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$asdf = 5
Send("    value of asdf = {" & $asdf & "}")
I just tested, this has a problem when

$asdf = 50

it displays

value of asdf = 5

Please Correct this

Edited by sumit

Share this post


Link to post
Share on other sites

It's the curly braces. Don't know if you need them or not, but if you want them in a Send command, try this:

$asdf = 50
Send("    value of asdf = {{}" & $asdf & "{}}")

BlueBearrOddly enough, this is what I do for fun.

Share this post


Link to post
Share on other sites

Doubt that ... :)

im not kidding ...

CODE
$asdf = 50

Run("notepad.exe")

WinActivate("Untitled")

Sleep(1000)

Send(" value of asdf = {" & $asdf & "}")

Try for yourself

Please Everybody try this and tell me that my autoit is not corrupted. I get value of asdf = 5

Share this post


Link to post
Share on other sites

im not kidding ...

CODE
$asdf = 50

Run("notepad.exe")

WinActivate("Untitled")

Sleep(1000)

Send(" value of asdf = {" & $asdf & "}")

Try for yourself

Please Everybody try this and tell me that my autoit is not corrupted. I get value of asdf = 5

AutoIT is fine, your brain is corrupted.

Are you trying to send the value 50 or ASCII key 50?

Share this post


Link to post
Share on other sites

Joon sent you the wrong fix from your original code.

Original:

$asdf = 5
Send("    value of asdf = $asdf")oÝ÷ ØX±yÖ®¶­sbb33c¶6FbÒP¥6VæBgV÷C²fÇVRöb6FbÒgV÷C²fײb33c¶6Fb

Share this post


Link to post
Share on other sites

Joon sent you the wrong fix from your original code.

Original:

$asdf = 5
Send("    value of asdf = $asdf")oÝ÷ ØX±yÖ®¶­sbb33c¶6FbÒP¥6VæBgV÷C²fÇVRöb6FbÒgV÷C²fײb33c¶6Fb
You should read the whole post before commenting about someone's brain. I was asking for help because i didnt know the syntax . Thanks for finally giving correct syntax

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

AutoIT is fine, your brain is corrupted.

Are you trying to send the value 50 or ASCII key 50?

No... something is odd here... :)

With Send(" value of asdf = " & $asdf) I get this in notepad:

value of asdf = 50

With Send(" value of asdf = {" & $asdf & "}") I get:

value of asdf = 5

ASCII conversion was the first I thought of, except Chr(50) = 2, and Chr(0x50) = P.

The ASCII for 5 is 53 or 0x35.

Something really is odd here...

;)

Edit: The correct Send() format for an ASCII code is: Send(" value of asdf = {ASC " & $asdf & "}"), and that yields as expected:

value of asdf = 2

I'm confused...

;)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

ASCII conversion was the first I thought of, except Chr(50) = 2, and Chr(0x50) = P.

The ASCII for 5 is 53 or 0x35.

Something really is odd here...

:)

Edit: The correct Send() format for an ASCII code is: Send(" value of asdf = {ASC " & $asdf & "}"), and that yields as expected:

value of asdf = 2

I'm confused...

;)

{50} is not a valid syntax ...

Think it just sends the first character and then normally expects a space and a number to repeat it x times.

As far as I can tell from the OP's request the proper code should be:

Send("  value of asdf = " & $asdf)

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0