Sign in to follow this  
Followers 0
LukeJrs

finding a array value

11 posts in this topic

Thanks you again, I need some more help

CODE
#include <IE.au3>

#include <String.au3>

#include <array.au3>

; $avCodes contains the strings you want to search for

; NOTE: last two values in the array are in the html code.

;Dim $avCodes[6] = ["68819", "73501", "73417", "72146", "68994", "48526"]

; Create an invisible browser

$soIE1 = _IECreate("http://www.freewebs.com/lukejrs/testvar.html", 0, 0, 1)

$sText1 = _IEDocReadHTML($soIE1) ;READ FROM HTML CODE ON WEBSITE

$avFeature = _StringBetween($sText1, 'teleFeature.code = "', '";') ; FEATURE

For $i = 0 To UBound($avFeature) - 1

$Input = $avFeature[$i]

Switch $Input

Case 68819, 73501, 73417

;.... some unique calculation charging 30% extra.....

MsgBox(0, "account is over by: ", $Input & " and will be charged 30% fee")

Case 72146

;.... some unique calculation charging 15% extra.....

MsgBox(0, "account is over by: ", $Input & " and will be charged 15% fee")

Case 68994, 48526

;.... some unique calculation charging 65% extra.....

MsgBox(0, "account is over by: ", $Input & " and will be charged 65% fee")

EndSwitch

Next

It found the charging 65%. Is't very helpful it cleaned the scripst lot cleaner but still not able to do what I'm trying to achive. Like if take your time and view source of the site it appear there is 21 array of value contain in stringbetween so basicly the For $i = 0 To UBound($avFeature) - 1 wil search if value match 68994 which located on the site and the value is on $avFeature[14] as a array which what i'm trying to do is not load array 1 by 1. Is't possible can be all array loaded at once then compare the value to check which one match case? because to get 68994 will have to go next like 14 time to match my value and the reason i'm trying to do that because at the end result if array didnt find anything at end search resut of trying to locate any of value in stringbetween and there wasn't any found then excute a chuck of command because if i put it as

CODE
#include <IE.au3>

#include <String.au3>

#include <array.au3>

; $avCodes contains the strings you want to search for

; NOTE: last two values in the array are in the html code.

;Dim $avCodes[6] = ["68819", "73501", "73417", "72146", "68994", "48526"]

; Create an invisible browser

$soIE1 = _IECreate("http://www.freewebs.com/lukejrs/testvar.html", 0, 1, 1)

$sText1 = _IEDocReadHTML($soIE1) ;READ FROM HTML CODE ON WEBSITE

$avFeature = _StringBetween($sText1, 'teleFeature.code = "', '";') ; FEATURE

For $i = 0 To UBound($avFeature) - 1

$Input = $avFeature[$i]

Switch $Input

Case 68819, 73501, 73417

;.... some unique calculation charging 30% extra.....

MsgBox(0, "account is over by: ", $Input & " and will be charged 30% fee")

Case 72146

;.... some unique calculation charging 15% extra.....

MsgBox(0, "account is over by: ", $Input & " and will be charged 15% fee")

Case 68994, 48526

;.... some unique calculation charging 65% extra.....

MsgBox(0, "account is over by: ", $Input & " and will be charged 65% fee")

Case Else

MsgBox(0, "dude ", "damn didnt find anything")

EndSwitch

Next

as you notice will keep poping msg saying damn couldnt find it everytime it go array by array can this be executed when it's done searching array if wasn't found then execute msg box?

Share this post


Link to post
Share on other sites



Thanks you again, I need some more help

... code ...

It found the charging 65%. Is't very helpful it cleaned the scripst lot cleaner but still not able to do what I'm trying to achive. Like if take your time and view source of the site it appear there is 21 array of value contain in stringbetween so basicly the For $i = 0 To UBound($avFeature) - 1 wil search if value match 68994 which located on the site and the value is on $avFeature[14] as a array which what i'm trying to do is not load array 1 by 1. Is't possible can be all array loaded at once then compare the value to check which one match case? because to get 68994 will have to go next like 14 time to match my value and the reason i'm trying to do that because at the end result if array didnt find anything at end search resut of trying to locate any of value in stringbetween and there wasn't any found then excute a chuck of command because if i put it as

@LukeJrs - new question new post, but same script. To answer your specific question "finding an array value" the command to use is _ArraySearch() since searching is the same thing as looking for or finding something, right? That's why I gave you the code I did since your initial code's logic wasn't working. On your other topic titled "stopping a loop", I told you the code I gave you was a modification of the help file's example. Look at what I gave you and compare it to the following code. You'll see they look very very similar. :)

#Include<Array.au3>
Dim $Array[6]
$Array[0] = "String0|SubString0"
$Array[1] = "String1|SubString1"
$Array[2] = "String2|SubString2"
$Array[3] = "String3|SubString3"
$Array[4] = "String4|SubString4"
$Array[5] = "String5|SubString5"

$Input = InputBox("ArraySearch Demo", "String To Find?")
If @error Then Exit

$Pos = _ArraySearch ($Array, $Input, 0, 0, 0, True)
Select
    Case $Pos = -1
        MsgBox(0, "Not Found", '"' & $Input & '" was not found in the array.')
    Case Else
        MsgBox(0, "Found", '"' & $Input & '" was found in the array at pos ' & $Pos & ".")
EndSelect

as you notice will keep poping msg saying damn couldnt find it everytime it go array by array can this be executed when it's done searching array if wasn't found then execute msg box?

I put those message boxes in the code so you could follow along and better understand what was going on. My guess is no one has responded to this topic since you have the answers to your questions but don't know they are there despite my attempts to help you understand. Do this, go back to your other post where I gave you the working code and look at the updated code I've given you. Then compare the different version and see how its changed. Good luck and I hope this makes sense for you.

Share this post


Link to post
Share on other sites

I tried and tried can't get it to work. can i have it to read a value if match the value then do this if value not found else do that because with arraysearch it get the pos of it but you must imput what to search for and if you search for this and not in webpage then error and script crash because

CODE
>"D:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\Documents and Settings\Administrator\Desktop\demo.au3"

D:\Documents and Settings\Administrator\Desktop\demo.au3 (17) : ==> Array variable subscript badly formatted.:

Switch $avFeature[$Pos]

Switch $avFeature[^ ERROR

>Exit code: 1 Time: 1.111

This what i been working so far

CODE

#include <IE.au3>

#include <String.au3>

#include <array.au3>

; $avCodes contains the strings you want to search for

; NOTE: last two values in the array are in the html code.

;Dim $avCodes[6] = ["68819", "73501", "73417", "72146", "68994", "48526"]

; Create an invisible browser

$soIE1 = _IECreate("http://www.freewebs.com/lukejrs/testvar.html", 0, 1, 1)

$sText1 = _IEDocReadHTML($soIE1) ;READ FROM HTML CODE ON WEBSITE

$avFeature = _StringBetween($sText1, 'teleFeature.code = "', '";') ; FEATURE

$Input = "68994" ;let say i wanted to put 689954 to search for now if value not found booom crash

$Pos = _ArraySearch ($avFeature, $Input)

Switch $avFeature[$Pos]

Case 68819, 73501, 73417

;.... some unique calculation charging 30% extra.....

MsgBox(0, "account is over by: ", $Input & " and will be charged 30% fee")

Case 72146

;.... some unique calculation charging 15% extra.....

MsgBox(0, "account is over by: ", $Input & " and will be charged 15% fee")

Case 68994, 48526

;.... some unique calculation charging 65% extra.....

MsgBox(0, "account is over by: ", $Input & " and will be charged 65% fee")

Case Else

MsgBox(0, "account is over by: ", $Input & " FREE FOOD")

EndSwitch

I dont want it to crash

Share this post


Link to post
Share on other sites

The only explanation is that you're wrong using _StringBetween and the string you're looking for it is not delimited by teleFeature.code = " and ";

the string should look like:

teleFeature.code = "68994";

To show you that your script is working in its actual form, I've built a string according to your pattern and ran the script - it worked

here it is:

#include <IE.au3>
#include <String.au3>
#include <array.au3>
; $avCodes contains the strings you want to search for
; NOTE: last two values in the array are in the html code.
;Dim $avCodes[6] = ["68819", "73501", "73417", "72146", "68994", "48526"]

; Create an invisible browser
;$soIE1 = _IECreate("http://www.freewebs.com/lukejrs/testvar.html", 0, 1, 1)
;$sText1 = _IEDocReadHTML($soIE1) ;READ FROM HTML CODE ON WEBSITE

$sText1 = "teleFeature.code = ""68819""; teleFeature.code = ""68994"";teleFeature.code = ""72146"";teleFeature.code = ""48526"";"
$avFeature = _StringBetween($sText1, 'teleFeature.code = "', '";') ; FEATURE



$Input = "68994" ;let say i wanted to put 689954 to search for now if value not found booom crash
$Pos = _ArraySearch ($avFeature, $Input)
Switch $avFeature[$Pos]
Case 68819, 73501, 73417
;.... some unique calculation charging 30% extra.....
MsgBox(0, "account is over by: ", $Input & " and will be charged 30% fee")
Case 72146
;.... some unique calculation charging 15% extra.....
MsgBox(0, "account is over by: ", $Input & " and will be charged 15% fee")
Case 68994, 48526
;.... some unique calculation charging 65% extra.....
MsgBox(0, "account is over by: ", $Input & " and will be charged 65% fee")
Case Else
MsgBox(0, "account is over by: ", $Input & " FREE FOOD")
EndSwitch

if you're not convinced that your script works - post a small part of the HTML source code here. You only need to "tune" the string delimiters in _StringBetween


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

This the actual html, I can find the code if i put it on $input to search for the array that contain that value to locate pos work good but what i'm trying to say let say the value on $input was more like $Input = "689954" and couldn't find it on array then crash the script can i make it not crash?

CODE

<html>

<head>

<script Language="Javascript">

function setFeatures() {

var teleFeature;

var i = teleClientMgr.data.featureList.length;

teleFeature = new TeleFeature();

teleFeature.code = "48526";

teleFeature.desc = "check1";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "48553";

teleFeature.desc = "check2";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "53217";

teleFeature.desc = "check3";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "66332";

teleFeature.desc = "check4";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "68365";

teleFeature.desc = "check5";

teleFeature.price = "0.99";

teleFeature = new TeleFeature();

teleFeature.code = "68505";

teleFeature.desc = "check6";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "68869";

teleFeature.desc = "check7";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "68870";

teleFeature.desc = "check8";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "68871";

teleFeature.desc = "check9";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "68872";

teleFeature.desc = "check10";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "68873";

teleFeature.desc = "check11";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "68874";

teleFeature.desc = "check12";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "68876";

teleFeature.desc = "check13";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "68877";

teleFeature.desc = "check14";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "68994";

teleFeature.desc = "check15";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "72313";

teleFeature.desc = "check16";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "72709";

teleFeature.desc = "check17";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "73502";

teleFeature.desc = "check18";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "73503";

teleFeature.desc = "check19";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "73517";

teleFeature.desc = "check20";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "73548";

teleFeature.desc = "check21";

teleFeature.price = "0.00";

teleFeature = new TeleFeature();

teleFeature.code = "73549";

teleFeature.desc = "check22";

teleFeature.price = "0.00";

</Script>

</head>

</html>

Guys I appreciate your time. This sound very confusing but the thing is I work in a phone service, We look account by number then try find their feature in their account to determine how much they been using or if they went over their limit.

Each Feature have their own ID number like 68994 ect each has their own meaning in our system what i'm trying to achive is when page is loaded and if page contain anywhere in html this value 68994 or any value that I want to find.

Example If html code contain teleFeature.code = "68994"; then execute this command else if value not found and teleFeature.code = "73501"; is found execute other command else if any of those not found do this command. any idea?

Edited by LukeJrs

Share this post


Link to post
Share on other sites

Changed some of the code and added a new variable $match - It can't crash now (the error were generated by _ArraySearch so I've replaced that part).

#include <IE.au3>
#include <String.au3>
#include <array.au3>
Dim $match = 0
; $avCodes contains the strings you want to search for
; NOTE: last two values in the array are in the html code.
;Dim $avCodes[6] = ["68819", "73501", "73417", "72146", "68994", "48526"]

; Create an invisible browser
;$soIE1 = _IECreate("http://www.freewebs.com/lukejrs/testvar.html", 0, 1, 1)
;$sText1 = _IEDocReadHTML($soIE1) ;READ FROM HTML CODE ON WEBSITE
$sText1 = "teleFeature.code = ""68819""; teleFeature.code = ""68994"";teleFeature.code = ""72146"";teleFeature.code = ""48526"";"
$avFeature = _StringBetween($sText1, 'teleFeature.code = "', '";') ; FEATURE


$Input = "68819" ;let say i wanted to put 689954 to search for now if value not found booom crash

For $i = 0 to UBound($avFeature)-1
    If StringInStr($avFeature[$i], $Input) Then
        $match = 1
        Switch $avFeature[$i]
            Case 68819, 73501, 73417
            ;.... some unique calculation charging 30% extra.....
            MsgBox(0, "account is over by: ", $Input & " and will be charged 30% fee")
            Case 72146
            ;.... some unique calculation charging 15% extra.....
            MsgBox(0, "account is over by: ", $Input & " and will be charged 15% fee")
            Case 68994, 48526
            ;.... some unique calculation charging 65% extra.....
            MsgBox(0, "account is over by: ", $Input & " and will be charged 65% fee")
        EndSwitch
    EndIf
Next
If $match = 0 Then
    MsgBox(0, "account is over by: ", $Input & " FREE FOOD")
EndIf

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

I tried and tried can't get it to work. .....

@LukeJrs - I've read through some of the other topics you've asked for help and many people have offered help. One common thing that keeps coming up is the code doesn't work for you. For example when you asked about _StringBetween back in July you said this to Xenobiologist (Mega).

Appreciate your time the value didn't return right :\ I notice I was using vista & IE7 lol i tried xp work good thanks :) Cheer to all.

Now I could be wrong, but I wouldn't think au3 code written on XP would present this many problems on Vista & IE7. Then again it could be a Microsoft problem not au3.

Looking at the code you have posted that you say doesn't work and goes "booom crash", please understand to say the code doesn't work implys what I gave you broken code. I believe its your modifications to working code that returns you here asking for more help. May I suggest that you make copies before you modify that way you can refer to the working code to see what you changed to break it. Then if you don't understand why your modification doesn't work, post the the section of code before and after so we can help you.

For example in your broken modified code you don't understand the console output telling you what is causing the crash.

Console Output:

>"D:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\Documents and Settings\Administrator\Desktop\demo.au3"

D:\Documents and Settings\Administrator\Desktop\demo.au3 (17) : ==> Array variable subscript badly formatted.:

Switch $avFeature[$Pos]

Switch $avFeature[^ ERROR

>Exit code: 1 Time: 1.111

...........................................................

Your PERFECTLY FINE Code:

#include <IE.au3>
#include <String.au3>
#include <array.au3>
; $avCodes contains the strings you want to search for
; NOTE: last two values in the array are in the html code.
;Dim $avCodes[6] = ["68819", "73501", "73417", "72146", "68994", "48526"]

; Create an invisible browser
$soIE1 = _IECreate("http://www.freewebs.com/lukejrs/testvar.html", 0, 1, 1)
$sText1 = _IEDocReadHTML($soIE1) ;READ FROM HTML CODE ON WEBSITE
$avFeature = _StringBetween($sText1, 'teleFeature.code = "', '";') ; FEATURE

$Input = "68994" ;let say i wanted to put 689954 to search for now if value not found booom crash
$Pos = _ArraySearch ($avFeature, $Input)
Switch $avFeature[$Pos]
Case 68819, 73501, 73417
;.... some unique calculation charging 30% extra.....
MsgBox(0, "account is over by: ", $Input & " and will be charged 30% fee")
Case 72146
;.... some unique calculation charging 15% extra.....
MsgBox(0, "account is over by: ", $Input & " and will be charged 15% fee")
Case 68994, 48526
;.... some unique calculation charging 65% extra.....
MsgBox(0, "account is over by: ", $Input & " and will be charged 65% fee")
Case Else
MsgBox(0, "account is over by: ", $Input & " FREE FOOD")
EndSwitchoÝ÷ ÚæØ¢êÅ,³ /Ûþç(è]4ÓK)j{-ÊW

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

That what exactly i was looking for, damn that method i never thou would be possible work perfect i have learn so much :) thanks Just curious if i wanted make it search for stringbetween on html and find all value and if any those value match to the case then execute command? Because input value only seem to work one value at time. there a 23 imput value i have each value i have different command to execute. thanks for ur help

CODE
#include <IE.au3>

#include <String.au3>

#include <array.au3>

Dim $match = 0

; $avCodes contains the strings you want to search for

; NOTE: last two values in the array are in the html code.

;Dim $avCodes[6] = ["68819", "73501", "73417", "72146", "68994", "48526"]

; Create an invisible browser

;$soIE1 = _IECreate("http://www.freewebs.com/lukejrs/testvar.html", 0, 1, 1)

;$sText1 = _IEDocReadHTML($soIE1) ;READ FROM HTML CODE ON WEBSITE

$sText1 = "teleFeature.code = ""68819""; teleFeature.code = ""68994"";teleFeature.code = ""72146"";teleFeature.code = ""48526"";"

$avFeature = _StringBetween($sText1, 'teleFeature.code = "', '";') ; FEATURE

$Input = "68819" ;let say i wanted to put 689954 to search for now if value not found booom crash

For $i = 0 to UBound($avFeature)-1

If StringInStr($avFeature[$i], $Input) Then

$match = 1

Switch $avFeature[$i]

Case 68819, 73501, 73417

;.... some unique calculation charging 30% extra.....

MsgBox(0, "account is over by: ", $Input & " and will be charged 30% fee")

Case 72146

;.... some unique calculation charging 15% extra.....

MsgBox(0, "account is over by: ", $Input & " and will be charged 15% fee")

Case 68994, 48526

;.... some unique calculation charging 65% extra.....

MsgBox(0, "account is over by: ", $Input & " and will be charged 65% fee")

EndSwitch

EndIf

Next

If $match = 0 Then

MsgBox(0, "account is over by: ", $Input & " FREE FOOD")

EndIf

Edited by LukeJrs

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

All your script work the modification cause it to crash or even making my own and reading it and writing it some work some doesnt cause i'm still learning so my programming is limited at this moment.

@LukeJrs - I've read through some of the other topics you've asked for help and many people have offered help. One common thing that keeps coming up is the code doesn't work for you. For example when you asked about _StringBetween back in July you said this to Xenobiologist (Mega).

Now I could be wrong, but I wouldn't think au3 code written on XP would present this many problems on Vista & IE7. Then again it could be a Microsoft problem not au3.

Looking at the code you have posted that you say doesn't work and goes "booom crash", please understand to say the code doesn't work implys what I gave you broken code. I believe its your modifications to working code that returns you here asking for more help. May I suggest that you make copies before you modify that way you can refer to the working code to see what you changed to break it. Then if you don't understand why your modification doesn't work, post the the section of code before and after so we can help you.

For example in your broken modified code you don't understand the console output telling you what is causing the crash.

Console Output:

>"D:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\Documents and Settings\Administrator\Desktop\demo.au3"

D:\Documents and Settings\Administrator\Desktop\demo.au3 (17) : ==> Array variable subscript badly formatted.:

Switch $avFeature[$Pos]

Switch $avFeature[^ ERROR

>Exit code: 1 Time: 1.111

...........................................................

Your PERFECTLY FINE Code:

#include <IE.au3>
#include <String.au3>
#include <array.au3>
; $avCodes contains the strings you want to search for
; NOTE: last two values in the array are in the html code.
;Dim $avCodes[6] = ["68819", "73501", "73417", "72146", "68994", "48526"]

; Create an invisible browser
$soIE1 = _IECreate("http://www.freewebs.com/lukejrs/testvar.html", 0, 1, 1)
$sText1 = _IEDocReadHTML($soIE1) ;READ FROM HTML CODE ON WEBSITE
$avFeature = _StringBetween($sText1, 'teleFeature.code = "', '";') ; FEATURE

$Input = "68994" ;let say i wanted to put 689954 to search for now if value not found booom crash
$Pos = _ArraySearch ($avFeature, $Input)
Switch $avFeature[$Pos]
Case 68819, 73501, 73417
;.... some unique calculation charging 30% extra.....
MsgBox(0, "account is over by: ", $Input & " and will be charged 30% fee")
Case 72146
;.... some unique calculation charging 15% extra.....
MsgBox(0, "account is over by: ", $Input & " and will be charged 15% fee")
Case 68994, 48526
;.... some unique calculation charging 65% extra.....
MsgBox(0, "account is over by: ", $Input & " and will be charged 65% fee")
Case Else
MsgBox(0, "account is over by: ", $Input & " FREE FOOD")
EndSwitchoÝ÷ ÚæØ¢êÅ,³ /Ûþç(è]4ÓK)j{-ÊW
You are quite amazing programmer i'm still learning I read the help files but such limited example I quiet get lost on the programing also about @ERROR if report as error i never understood how it work. Edited by LukeJrs

Share this post


Link to post
Share on other sites

@eniaman - were you saying that LukeJrs was wrong. Or were you saying LukeJrs was wrong using _StringBetween? Amazing how punctuation makes a world of difference, then again programmers know this better than anyone - lol. I'm going to guess you were saying he was wrong.

lol - this is happening when someone is NOT an native English speaker (like myself)

I can see now how confusing that can be :)

The meaning is: he used in a wrong way the _StringBetween ... but finally the error was in not considering the case when the string was not found. ... so I've been wrong assuming that :P

I didn't analize the _ArraySearch function to find that error - why? Because I prefer to avoid including UDF's in my script when I need only a small part of them - _FileCreate and _ArraySearch are 2 good examples of simple functions which doesn't justify the inclusion of hundred lines UDF.

It is good having so many UDF's around but on the other hand by using them anytime we start to forget how to do simple things; this is the happy case when we FORGET something - the worst is when learning AutoIt and using those UDF everytime ... anyway - a big thanks to all UDF creators :)

Cheers


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

That what exactly i was looking for, damn that method i never thou would be possible work perfect i have learn so much :) thanks Just curious if i wanted make it search for stringbetween on html and find all value and if any those value match to the case then execute command? Because input value only seem to work one value at time. there a 23 imput value i have each value i have different command to execute. thanks for ur help

Easy way is to make 24 Case conditions so that the action for each can be taken when that Case is true. Study the code examples you already have, the answers are right there for you - I promise! A harder, cleaner, and cooler way is to put code and action into a 2 dimensional array. Crawl before you walk and walk before you run, else you'll hurt yourself.

You are quite amazing programmer i'm still learning I read the help files but such limited example I quiet get lost on the programing also about @ERROR if report as error i never understood how it work.

If what you say is true about having learned so much, then put some of your new understanding to work. Its only through trial and error and reading and rereading and more reading that I've gotten where I am. And I'm by no means as good as you think I am! Thank you for the complement. Good are folks like PsaltyDS, SmOke_N, big_daddy, you know the people with Moderator or MVP under their names. In reality the stuff you and I struggle with is nothing for those guys, a walk in the park.

Another suggestion, work on your script in sections. Meaning get a small 5 - 10 line script to do the action you want one of your codes to do. If one code has 10 unique actions then make 10 smaller scripts so you know each action is coded correctly. Then put 2 of the 10 scripts together and make them work. Keep building until you have one script that does the 10 unique actions for that one code. Then you'll have your template for the other 22 codes. And finally you'll be ready to insert your code into what we've given you and your script will be done!

If you can't do this then go to the HELP FILE and open the code examples and run them to see how they works. Run and study the tutorials, modify the tutorials so they do what you want with MSPaint instead of Notepad or Calc. Or get that one au3 script that has several examples, sorry don't know the name of it. It didn't work for me probably because I didn't have the latest beta so I didn't bother. Sure this sounds boring and its not what YOU want to work on right now, but until you know how to do the basics you're not ever going to be able to do what you want. Unless of course you just keep asking others to do it for you like you've been doing up to now. Until you demonstrate that you're really trying the people that can really help you won't waste their time.

..... I prefer to avoid including UDF's in my script when I need only a small part of them - _FileCreate and _ArraySearch are 2 good examples of simple functions which doesn't justify the inclusion of hundred lines UDF.

...... UDF's ..... by using them ..... we start to forget how to do simple things ....

@eniaman - Yes if you don't use it you'll lose it. The good thing about the UDF's is that if you forget you can open them up and remember how to do something you may have forgotten. Not to mention there's some excellent code examples on how to do the impossible; what an educational tool they are! Take for instance when I needed to copy an 2d array to the clipboard I learned that _ArrayToClip (any many if not all _Array command except _ArrayDisplay) only works on 1d arrays. How obsurd when the HELP FILE says au3 can handle 64d arrays! Anyways, thanks to randallc (author of _ArrayDisplay) I learned that his _ArrayDisplay not only displays 1 & 2d arrays, but it also copys the arrays to the clipboard. So thanks to randallc and the his UDF I was able to "borrow" and modify his code to accomplish my goal. Its only through braving the ocean of information in the UDF's and this forum that the real understanding begins. Anyone can say the help file is limited or vague or useless... well it sure has a lot more information (in some cases) than reading a straight UDF.

Catch you guys later!!

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