2016년 12월 22일 목요일

Checking if text is null


I am trying to check if some text is null. 

When I do "If (isEmpty(get_text_variable))" an error comes up that says "The operation is text empty? cannot accept the arguments: [*nothing*]"
I would think this should just return true, instead of throwing an error. Is there a way to catch a generic error like that?

-- 
you probably found an App Inventor bug...

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

Please prepare an example as small as possible, which demonstrates this issue and add the project (aia file) into this thread together with exact instructions for how to elicit the error, so someone can take a look

-- 
Here's a screenshot of the error that shows up: https://snag.gy/HMyWpg.jpg

Here's the block of code: https://snag.gy/aNpuL5.jpg 

The issue is when I click the "ConnectButton" and the device that is at index 'number' does not advertise a device name (i.e device_name is null) it comes up with that error. If I instead set 'global device_name' to a constant string, everything works.

I'll work on getting the file uploaded soon...

-- 
Here is the .aia file for the whole app. It's not that complex overall, and I'm sure there are a lot of "best practices" that I'm missing, but it's just meant to be a quick POC


-- 


댓글 없음:

댓글 쓰기