beginner85 Posted October 28, 2009 Posted October 28, 2009 #include <IE.au3> #include <String.au3> #include <File.au3> #include <Array.au3> Global $Code $file = FileOpen("temp.db", 0) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf For $line = 300 To 320 If StringInStr(FileReadLine($file, $line), "IFRAME style='PADDING-TOP: 10px' height=650 src='") Then $code = _StringBetween(FileReadLine($file, $line), "IFRAME style='PADDING-TOP: 10px' height=650 src='", "' frameBorder=0 width='100%' name=") $Online = $line EndIf Next FileClose($file) If IsArray($Code) then MsgBox(0, "Details", " On line " & $Online & " value = " & $code[0]) Else Msgbox(0,"Error", "Error: No String Found.") EndIf This script worked in vista but always show No String Found when work in XP. I don't know why, please help me. Another problem, in vista, i do not need to put " Global $Code ", but in XP, when i do not put it, it will show problem variable does not decleared.
Xenobiologist Posted October 28, 2009 Posted October 28, 2009 What error? Maybe it doesn't find the file in the script folder. Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
beginner85 Posted October 28, 2009 Author Posted October 28, 2009 Of course have the file temp.db in the same folder with script, but it show " No String Found " with Window XP. Maybe some security or anything ? I don't know. Plz help me
Inverted Posted October 28, 2009 Posted October 28, 2009 Of course have the file temp.db in the same folder with script, but it show " No String Found " with Window XP. Maybe some security or anything ? I don't know. Plz help meFirst track down which function fails ? Is it the file reading ? And what is the @error value returned ?
Xenobiologist Posted October 28, 2009 Posted October 28, 2009 (edited) You need to debug it step by step. Put a consoleWrite after the StringInStr to check whether the string has been found. Then maybe check whether StringBetween found something. If you do not get into the If condition $code will never be an array and then it will always show - no string found! Edited October 28, 2009 by Xenobiologist Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now