Skip to first unread message
Assigned to andrew.f...@gmail.com by halatmi...@gmail.com

Alex Sneed Miller

unread,
Dec 21, 2016, 3:46:01 PM12/21/16
to MIT App Inventor Forum
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?

Thanks,
Alex

Taifun

unread,
Dec 21, 2016, 4:50:25 PM12/21/16
to MIT App Inventor Forum
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

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 






Alex Sneed Miller

unread,
Dec 22, 2016, 3:18:34 PM12/22/16
to MIT App Inventor Forum

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...

Alex Sneed Miller

unread,
Dec 22, 2016, 3:25:51 PM12/22/16
to MIT App Inventor Forum
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
alex_checkpoint1.aia

Ghica

unread,
Dec 23, 2016, 9:37:28 AM12/23/16
to MIT App Inventor Forum
Probably you did not find any device this way. Ever heard of a ListPicker? That would be an easier way to find your devices.
Try my test app, attached here, to see if you can connect and go from there.
Cheers, Ghica.
BLE_Workshop_v02.aia
Reply all
Reply to author
Forward
0 new messages