Problems with data registration with Combobox listing and function

Asked

Viewed 48 times

2

I’m having great difficulties with the combobox and the use of Function in Delphi

I apologize, I am beginner in the world of programming and can not identar the code here, I will leave the code in Pastebin.

code: https://pastebin.com/Z1Z540Hd

is giving error on line 49: "Not enough current Rameters"

1 answer

3


Good morning kingarthur.. Everything straight?:)
Man. If I understand correctly what happens is as follows..:
cmbNomes = Tcombobox... correct?
In the line below Voce wants to put inside the combobox the value of the object name property objdados.. correct?
cmbNomes.Items.AddObject(objdados.nome);
If this is the correct mode, it is this..: cmbNomes.Items.Add(objdados.name);

The function you want to use Addobject asks for two parameters..
1st Parameter- String.. Would be the ..: objdados.name as you did..
2nd Parameter- Tobject
A Way to use this function would be to pass the person ID in the second parameter..
Would look like this
cmbNomes.Items.Add(objdados.nome,TObject(objdados.id_pessoa));
To recover the value of the combo would look like this..:
variavel_inteira:= integer( cmbNomes.Items.Objects[index]);

I hope I have understood your problem correctly and explained it in a clear way :)
Hugs :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.