Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Import HTML table data into Foxpro table
Message
From
09/10/2006 11:20:35
 
 
To
09/10/2006 10:30:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01160464
Message ID:
01160565
Views:
8
Cetin,
Function HTMLTabletoCursor( toTable )
  Local ix,jx,lcTemp, lnHandle
  lcTemp = Forcepath('nsehtm.tmp',Sys(2023))
  lnHandle = Fcreate(m.lcTemp)
  For ix=0 To toTable.Rows.Length-1
    For jx = 0 To toTable.Rows[m.ix].Cells.Length-1
      Fwrite(m.lnHandle,toTable.Rows[m.ix].cells[m.jx].innerText)
     If ( m.jx != toTable.Rows[m.ix].Cells.Length-1)
        Fwrite(m.lnHandle, ',')
      Endif
    Endfor
    Fwrite(m.lnHandle, Chr(13)+Chr(10))
  Endfor
  Fclose(m.lnHandle)
  Create Cursor myData (f1 c(100),f2 c(100),f3 c(100),f4 c(100))
  Append From ( m.lcTemp ) Type Delimited
  Erase ( m.lcTemp )
  Browse
why go via tmp file here ? Appending from an array filled in the loops should shorten the code of the function by half
and the data doesn't seem to be anywhere near the max array element count for vfp6. What am I missing ?

curious

thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform