Author Topic: "dcl_Grid_SetCellText" creates error  (Read 3810 times)

0 Members and 1 Guest are viewing this topic.

Peter2

  • Swamp Rat
  • Posts: 564
"dcl_Grid_SetCellText" creates error
« on: August 02, 2013, 09:42:54 AM »
I use the code
Code: [Select]
(dcl_Grid_SetCellText grid_prob_dialog_GridUeber 2 1 "Opendcl") - and get an error because of an not allowed argument. I attached the code fragment - maybe it is very simple thing, but I can not find the reason.

Have a nive weekend
Peter

AutoCAD Map 3D 2018 German (so some technical terms will be badly retranslated to English)
BricsCAD V19

owenwengerd

  • Bull Frog
  • Posts: 439
Re: "dcl_Grid_SetCellText" creates error
« Reply #1 on: August 02, 2013, 10:49:45 AM »
It looks like you are showing your form before you've defined your OnInitialized event handler function, so the OnInitialized handler should not be executing at all until the second time you load the file.

Peter2

  • Swamp Rat
  • Posts: 564
Re: "dcl_Grid_SetCellText" creates error
« Reply #2 on: August 02, 2013, 12:01:12 PM »
Yes, you are right. Now I modified the code - at first "Oninitialize", then "Show". But it displays only the "dcl_messagebox" which is in the "defun", and nothing else happens. Also the commandline brings "nil")
Code: [Select]
Befehl: (dcl_Grid_SetCellText grid_prob_dialog_GridUeber 2 1 "Opendcl")
nil

EDIT: Now I found why I get the error with the "argument" - I started the code above while the dialogue was not(!) displayed, and this makes the error.
If it is displayed I get "nil"..
« Last Edit: August 02, 2013, 12:07:19 PM by Peter2 »
Peter

AutoCAD Map 3D 2018 German (so some technical terms will be badly retranslated to English)
BricsCAD V19

owenwengerd

  • Bull Frog
  • Posts: 439
Re: "dcl_Grid_SetCellText" creates error
« Reply #3 on: August 02, 2013, 12:41:49 PM »
Before you can add content, you have to set cell style(s). I suspect that is your problem.

Peter2

  • Swamp Rat
  • Posts: 564
Re: "dcl_Grid_SetCellText" creates error
« Reply #4 on: August 02, 2013, 12:45:47 PM »
Before you can add content, you have to set cell style(s). I suspect that is your problem.
In ODCL I tried to use "0 - not editable" and "6 - Text". Both did not work.
Has it to be redefined in LSP again?
Peter

AutoCAD Map 3D 2018 German (so some technical terms will be badly retranslated to English)
BricsCAD V19

owenwengerd

  • Bull Frog
  • Posts: 439
Re: "dcl_Grid_SetCellText" creates error
« Reply #5 on: August 02, 2013, 01:18:42 PM »
If you have columns defined in the .odcl file, I think you still need to add rows (via AddRow or AddString) before you can operate on cell content.

Peter2

  • Swamp Rat
  • Posts: 564
Re: "dcl_Grid_SetCellText" creates error
« Reply #6 on: August 03, 2013, 02:02:28 PM »
If you have columns defined in the .odcl file, I think you still need to add rows (via AddRow or AddString) before you can operate on cell content.
Thanks, confirmed. Now I use "AddString" instead of "SetCelltext" and it works fine.
Peter

AutoCAD Map 3D 2018 German (so some technical terms will be badly retranslated to English)
BricsCAD V19