table col's

Discussion in 'Questions (Windows Mobile)' started by dennishea, May 23, 2008.

  1. dennishea

    dennishea Active Member Licensed User

    Hi All.

    When I start my prg I define my table col headers and widths. When I start saving data to the table and then make the table visiable to review the data everything is as I set it. When I exit prg I save table to csv file. Now when I start prg and load csv file the col headers are fine but the col widths are not what I programmed. They are to wide. When I load a csv file am I suppose to reformat the table?

    edit:

    sorry discovered table1.colwidth = :sign0161: :signOops:
     
    Last edited: May 23, 2008
  2. willisgt

    willisgt Active Member Licensed User

    If I correctly understand the behavior of tables: whenever you load a csv file into a table, the table contents (rows, columns) get wiped out and replaced by the contents of the file. Column widths will be reset back to the default value.

    The solution would be to create a subroutine to handle the column widths. You can then call then routine at startup, and each time you load the file.


    Gary
     
  3. dennishea

    dennishea Active Member Licensed User

    Thanks for the information willisgt. You are talking about using colwidth to reset the col width. Something like this.
     
  4. klaus

    klaus Expert Licensed User

    In my programs I save the column widths in a setup file with last values used, because the user can change the width. When he starts the program, the setup file is read and the column widths put in variables, so he will find the last values he set. After each load of a csv file you run Reset_ColWidth routine where you put the variables instead of the numeric values.

    Best regards
     
  5. willisgt

    willisgt Active Member Licensed User

    Aha! Never thought of that... cool solution!

    Gary

    :sign0188:
     
  6. dennishea

    dennishea Active Member Licensed User

    Hi klaus.

    Why would user want or need to adjust colwidth from the running prg. Up until now I never thought about that. Could you give a simple senario where this would apply. I admire and respect your programming skills so I know there is a reason. :sign0188:
     
  7. klaus

    klaus Expert Licensed User

    In the Expense tracker and Wine cellar manager programs the user can add new names with different lengths, depending on what the user wants to see or focus on, he can adjust the column width to his convenience. Of course if you have data with fixed length you won't need the adjustment.

    Best regards
     
  8. dennishea

    dennishea Active Member Licensed User

    Thank you klaus. Sometimes a need is hard to visualize without the need itself. Thank you again for taking the time. :)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice