Sign in to follow this  
Followers 0
Buk

Frustration

24 posts in this topic

#1 ·  Posted (edited)

I read in the help where Jon wrote:

"- half of the questions were "how do I use a backslash in a Run command". Arrgh."

(Yes. I've read everything!)

So, how come if I type 'backslash' into the index it doesn't appear?

Nor is it documented (anywhere) how to embed a full path into the string you supply to Run().

So, how do I use backslashes in the Run() command (function)? (**)

And that pretty much explains the title.

Just one line; a comment in pasing; an example somewere of something sooo fundamental; something that has obviously frustrated a lot of people going back a very long time; would save so much trouble!

Another example:

I wanted to track why I was gettig into an infinite loop. I looked around and found SplashTextOn(). That'll do. A liitle non interactive display of a variable or two as the loop executes will fix me right up. So I coded:

SplashTextOn( "Pixel color", '', 100, 100 );
For $i = 1 to 10 
    sleep ( 1000 );
    ControlSetText( "Pixel color", '', '', $i );
Next
SplashOff();

First time around the loop the title text gets replaced by the variables value (Why? The fourth parameter to ControlSetTest() is "text", not "Title text"). There after, nothing changes. Because the title text no longer matches the first arg to CST().

Okay, try again:

SplashTextOn( "Debug", 0, 100, 100 );

For $i = 1 to 10 
    sleep ( 1000 );
    ControlSetText( "Debug", $i-1, '', $i );
Next
SplashOff();

Same problem. The title text rather than the body text is changed! Try again.

SplashTextOn( "Debug", 0, 100, 100 );

For $i = 1 to 10 
    sleep ( 1000 );
    ControlSetText( "Debug", $i-1, '', $i );
Next
SplashOff();

That works. But why oh why can i not change the body text? Given the documentation says:

SplashTextOn ( "title", "text" [, w [, h [, ...

And

ControlSetText ( "title", "text", ...

And the example:

SplashTextOn("TitleFoo", $message, -1, -1, -1, -1, 4, "")
For $x = 1 to 20
    $message = $message & $x & @LF
    ControlSetText("TitleFoo", "", "Static1", $message)
    sleep(100)
Next

Wait a minute. What that "Static1" all about?

Docs: controlID The control to interact with. See Controls.

and: Note: If this special format is not used then the parameter is taken to be a control ID (if numeric) or the ClassnameNN/text of the control (if a string).

So where did they get "static1" from?

How do I use the return value from SplashTextOn()?

And there you have it. Frustration. An immensely powerful utility completely hamstrung by documentation that creates more questions than answers.

I'm no newbie to programming (25+years), and I've a dozen or so languages under my belt, and the last two days trying to something relatively trivial to go with AutoIt and, to misquote Jon

Gaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah!

Buk

(**) Yes. I tried doubling the backslashes to no avail Printed out @ERROR and got '1'. Very helpful-not!

So, then I switched them to forward slashes and it worked.

But if working out how to use every function is a matter of trial and error and "guess what that might mean", it'll take months to do what I've set out to do. Quicker to do it by hand. My left hand, whilst my dominant right is tied behind my back and I'm wearing a blindfold.

Edited by Buk

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Run works fine with backslashes, I don't understand why you had so much problems with it. The help file examples all work too, straight out of the box, copy-pasta-run.

You're thinking is too complicated. AutoIt is a simple language for automation. : )

By the way, doubling the backslashes is useless. In AutoIt a backslash is not an escape character, in fact there is no escape character at all.

Edited by Manadar

Share this post


Link to post
Share on other sites

Run works fine with backslashes, I don't understand why you had so much problems with it.

You're missing the point. In every other language I've used or am familiar with, backslashes in strings have to be escaped, so I automatically escaped them. Nothing worked. The same will be true for many (most) programmers coming to AutoIt. This is obviously a common problem--sufficiently enough to have been a source of frustration to the author going back years.

So why not explain it up front? Or just include some in the Run() example.

For all the world it reminds me of my ex: "I can tell by your face that something is wrong dear. What?"..."Humph. If you do know, I'm not going to tell you!".

The help file examples all work too, straight out of the box, copy-pasta-run.

True...but only because they often include magic numbers or strings--"Edit1" & "Static1"--for which no explanation is given. So whilst the example works, attempts to write your own fail for lack of some detail or another.

I still don't understand why the ttle text was being changed rather than the client area text? I'm guessing because I didn't supply the right "ControlID"; but as the explainations of what that is are shrouded in mystery, how could I?

You're thinking is too complicated. AutoIt is a simple language for automation. : )

Sorry, but changing the way I think is a tall order. I've been doing it this way for a long time :D

By the way, doubling the backslashes is useless.

No shit Sherlock! :D

In AutoIt a backslash is not an escape character, in fact there is no escape character at all.

Yep! That would do it. That simple addition to the Remarks section of Run(). Or indexed under "backslash" or "escape".

(Well, barring the doubled quotes mechanism!)

Buk.

Share this post


Link to post
Share on other sites

You are doing 'quote mining'. That's not polite.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

You are doing 'quote mining'. That's not polite.

I've no idea what that is, but if responding in detail to anothers' post is deemed "impolite", then the infraction is entirely in the mind of the deemer. I simply reponded as I might in face to face conversation.

Share this post


Link to post
Share on other sites

I've no idea what that is

No shit Sherlock!

See that.

There is a big difference between responding in detail and out of context quoting.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

No shit Sherlock!

See that.

There is a big difference between responding in detail and out of context quoting.

Sorry, but you do not know what you are talking about. I quoted every line, word, syllable and character of the post to which I responded. How can it be "out of context". (No question mark. It's rhetorical!)

On the other hand, your quote of me was out of context.

But C'est la vie. Every on-line forum I've ever interacted with, and they are many, has its own set of unwritten and capricious rules selectively enforced by the local jobs-worth with too much time on their hands and nothing to say about the content so they attack the form instead.

The speed of the form attacks versus the content responses is usually strongly indicative of the tone of the forum, and the amount of help one can expect to receive there.

You can now relax and give yourself a pat on the back. Your task is done. Yet another newbie will now disappear back into the ether whence he came and seek out alternative solutions. Hopefully I'll find one with support mechanisms where solving the problem, is more important than playing "beat the newbie".

Be well, Buk

Share this post


Link to post
Share on other sites

..

By the way, doubling the backslashes is useless. In AutoIt a backslash is not an escape character, in fact there is no escape character at all.

The backslash must be doubled in StringFormat.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

hi

i'm not a newbie but i started scripting with autoit and i just don't see where the problem is. it's a basic-like language that uses standard windows interface. so just do it as you would on your desktop.

you want to run a program? just give it the full path as you'd do in a cmd window: Run ( "C:\programs\app\myprogram.exe", ... )

you want to have that return value? save it in a variable: $var = GUICtrlCreateButton ( ..., ... )

how do you do that in other laguages? in every scipting engine i have used so far it's more or less the same. you're indeed looking too far. if it doesn't work, make it simple. this is scripting, not programming. i learned everything from the internal documentation. the examples are good if you read them carefully. there's nothing like magic numbers in there.

regards,

roberto

Edited by ajundra

Share this post


Link to post
Share on other sites

On the other hand, your quote of me was out of context.

Excellent observation.

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

I wasn't going to respond further, but I've continue monitoring in the vain hope of someone addressing the actual content of my post. and saw this piece of self-serving, self-delusional misdirection.

Excellent observation.

So? You doing--presumably by way of example--exactly what you falsely & inexcusably accused me of doing, somehow gives you moral superiority? At least in your own mind.

You really are full of shit aren't you.

It's a real shame that google doesn't seem to index this place, cos it would be really revealing to know if you've made a habit of this--and probably other--plausible sounding false allegations in order to acquire your positive rep.

Edited by Buk

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Buk, I was going to respond intellectually to your replies (You make some valid and interesting points) but you seem to prefer quarreling with trancexx. Have a nice day.

Edited by Manadar

Share this post


Link to post
Share on other sites

I wasn't going to respond further, but I've continue monitoring in the vain hope of someone addressing the actual content of my post. and saw this piece of self-serving, self-delusional misdirection.

So? You doing--presumably by way of example--exactly what you falsely & inexcusably accused me of doing, somehow gives you moral superiority? At least in your own mind.

You really are full of shit aren't you.

It's a real shame that google doesn't seem to index this place, cos it would be really revealing to know if you've made a habit of this--and probably other--plausible sounding false allegations in order to acquire your positive rep.

chill. you will not receive any help this way. People are not obligated to help anyone, only if they feel like it. And antagonizing them isn't the best way to go for it. Maybe you should start again in a less boisterous and somewhat more polite way. Maybe ask a mod to delete this thread and then ask your question again, hopefully in a softer tone this time. just an advice from another newbie.

Share this post


Link to post
Share on other sites

Buk, I was going to respond intellectually to your replies (You make some valid and interesting points) but you seem to prefer quarreling with trancexx. Have a nice day.

Were you? Really?

Gosh darn it. If only that darn trancexx hadn't gone and gotten my gander up.

(I wonder why he didn't respond "intellectually" first time around before trancexx ever stuck hi..he...its nose in?)

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

I take up a friendly role and try to contribute in the discussion and you start fighting at random. You seem to come here only to manifest your frustration onto others, hence the topic title, even though the frustration is created only by your narrow minded programming abilities. I suggest you take Rishav's advice, or your stay here on the forum probably won't be a very long one.

Edit: That's not a threat, merely a careful observation that I'm able to make after dealing with thousands of users seeking help on this forum.

Edited by Manadar

Share this post


Link to post
Share on other sites

Many times I've thought that the help file needs more examples and diversity in them. I spend a lot of time with trial and error approach or just searching the forum for questions that are 200% certain to arise even after reading the help file.

I believe a selected few experienced community members should start submitting examples and documentation change suggestions, if the devs allow it.

Share this post


Link to post
Share on other sites

I'm no newbie to programming (25+years), and I've a dozen or so languages under my belt

I was just wondering; which programming languages are you familiar with?

Share this post


Link to post
Share on other sites

I'm more interested in the fact the he's supposed to know so many languages yet he assumes automatically that backslashes always have to be escaped.

I mean, after handling a diverse group of languages, shouldn't it be obvious that language rules aren't always the same? That's the point of having to learn the syntax for a new language, whether '\0' or 'null' is the null value or if there's a null value at all, or if '->' or '.' is used to reference a field or method in a structure or object.

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

I'm more interested in the fact the he's supposed to know so many languages yet he assumes automatically that backslashes always have to be escaped.

I mean, after handling a diverse group of languages, shouldn't it be obvious that language rules aren't always the same? That's the point of having to learn the syntax for a new language, whether '\0' or 'null' is the null value or if there's a null value at all, or if '->' or '.' is used to reference a field or method in a structure or object.

Geez!

I use C/C++, Perl, Ruby & Haskell daily. OCaml, Oz, & erlang regularly. Occasionally, C# and NASM.

In all of these, backslashes in string constants need to be escaped. Since the example didn't use a fully qualified or relative path, I was forced to guess how to code a full path, so I went with what I knew and didn't work. And it gave me '1' as the only error diagnostic.

The documentation index doesn't even mention backslash. And given the format it comes, it is impossible to search it for anything that the writers didn't think to index. Well almost. I ran a binary grep over the raw data and found the reference to 'backslash' in the author's, Jon, write-up, bemoaning the number of questions he receiving regarding how to include backslashes in thr Run() command 5 or 6 years ago. Given that, don't you find it remiss--if not downright bloody-minded--that this is mentioned anywhere?

Yes, when you use a new language you have to look things up. I tried. But the whole point is that you can't, because they aren't ^%(&^% documented!

Edited by Buk

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