Trouble with Permissions and Code Execution at the App Front End

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

Possibly here:

You initialise the Date_List variable as a text:

it should be initialised as an empty list

I tried that yesterday. Actually have three errors then:

Still have Screen1.Initialise empty.

You are going to need to go through each of your procedures to identify variables that are not being initialised correctly. One way is to save all such procedures or blocks to the backpack, delete them from your blocks, then test, add one back, test, fix any errors or if none, add the next one back, and so on....

(You might want to empty your backpack first to make things easier to identify)

Thanks. Looking back, I could imagine the error(s) may be due to setting values to 0.

Given the error appears without any apparent code execution and your initial comment about lists and variables loading before Screen1, I'll go back and delete half of the lists and variables and follow with the half/half/half/.... process until I (hopefully) identify the problematic item(s).

Will update with any successes.


It was a combination of setting the list ta a default text value "", instead of "create empty list" and a couple of clock timers automatically firing off before I had populated the list variable properly.

All I had to do was turn the timers off by default (enable only when I need them). This means they don't fire pre-Screen1 and the main code has time to do its thing and populate the list variable with a proper list.

Thank you to @TIMAI2 for the guidance despite the minefield of code I shared.

Pleased to hear you sorted it out. :+1: