The operation length cannot accept the arguments: , [*nothing*]

Can somebody please explain what is wrong here?


I made it so that after an action it creates a delete button (dynamic button) and when it’s clicked it deletes the thing which has the same id.
Blocks just check if the the component (dynamic delete button) has the specyfic id and if so then does something if not then doesn’t do anything. It’s put in if any button click so I have to check if it’s the right button.

Thanks!

Show us “returnOnlyNumbers” function blocks.

Here,


(it’s not mine I got it from a guy on some post here)

“Getid” block can’t be used with objects not created dynamically. Probably you try to press button created with kodular interface and your “GetId” block returns nothing.

The object is created dynamiclly tho,

It happens only when u click the delete button?

No, it happens when I click any button since it’s when any button.clicked. I took out the then blocks to see what caused it and it’s the part of the code i sent u.

Can u send the aia? It’s hard to figure it out for me when i can’t debug.

Uhh I don’t really want to show whole code because it is quite a good app and the best app, you can recreate it with the blocks I send u, when the screen initalizes you create the button with blocks I’ve sent you, then add the if any button.click blocks and to then put something liek change label1.text to workks and do the onlyNumbers procedure.

In that case just use Notifier component, and use the block “show alert” with the string value before the problem occurs.

What do you mean “with the string value before the problem occurs.”?

Simple debug “tactic”. If u don’t know why something doesn’t work you want to know what is the return values of your blocks.

blocks

If u don’t have any logic included in “THEN” and “ELSE” in the Click event handler I have no idea why this is not working.

Same, It’s not an issue with the procedure tho. I used it on tons of other blocks and it worked perfectly fine (yes I used it for get id block too). I don’t know why this isn’t, I mean it is working as intended it just shows an error which ruins the app when exported.

component_event

It’s not the best way. The obstacle must be somewhere deeper in your blocks. If you don’t want to get Toast Alerts about the problem use that block.

you are initialising the local variable and didn’t set anything for string but immediately you are looking for its length. Will work?

If you want to get a click on a specific button then use these blocks. Don’t need to make such difficult process for a simple thing.

Just put your rest of blocks in then and you are good to go.

3 Likes

Thanks, can I just ask what should I do to specify which delete button is it? Because under each video there’s a delete button with the id of “deleteVid” and a number like 1 when another video is created its the same id but with number 2 and so on. So how do I check what number is the button that is clicked on?

Nevermind I got it, thank you so much!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.