Jump to content

Script doesn't work in XP but work ok in vista


Recommended Posts

#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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

First track down which function fails ? Is it the file reading ? And what is the @error value returned ?
Link to comment
Share on other sites

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 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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...