Sign in to follow this  
Followers 0
Selmabody

I know very little but what I do know has me playing!

5 posts in this topic

#1 ·  Posted (edited)

My wife is a traveling ultrasound tech and for the past 5 years we have worked in 7 states and 11 different hospitals. While at the University of Wisconson in Madison a fellow traveler gave me an Autoit script to get repeating data into our case logs. I only know how to adjust a script in very minor ways and have had success in updating it as needed. Until now....The new version of our software has added a - between some words on the buttons that I need clicked I have tried to enter as below:

$Ultrasound-ProfileButton =

For the windows button that says Ultrasound-Profile

I get an error because of the - in the name???

I have read several hours of the help file but I can't seem to find the solution. I now humbly throw myself at your mercy...be gentle, it has been a long day.

Thanking you in advance,

Michael

Edited by Selmabody

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

AutoIt is seeing the - as a subtract symbol, and trying to subtract ProfileButton from the variable $Ultrasound. This obviously isn't going to work. The solution: don't use symbols in variable names.

Just a note: you posted in the Scripts and Scraps forum, which is not a general support forum (as the title clearly states). From now on, please post support-related questions in the support forum.

Oh, and welcome to the forums.

An example to show what I mean:

$hello = 2
MsgBox (0, "", $hello-1)
Edited by greenmachine

Share this post


Link to post
Share on other sites

AutoIt is seeing the - as a subtract symbol, and trying to subtract ProfileButton from the variable $Ultrasound. This obviously isn't going to work. The solution: don't use symbols in variable names.

Just a note: you posted in the Scripts and Scraps forum, which is not a general support forum (as the title clearly states). From now on, please post support-related questions in the support forum.

Oh, and welcome to the forums.

An example to show what I mean:

$hello = 2
MsgBox (0, "", $hello-1)
Sorry for the post in the wrong area. After I posted, I then saw the banner big and bold. Can the mod move this to the proper area?

Now, like I said, I do not know much about this but I will always hunt the help files before asking. I guess that I am totally in the dark here. When I needed to edit the script to adjust for program changes I always just changed to the new button name and it's ClassNameNN located with AutoInfo. >>>Control Under The Mouse>>> section. But now that there is a hyphen in the text of the new button name, I get the errors. How can I get around this? I went to the help files and read all on the use of MsgBox but I still can't get this to work around the problem.

At a better time in my life this would be just the thing I would dig into. A few years back I aquired Reflex Sympathetic Dystrophy. ( RSD) Left untreated, the pain is severe and I cannot move my arms or walk. With medication, I have mobility but my mental capacity is severly retarded. Short term memory is zapped. I am really trying to get a grasp of how I should work around this problem but I cannot seem to follow a process that will lead me to my answer.

I hate to take up your time on what I am sure is elementary scripting but I just can't find my way to the end result. Can you help with a little more direction?

The old variable read:

$Profiles = "Class name here";

$Ultrasound-ProfileButton = "New Class Name Here";

The new button on the program went from Profiles to Ultrasound-Profiles

Please push or kick me into the right direction.

Thanks,

Michael

Share this post


Link to post
Share on other sites

Just don't include any symbols in variable declarations. In other words, change $Ultrasound-ProfileButton to $UltrasoundProfileButton. You could also add a comment next to the declaration to remind you that it is changed.

In AutoIt, the ; means the start of a comment - there is no "endline" character. So, adding on to your existing line with my single change:

$UltrasoundProfileButton = "New Class Name Here"; changed to Ultrasound-Profile

From the ; to the end of the line will be ignored.

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