Hey,
I’m working on my app, which includes some career tests. The first version is nearly ready for testing, but I get an error message when I try to release on Android (HTML5 works). It says that the code is too large:
The code is now about 5000 lines long (I’d say 3.000 to 4.000 without the indentations). After reducing some lines the release on Android worked, but since I‘ not completely ready and plan to add more tests, this is a problem.
I’m not to deep in the Methods topic, therefore the whole code is in one main .cxs with a big Select-Case-loop. For obvious length reasons, I won’t copy the whole source code, but to get an idea of it’s structure I’ll describe it with pseudo code.
You’ve got the main loop with mode = 0, the next menus with mode = 1, 2, 3 etc. and single tests with „Case 101“
My questions:
My thoughts if that doesn’t work were:
Greetings
Benny
I’m working on my app, which includes some career tests. The first version is nearly ready for testing, but I get an error message when I try to release on Android (HTML5 works). It says that the code is too large:
The code is now about 5000 lines long (I’d say 3.000 to 4.000 without the indentations). After reducing some lines the release on Android worked, but since I‘ not completely ready and plan to add more tests, this is a problem.
I’m not to deep in the Methods topic, therefore the whole code is in one main .cxs with a big Select-Case-loop. For obvious length reasons, I won’t copy the whole source code, but to get an idea of it’s structure I’ll describe it with pseudo code.
You’ve got the main loop with mode = 0, the next menus with mode = 1, 2, 3 etc. and single tests with „Case 101“
Cerberus:
Field Images, variables etc.
Method OnRender()
Select mode
Case 0' Start menu
If (Click on button1) mode = 1
If (Click on button2) mode = 2
Case 1' Sub menu 1
If (Click on button1) mode = 10
If (Click on button2) mode = 11
Case 10' Sub sub menu 10
If (Click on button1) mode = 101 (test 101)
If (Click on button2) mode = 102 (test 102)
Case 101
(test 101)
Case 2' Sub menu 2
If (Click on button1) mode = 20
If (Click on button2) mode = 21
End Select
My questions:
- How can I write more code and avoid the error? If possible, I’d like to keep the Select/Case structure (at least for this project).
My thoughts if that doesn’t work were:
- Using a main .cxs file and use „Import“ for the other parts. Would this split the code into more files or will it become a big file either way?
- Putting some code in an external file and use „Include“.
Greetings
Benny