Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Puzzling error
Message
De
15/04/2003 11:50:28
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Divers
Thread ID:
00777568
Message ID:
00777824
Vues:
17
Hi Sergey,
This is the code that busted.
I think this is all the pertinent code.
If you want I can show you everything.
I was wrong in my first message. The next line is 273 characters long.
Note this test.

I tried the example from mskb #Q305238
this does not crash when I execute it from the command window.
DIMENSION  laX(1)
laX(1) = SPACE( 273 )
FOR EACH lcX IN laX
  ? lcX
NEXT
I'm guessing that it has to do with the the fact that I'm
using _webview.vcx. That the error is in there somewhere.
************************************************************
DEFINE Class Click4Hits as _webform of _webview.vcx
  proc init()
    this._ioWeb = thisform.oleWebBrowser
  endproc

  proc _mLoop()
    LOCAL lcURL, loDoc, loFrame, lc, lcURL_Line
    LOCAL ln, lnTop
    lnTop = 1000000
    do while .t.
      loDoc = THIS._ioWeb.DOCUMENT
      FOR ln = 1 TO lnTop
        IF VARTYPE(loDoc)<>'X'
          EXIT
        ENDIF
      ENDFOR
      IF VARTYPE(loDoc)='X'
        THISFORM._mSet_Status('Could Not create Document')
        EXIT
      ENDIF
      loFrame = loDoc.Frames(THIS._inFrame)     &&THIS._inFrame = 0
      FOR ln = 1 TO lnTop
        IF VARTYPE(loFrame)<>'X'
          EXIT
        ENDIF
      ENDFOR
      IF VARTYPE(loFrame)='X'
        THISFORM._mSet_Status('Could Not create Frame')
        EXIT
      ENDIF
      = ALINES( THIS._iaLines, loFrame.documentElement.outerHTML )
      THIS._mSet_Search_String()
      ..... never gets this far
    ENDDO
    ..... more code
  endproc

  proc _mSet_Search_String()
    ***** code this part in sub-classes
  endproc
ENDDEFINE
*************************************************************
DEFINE class ClickSilo as Click4Hits
  proc _mSet_Search_String()
    ***** alen(THIS._iaLines)=35 at this point
    *****    and the FOR EACH loop crashes trying to access THIS._iaLines(35)
    *****    the if <some string> $ lc never evaluated true
    FOR EACH lc IN THIS._iaLines
      if <some string> $ lc
        ... other code
        exit
      endif
    ENDFOR         && error stops on "ENDFOR"
  endproc
ENDDEFINE

when it crashed lc was '<TR>' 

if this helps
the next element in THIS._iaLines is:
(I put in chr(13) to keep your screen narrow)

<TD vAlign=top align=right width=468><A 
href="http://www.freenetleads.com/free/990430hun/index.shtml" target=_blank><IMG 
src="http://www.clicksilo.com/images/members/free-leads-banner-orbl.gif" 
border=1></A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></HTML>


FWIW I tried FOR EACH ... NEXT and it still crashed trying to read the last element that was 273 characters long
>Hi Bill,
>
>It suppouse to be fixed in VFP7. See FIX: FOR...EACH Fails When Character Array Element Contains More Than 255 Characters mskb #Q305238. Can you post HTML that causes this problem, if it's not to big?
>
Bill Morris
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform