NULL data in Delphi 7 [closed]

1

If the text of an edit is Null show message so that the required data is filled otherwise run the code. That's what I need.

    
asked by Will 24.05.2016 в 04:59
source

2 answers

1

You have to verify that the text of your edit is not empty to execute the code. Otherwise, display a message for the user to fill in the data:

if Trim(edt1.Text) <> '' then
  // tu codigo
else
    showmessage('Por favor introduzca un valor');   
    
answered by 24.05.2016 в 11:44
0

If it is a TEdit, Javier's answer is correct, but if you talk null you must be referring to a DBedit linked to data from a TDataSet.

if not VarIsNull(DataSet[FieldName]) then
  // tu codigo
else
    showmessage('Por favor introduzca un valor'); 
    
answered by 02.06.2016 в 16:48