Designer Script Bug? / Error - "Error running Designer Script. Index was out of range

bloxa69

Active Member
Licensed User
Longtime User
I don't know if it's a bug or I'm using it the wrong way.
As soon as I use ActivitySize in my Designer Scripts and push Run Script (F5) to check it on device, I get "Error running Designer Script. Index was out of range." I'm on B4A 2.3.

B4X:
'this is the part that creates the error
If ActivitySize > 6 Then
   'do something
End If

P.S. I don't get any errors when running the actual app loading that layout. That only happens when I connect to B4A Designer and try to preview the layout.

As a side note - in my emulators I don't get Back button if the screen width is smaller than 601, so I have to use the Escape key on my keyboard to close out of any app. In B4A Designer the key is blocked and just pops Theme options. There is no way out of B4A if you want to go back to another app running on the same emulator. (May be there is, but I couldn't find it)
 

bloxa69

Active Member
Licensed User
Longtime User
Thanks Erel,
I am attaching a test layout - just one panel, no images plus simple Designer Script. Still the same error, I've attached the error screen and the layout file. I didn't go deep into setup config, but may be I still have the old B4A Designer apk after the upgrade to 2.3 somewhere and it's using it?
 

Attachments

  • error.PNG
    error.PNG
    13 KB · Views: 280
  • test.bal
    2.3 KB · Views: 262

bloxa69

Active Member
Licensed User
Longtime User
Thanks Erel.
I don't know if it helps you, I just discovered it yesterday - but similar constructions don't give me any errors in some other layouts.
In regard to general script versus designer script - I need my layouts to be reusable, so it's better for me to keep all layout related stuff in one place hence designer scripts.
Looking forward to the update.

P.S. at work I have to deal with a lot of different software companies support around the globe, and most of them suck in that regard. I would rate your support #1 globally. Keep the good work, thank you.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
In regard to general script versus designer script - I need my layouts to be reusable, so it's better for me to keep all layout related stuff in one place hence designer scripts.
Using the designer script is the correct approach. I meant to say that you should move the code from the variant specific editor to the general script editor (the top editor in the designer script0.
 

bloxa69

Active Member
Licensed User
Longtime User
you should move the code from the variant specific editor to the general script editor

OK, got you. Will do whenever possible.
Thanks for the tip.
 
Top