Sign in to follow this  
Followers 0
CodyBarrett

exe read from script line (is this possible?)

15 posts in this topic

i would like to have it so the exe can do a func.. then jump to a line in the auto it script... but is this really possible? if it is what is the code? i hve checke the forums and nothing i found helps.. the help guide doesnt help. can you guys help?

Share this post


Link to post
Share on other sites



i would like to have it so the exe can do a func.. then jump to a line in the auto it script... but is this really possible? if it is what is the code? i hve checke the forums and nothing i found helps.. the help guide doesnt help. can you guys help?

If "the exe" and the "script" are the same program - then you are describing a "goto" function. That is not available in AutoIt3. Do you want to learn AutoIt2? :-) :-) :-)

It is best to post a small example of what you want done - then we might be able to give you some work arounds to not having a that evil goto function.

If you are talking about an EXE doing something and then reading/executing lines from another script... there are ways to do that too :-)


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

damn.... that sucks... i take it there is no possible way to do this then?

Share this post


Link to post
Share on other sites

... there is no possible way to do this then?

Yes, there is - but we have to know what this is.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

uhhhh i cant show you examples unless i rewrite my script.... but yeah what ill do is explain it... i would like the EXE to read a specific line in its autoit compilled scipt(of course i know it getts formated)... and then do the EXE from that line down the rest of the script... it sounds like GOTO is what i need... why is it evil?

Share this post


Link to post
Share on other sites

uhhhh i cant show you examples unless i rewrite my script.... but yeah what ill do is explain it... i would like the EXE to read a specific line in its autoit compilled scipt(of course i know it getts formated)... and then do the EXE from that line down the rest of the script... it sounds like GOTO is what i need... why is it evil?

compiled .EXE from .AU3

this line should be include 'some_items at specified area' => call "specified_area"

.

.

.

func specified_are()

$whatDoYouWant = you want to this area?

endFunc

.

.

.

You got the specified area!

Share this post


Link to post
Share on other sites

ill have to try that later

Share this post


Link to post
Share on other sites

You can do what as known as pseudo code. Simply put, you list the logical steps your code is to take. Remember, computers only do what you tell them to do, so look at this example of you going to the store to buy milk to figure out how your code's logic will run:

1. Leave your house

2. Open car door

3. Get into car

4. Start car

5. Drive to store

6. Park car in parking lot

7. get out of car

8. Walk into store

9. Pick up milk

10. Pay for milk.

Lay out your example like that example, and we will see what we can do to help.

Share this post


Link to post
Share on other sites

uhhhh i cant show you examples unless i rewrite my script....

I know what you want, but there are different ways to accomplish it. I'm sure that others can walk you thru using UDFs.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

1. Leave your house

2. Open car door

3. Get into car

4. Start car

5. Drive to store

6. Park car in parking lot

7. get out of car

8. Walk into store

9. Pick up milk

10. Pay for milk.

11. Exit store

11. See that car has been stolen :Goto step 7a and lock car.

:-)


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

wow random..... anyway i guess i dont NEED to use this event im asking for... if i just rearrange my script alittle... bTW WHY is goto evil again? thats all i hear about it

Share this post


Link to post
Share on other sites

Goto is useless. Real programmers can use functions, control statements, sentinel values, and loops to do a better job.

Share this post


Link to post
Share on other sites

wow random..... anyway i guess i dont NEED to use this event im asking for... if i just rearrange my script alittle... bTW WHY is goto evil again? thats all i hear about it

It defeats the purpose of structured programming. It is very difficult to follow code when you have labels and gotos all over the place. Generally, "break" and "continue" are also a bad practice to use for the same reason.

label1:
         int x = 0;
         goto label2;
 label2:
         x++;
         if (x < 100) goto label2;
         goto label3;
 label3:
         printf("We're done!");
         exit();

compared to

int x = 0;
 while (x < 100) x++;
 printf("We're done!");

Take youre pick. :mellow:

Share this post


Link to post
Share on other sites

lol i guess your right but again.... i dont really need to use it anymore i have a new problem that i have posted in the general help forum :\ ill eventually learn this stuff

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