Erratic Internet load?

Just starting out? Need help? Post your questions and find answers here.
epog10
User
User
Posts: 90
Joined: Sat May 29, 2010 11:46 am
Location: UK

Erratic Internet load?

Post by epog10 »

I have problem that I do not understand although it is probably due to a compiler switch of some sort.

On a Win7 machine, the following code works well whether compiled as x64 or x32
On an WinXP machine the code does not work. Whether compiled as x32 on the Win7 machine or locally.
I am getting the "Failed to receive file" message.

Code: Select all

All variables have been globally declared 

Procedure FTSE100()                                                	;Get index value from Google Financial
  aNS = "https://uk.advfn.com/index/ftse100"
  aNS1 = "ErioMM.tmp"
  If ReceiveHTTPFile(aNS, aNS1)
    If ReadFile(#DATNUM, aNS1)          				;Test and read if okay
      aNS=""
      While Eof(#DATNUM) = 0 : aNS = aNS + ReadString(#DATNUM) : Wend	;Load lines
      CloseFile(#DATNUM)                                                ;Close the opened file
    Else
      MessageRequester("Information","ErioMM.tmp")
    EndIf
  Else
    Debug "Failed to receive file " + aNS
  EndIf
  X = FindString(aNS, "Piece3")                                          ;Find start of area of interest
  aNS = Mid(aNS, X, 300)                                                 ;Isolate area of interest
  aNS = ReplaceString(aNS , ",", "", 1)                                  ;Remove any comma separators
  aNS1 = Mid(aNS, 29, 8)                                                 ;Extract the change value
  F = ValF(aNS1)                                                         ;And set it as required in variable
  X = FindString(aNS, "Piece5")                                          ;Point to the FTSE100 value area
  aNS2 = Mid(aNS, X + 17, 10)                                            ;Extract the current value
  fUPFTSE = ValF(aNS2)                                                   ;Allocate it
  fSRTFTSE = fUPFTSE - F                                                 ;Work out the day start value
EndProcedure
The strange thing is that later in the program, I scrape some individual prices using the line:-
aNS = "http://uk.advfn.com/p.php?symbol=" + aEPIC + "&pid=mquote"

and this works well in both machines. To try it, replace aEPIC with say, VOD or RDSB or LLOY

Any comments appreciated.