Trouble with Permissions and Code Execution at the App Front End

Hi,
I'm having some strange issues. I can't work out if i've screwed up some code accidentally with sloppy fingers or if there's something else going on.

This is the code from my app startup:


and:
blocks (16)

Basically, I want the permission granted before I continue with any further code execution (the initialize routine). However, this is what my screen grab looks like:

I can't work out why i'm getting this bad arguments error. If I click allow, the error persists and if if I deny, the app closes.

Any ideas on what may be going on? Could a clock timer be firing off some code? Something else?

Two things

Looks like you have an issue with an empty variable or list you have created (these are set before Screen1.Initialise)

Your initialise event will not run second time after giving permission because no permission is granted. You will need to add more logic to handle this.

Show all blocks.

I found one, but it hasn't made any difference.

I do have quite a few lists going on. What kind of issues should I be looking for?

This is okay... I think. I call other specific routines throughout the code.

I'd love to narrow it down a bit for you first!

Blocks unreadable

@TIMAI2 I know. Hence, my comment about trying to narrow the problem down a bit for everyone.

It was a tongue-in-cheek comment. My apologies.

Show all the variables created at run time, and your initialise procedure

Is there an easy way to do this? There's over 50 including lists.

and these are all generated at run time ?

Yes they are - many set to zero, but nonetheless set.

See here (point 3):

Thanks @Anke. However, my real issue is that i don't want to share all of my code with the world.

I'll have to work through this myself I think.

Okay, so i reverted to a much older code that I had at the front end:


This sort-of works - I still has the "Bad arguments to length of list" on the first load (new install), but if I click "Allow", then "End Application" and then reload the app, everything works fine.

Any ideas?

as previously indicated....

Okay, I appreciate that, but i'm struggling to find the error.

I'm also wondering why after the first loading of the app, and I allow permissions, that the app works fine? Maybe that will give me a clue of where to look.

What is so difficult about posting the created variables / lists and the Screen.Initialize block before we have to continue puzzling out here.

1 Like

Let me organise the code and put the pieces together to share. Might take me a bit of time.

If you remove everything from your Screen1.Initialise event, do you still get the bad arguments error ?
(Test with companion)

If you get no error, then put the blocks back, but then remove everything but the first item from your initialise procedure. If still no error add the second item, and so on.

If you get the error at some point, report back, or investigate.

Yes, I get the error with the Screen1.Initialise empty. Tested on phone.