+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Senior Member cowboybooter's Avatar
    Join Date
    Jul 2002
    Location
    London Suburbia,UK
    Posts
    531

    MS FlexGrid Problem

     
    I keep on getting stuck with this one problem,

    ( this is part of a 'test'scenario, hence the inflexibility)

    Create a 2 column flexigrid,
    Populate the grid from a txt file, so that col1 contains text, col2 contains numbers.

    txt file example
    "chair"
    4.50
    "table"
    5.50

    I kinda get it to work, then code some more, ( dragdrop stuff etc)and it stops.


    Any suggestions ?

  2. #2
    Not Really a Member
    Join Date
    Oct 2001
    Posts
    27,856
    have you tried running it line by line to see where it 'stops' ?

    You can put a breakpoint at some point where you know it still works, and then run line by line from that point with F8...
    Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.

  3. #3
    Senior Member cowboybooter's Avatar
    Join Date
    Jul 2002
    Location
    London Suburbia,UK
    Posts
    531
    yes, tried debug routines vass, in fact the prog does not 'stop' per say, just refuses to populate both columns, only fills col1.
    if I run the populate only sub, it works.

    If I post the code, would that help ?


    CBB

  4. #4
    Senior Member cowboybooter's Avatar
    Join Date
    Jul 2002
    Location
    London Suburbia,UK
    Posts
    531
    code section,

    Do Until EOF(fnum) 'Loop until end of file
    Line Input #fnum, FileData
    Line Input #fnum, FileData1
    grdParts.Row = intcount
    grdParts.Col = 0
    grdParts.Text = FileData 'Get part No
    grdParts.Row = intcount
    grdParts.Col = 1
    grdParts.Text = FileData1 'Get Description
    intcount = intcount + 1
    Loop

    Close #fnum 'Close file

    grdParts.Rows = intcount - 1

    Does it help ?


    CBB

  5. #5
    Not Really a Member
    Join Date
    Oct 2001
    Posts
    27,856
    well for one .. thats going to be a bit confusing to follow if you ever get more than one column.

    the other.. I'm not really familiar with flexgrid I've only used janus grid. Are you sure the column index starts at 0 and not 1?

    Personally I'd suggest organizing the text file a little better such as

    column1data1,column2data1
    column1data2,column2data2
    column1data3,column2data3
    column1data4,column2data4
    column1data5,column2data5
    column1data6,column2data6
    column1data7,column2data7

    and then read in teh string and place the information into an array with the Split function
    arrayname = split(inputstring, ",")
    Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.

  6. #6
    Senior Member cowboybooter's Avatar
    Join Date
    Jul 2002
    Location
    London Suburbia,UK
    Posts
    531
    Vass,

    That sounds kewl, but,

    the text file will be provided by the tester, and will be in the format described,

    As far as I am aware, the column index starts at 0.

    I am loth to post the whole shebang in here, because as it is part of a test, your coding the whole thing for me will not teach me how,


    I have spent MANY a sleepless night on this one, lol.

    Sometimes, I feel incredibly stupid, other times inspiration fires me.

    VB.Net next..................


    OMG NOooooo

    CBB
    Last edited by cowboybooter; September 3rd, 2002 at 07:23 PM.

  7. #7
    Not Really a Member
    Join Date
    Oct 2001
    Posts
    27,856
    YGPM CBB
    Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Recommended Sites: ResellerRatings Store Reviews