Home > Back-end >  DELPHI input decision problem
DELPHI input decision problem

Time:09-27

I have A card reader device, even if in A string of Numbers, at the same time in the software have A, B two boxes, when I read the card device through the outer card, automatic to input the information inside the card, inside A when input to complete the B box, according to the number 8 in A position to judge, for example,
10 to 1, 1111111111, the eighth is 1, the automatic input of the rat in B
10 2, 2222222222, the eighth is 2. The automatic input of cattle in B
Such,,
Due to A box is editable, additionally, you can also manually input, so when the number is more than ten or less than 10, don't display any content in B,
When the equipment by reading card, due to the length of the inside is certainly A 10, so after reading, B will automatically display,


Pray god give a train of thought

CodePudding user response:

In A onchange event B should display content,

CodePudding user response:

1, insert card incident, have A read characters;
2, A OnChange events:
 procedure TForm1. Edit1Change (Sender: TObject); 
Var s: a string;
I: integer;
The begin
If Length (Edit1. Text)=10
Then the begin
I:=StrToInt (Copy (Edit1. Text, 8, 1));
In Case of I
0: Edit2. Text:='0';
1: Edit2. Text:='mouse';
2: Edit2. Text:='cattle';
3: Edit2. Text:='3';
4: Edit2. Text:='4';
5: Edit2. Text:='5';
6: Edit2. Text:='6';
7: Edit2. Text:='7';
8: Edit2. Text:='8'.
9: Edit2. Text:='9'.
end;
End
The else Edit2. Text:=' ';
end;

CodePudding user response:

refer to the second floor lyhoo163 response:
1, insert the card incident, have A read characters;
2, A OnChange events:
 procedure TForm1. Edit1Change (Sender: TObject); 
Var s: a string;
I: integer;
The begin
If Length (Edit1. Text)=10
Then the begin
I:=StrToInt (Copy (Edit1. Text, 8, 1));
In Case of I
0: Edit2. Text:='0';
1: Edit2. Text:='mouse';
2: Edit2. Text:='cattle';
3: Edit2. Text:='3';
4: Edit2. Text:='4';
5: Edit2. Text:='5';
6: Edit2. Text:='6';
7: Edit2. Text:='7';
8: Edit2. Text:='8'.
9: Edit2. Text:='9'.
end;
End
The else Edit2. Text:=' ';
end;



Thanks for the great god, but you seem less an END at last

CodePudding user response:

Many end,
  • Related