Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recommendations on how to parse log file?
Message
From
20/02/2008 12:53:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01294309
Message ID:
01294345
Views:
20
>>>So, is this making any sort of sense to people? If so, what would you do
>>>about it? If not, you have my sympathy, as it doesn't make a lot of sense
>>>to me, either. :-)
>>
>>Maybe MS HFlexGrid control will work for you?
>
>Hmm. That's an interesting thought, but there doesn't seem to be any way to build one on the fly: I'd have to have the shaped data already created, right?
>
>I wonder if I should be generating HTML here, instead of trying to display it as indented text. That could give me all the navigation I want, and allow me to collapse sections, instead of breaking a section across two "statements"...
>
>Now this has definite possibilities. *wanders off to ponder over lunch*

Shaping the data is fairly easy with ADO MSDataShape provider:) Here is a sample using a fabricated shaping (harder than doing with existing table data shaping IMHO). ie:
Local rs As adodb.recordset
Local cn As adodb.Connection

TEXT TO m.strShape TEXTMERGE PRETEXT 8
shape append
  new adChar(10) as Region,
  new adInteger as RegionID,
  ((shape append
  new adChar(20) as Series,
  new adInteger as RegionID )
  as ls relate regionID to RegionID)
ENDTEXT

#include adoconstants.h
cn = Createobject("adodb.connection")
rs = Createobject("adodb.recordset")
cn.ConnectionString = "Provider=MsDataShape;Data Provider=NONE"
cn.Open()
rs.Open(m.strShape,cn,adOpenStatic,adLockOptimistic)

For regions=1 To 3
    rs.AddNew
    rs.Fields("region").Value = "Region"+PADL(m.regions,2)
    rs.Fields("regionID").Value = m.regions
    For lseries = 1 To 5
        rs2 = rs.Fields("ls").Value
        rs2.AddNew
        rs2.Fields("Series").Value = "R"+PADL(m.regions,2)+":Line series"+PADL(m.lseries,2)
    Endfor
Endfor

ShowMe(rs)

Function ShowMe(toRecordSet)
Public oForm
oForm = Createobject('myForm', toRecordSet)
oForm.Show
Endfunc

Define Class myform As Form
    Height = 450
    Width = 750
    Name = "Form1"

    Add Object hflex As OleControl With ;
        Top = 10, Left = 10, Height = 430, Width = 730, Name = "Hflex", ;
        OleClass = 'MSHierarchicalFlexGridLib.MSHFlexGrid'

    Procedure Init
    Lparameters toRecordSet
    With This.hflex
        .Datasource = toRecordSet
        .AllowUserResizing = 3
        .Cols(0) = 2
        .Cols(1) = 1
        .ColWidth(0,0) = 16*15
        .ColWidth(0,1) = 100*15

       	.Col = 2
       	.ColSel = 2
        FOR ix = .FixedRows TO .Rows-1
        	.Row = m.ix
        	.RowSel = m.ix
        	DO case
        	CASE ix%5=0
        	lnColor = RGB(255,255,0)
        	CASE ix%4=0
        	lnColor = RGB(0,255,255)
        	CASE ix%3=0
        	lnColor = RGB(192,192,0)
        	CASE ix%2=0
        	lnColor = RGB(0,192,192)
        	OTHERWISE
        	lnColor = RGB(192,192,192)
        	ENDCASE
        	.CellBackColor = m.lnColor
        ENDFOR  
    Endwith
    Endproc
Enddefine
However as you thought, using an XML and webbrowser control might provide a neater view.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform