cancel
Showing results for 
Search instead for 
Did you mean: 

Read/Write textbox, matrix by Delphi.net

Former Member
0 Kudos

In vb, I can read/write everything but not in Delphi...

oForm := SBOapp.Forms.ActiveForm;

clsMatrix := SAPbouiCOM.Matrix(oForm.Items.Item('38').Specific);

clsMatrix.Columns.Item('U_freerm').Cells.Item('1').Specific.Value := '1'; I have tried .Value but the error message send that no the property ".Value" (it works in VB) Tried clsMatrix := oForm.Items.Item('38').Specific; (works in VB but not in delphi) Tried i := 1; clsMatrix.Columns.Item('U_freerm').Cells.Item('1').Specific := TObject(i); (delphi said that, .Specific is readonly)

Welcome for any hint or suggestion, thx.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I don't know why but it works:

oEdit := clsMatrix.Columns.Item('U_freerm').Cells.Item(TObject(pVal.Row)).Specific as SAPbouiCOM.EditText;

or

oEdit := clsMatrix.Columns.Item('U_freerm').Cells.Item(TObject(StrToInt('1'))).Specific as SAPbouiCOM.EditText;

-


The following doesn't work:

oEdit := clsMatrix.Columns.Item('U_freerm').Cells.Item(TObject(1)).Specific as SAPbouiCOM.EditText;

or

oEdit := clsMatrix.Columns.Item('U_freerm').Cells.Item(TObject('1')).Specific as SAPbouiCOM.EditText;

or

oEdit := clsMatrix.Columns.Item('U_freerm').Cells.Item(TObject(IntToStr(pVal.Row))).Specific as SAPbouiCOM.EditText;

Former Member
0 Kudos

Hi,

Try this line:

(if your matrix field is an Edit field)

(clsMatrix.Columns.Item('U_freerm').Cells.Item(TObject('1')).Specific as SAPbouiCOM.EditText).Value:= '1';

or

(clsMatrix.Columns.Item('U_freerm').Cells.Item('1').Specific as SAPbouiCOM.EditText).Value:= '1';

or

(if your matrix field is a Combobox field)

(clsMatrix.Columns.Item('U_freerm').Cells.Item('1').Specific as SAPbouiCOM.Combobox).Selected.Value

Have fun,

Peter

p.s.

There are no automatic type conversions in Delphi.

Former Member
0 Kudos

(clsMatrix.Columns.Item('U_freerm').Cells.Item(TObject('1')).Specific as SAPbouiCOM.EditText).Value:= '1';

and

(clsMatrix.Columns.Item('U_freerm').Cells.Item('1').Specific as SAPbouiCOM.EditText).Value:= '1';

all failed, without any error message. Really strange...

But ok for the textbox, only fail inside the matrix...