TheSwamp

Code Red => Visual DCL Programming => AutoLISP (Vanilla / Visual) => OpenDCL => Topic started by: Peter2 on August 02, 2013, 09:42:54 AM

Title: "dcl_Grid_SetCellText" creates error
Post by: Peter2 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
Title: Re: "dcl_Grid_SetCellText" creates error
Post by: owenwengerd 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.
Title: Re: "dcl_Grid_SetCellText" creates error
Post by: Peter2 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"..
Title: Re: "dcl_Grid_SetCellText" creates error
Post by: owenwengerd 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.
Title: Re: "dcl_Grid_SetCellText" creates error
Post by: Peter2 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?
Title: Re: "dcl_Grid_SetCellText" creates error
Post by: owenwengerd 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.
Title: Re: "dcl_Grid_SetCellText" creates error
Post by: Peter2 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.