Frustrated with tables...

Frustrated with tables...

Post by anod » Wed, 07 Nov 2001 03:29:01



I'm a newbie to Palm OS development, and I cannot get tables to work
at all.  I'm using MetroWerks CodeWarrior 8.  Using Constructor, I
create a simple form with a table (on the main form, the table is
called "Items", so the generated ID is MainItemsTable).  I've included
some test code below that does not work for me.  The very first call
to TblSetItemsStyle(...) gets this error in the Palm emulator:
"Test (1.0) called SysFatalAlert with the message: "Table.c, Line:
2113, Invalid parameter"
After unsuccessfully trying many different things, I recreated the
project from scratch and tried it all over again, with the exact same
results.  I traced through with debug, and all the parameters passed
into TblSetItemStyle seem correct: a valid ptbl, row = 0, col = 0,
labelTableItem being the right value.  Is this a bug with CodeWarrior
8 or I am doing something stupid?  If I hit "Continue" on the error
window, I will get the error for every call to TblSetItemStyle and
will end up getting memory errors (in my first test project, I would
end up with a corrupted form, with the table itself being placed at
wierd screen locations like 8000x, -2342y).

static void MainFormInit(FormType * frmP)
{
  TablePtr ptbl;
  Int16 row, col, rowCount, colCount;

  ptbl = (TablePtr)FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP,
MainItemsTable));

  colCount = 3;
  rowCount = TblGetNumberOfRows(ptbl);

  for(row = 0;row < rowCount;row++)
  {
    for(col = 0;col < colCount;col++)
    {
      TblSetItemStyle(ptbl, row, col, labelTableItem);
    }
  }

  for(col = 0;col < colCount;col++)
  {
    TblSetColumnUsable(ptbl, col, true);
  }

  for(row = 0;row < rowCount;row++)
  {
    for(col = 0;col < colCount;col++)
    {
      TblSetItemPtr(ptbl, row, col, "Test");
    }
  }

Quote:}

 
 
 

Frustrated with tables...

Post by Ben Combe » Wed, 07 Nov 2001 12:04:30



Quote:> I'm a newbie to Palm OS development, and I cannot get tables to work
> at all.  I'm using MetroWerks CodeWarrior 8.  Using Constructor, I
> create a simple form with a table (on the main form, the table is
> called "Items", so the generated ID is MainItemsTable).  I've included
> some test code below that does not work for me.  The very first call
> to TblSetItemsStyle(...) gets this error in the Palm emulator:
> "Test (1.0) called SysFatalAlert with the message: "Table.c, Line:
> 2113, Invalid parameter"

This message can only happen if you pass an invalid row or column value.
Which ROM image are you using?  The line number didn't match up with the
Palm OS 3.0, 3.5 or 4.0 source code, so I hope you're using a 4.1 debug
image.

Quote:> After unsuccessfully trying many different things, I recreated the
> project from scratch and tried it all over again, with the exact same
> results.  I traced through with debug, and all the parameters passed
> into TblSetItemStyle seem correct: a valid ptbl, row = 0, col = 0,
> labelTableItem being the right value.  Is this a bug with CodeWarrior
> 8 or I am doing something stupid?  If I hit "Continue" on the error
> window, I will get the error for every call to TblSetItemStyle and
> will end up getting memory errors (in my first test project, I would
> end up with a corrupted form, with the table itself being placed at
> wierd screen locations like 8000x, -2342y).

Look inside the ptbl structure and see what values are set for
numColumns and numRows.  Make sure those are valid before the call to
TblSetItemStyle.  The only thing that seems possible is that you're not
getting a valid table pointer.  I'm not sure what would cause this,
however.

 
 
 

Frustrated with tables...

Post by anod » Thu, 08 Nov 2001 00:07:01


Thank you for your prompt reply!  I'm use POSE.  If I pull up Session
Info, I get this:
Device name: Palm III
RAM size: 8192
ROM file: Palm OS 3.3-en-iii-dbg.rom

I'll look in the ptable... but can't imagine how the numbers would be
wrong if I explicitly set it to 3 columns and 6 rows in Constructor
(and Constructor does show the grid being 3x6)?  It gets the error on
the first call (and all other calls)... the first call passes in 0,
0... It is 0 based, right?

  Thanks.




> > I'm a newbie to Palm OS development, and I cannot get tables to work
> > at all.  I'm using MetroWerks CodeWarrior 8.  Using Constructor, I
> > create a simple form with a table (on the main form, the table is
> > called "Items", so the generated ID is MainItemsTable).  I've included
> > some test code below that does not work for me.  The very first call
> > to TblSetItemsStyle(...) gets this error in the Palm emulator:
> > "Test (1.0) called SysFatalAlert with the message: "Table.c, Line:
> > 2113, Invalid parameter"

> This message can only happen if you pass an invalid row or column value.
> Which ROM image are you using?  The line number didn't match up with the
> Palm OS 3.0, 3.5 or 4.0 source code, so I hope you're using a 4.1 debug
> image.

> > After unsuccessfully trying many different things, I recreated the
> > project from scratch and tried it all over again, with the exact same
> > results.  I traced through with debug, and all the parameters passed
> > into TblSetItemStyle seem correct: a valid ptbl, row = 0, col = 0,
> > labelTableItem being the right value.  Is this a bug with CodeWarrior
> > 8 or I am doing something stupid?  If I hit "Continue" on the error
> > window, I will get the error for every call to TblSetItemStyle and
> > will end up getting memory errors (in my first test project, I would
> > end up with a corrupted form, with the table itself being placed at
> > wierd screen locations like 8000x, -2342y).

> Look inside the ptbl structure and see what values are set for
> numColumns and numRows.  Make sure those are valid before the call to
> TblSetItemStyle.  The only thing that seems possible is that you're not
> getting a valid table pointer.  I'm not sure what would cause this,
> however.

 
 
 

Frustrated with tables...

Post by Ben Combe » Thu, 08 Nov 2001 00:48:37



Quote:> Thank you for your prompt reply!  I'm use POSE.  If I pull up Session
> Info, I get this:
> Device name: Palm III
> RAM size: 8192
> ROM file: Palm OS 3.3-en-iii-dbg.rom

> I'll look in the ptable... but can't imagine how the numbers would be
> wrong if I explicitly set it to 3 columns and 6 rows in Constructor
> (and Constructor does show the grid being 3x6)?  It gets the error on
> the first call (and all other calls)... the first call passes in 0,
> 0... It is 0 based, right?

Yes, they are 0-based.  I'm wondering if there is some sort of form
corruption going on in your system.  If you set some controls with too
large strings, they could overwrite into following controls.  That is
the only thing I could see going wrong.

BTW, I do recommend using the 4.0 debug ROMs -- they catch a lot more
errors than the 3.3 ones.

 
 
 

1. Tables, tables, tables

Hi, wonder if anyone can help

I'm preparing an A5 Handbook which contains many, slightly differing tables.

After much effort, we produced it in Mac Word (5.1) last year (because of
it's relative ease of handling tables) on A4 pages that were reduced down
to A5 when printed (print run about 1,000). The results were average to
say the least.

Ideally, I would like to lay the document out in Quark XPress and run out
the whole thing to film for platemaking.

So, is there anything out there that allows me to create tables easily,
that can then be exported (as eps's ?) into XPress ? Word 5 & FreeHand 5
are no good. Does Word 6 export as eps ? I've tried the FrameMaker 3.0
demo - but it was save-disabled. Does FrameMaker export as eps ? (I'd
rather not learn a whole new package !).

Any suggestions will be greatly received !

Graham

2. AD disaster recovery!!!!!

3. Subnode in table, Subtable in table, subtable in subtable in table

4. W2k takes a rest during startup

5. Tables within tables vs. multi-dimensional tables

6. repadmin error 1815

7. extremely frustrated by epson gt-10000... help?

8. Scanjet 4100c software problem , Very Frustrating

9. frustrating hp scanjet 5200c

10. Frustrated with Minolta Scan Dual, please help

11. frustrated with UMAX Astra 610S

12. Splinter Cell frustrating?