First run header different

School Boy Error

Member
Licensed User
Longtime User
Hi,

Just finished my first app, thanks to lots of help from here! and pinching some code from examples. However one annoyance is that when I run the English markbook the first time it extends the header past the last column with a horrible yellow bar, if I close it (go back to main menu) and reopen it it works how I want it to.

In the header it sets the NumberofColumn variable but I couldn't figure out how to get it to count the columns in a csv (or where I would need to put this in the code). Like I said an annoyance more than a real problem but I would like to fix it.
 
Last edited:

klaus

Expert
Licensed User
Longtime User
I just had a look at your program, unfortunately we can't test it because the csv files are missing.
I see where the problem is, but it would be helpful having two csv files to test it.

Some comments:
. You could add default csv files in the Files Tab of the prject and copy those when no file exist in the working folder.
- You declare the same Process global variables in each complementary activity. You declare them only once. This point disappears with the suggestion below.
- The two Activity modules are almost the same, the only difference is the filename in line 37 and line 86. You could use only one Activity module by using setting the filename in the main activity.

Best regards.
 
Upvote 0

School Boy Error

Member
Licensed User
Longtime User
I just had a look at your program, unfortunately we can't test it because the csv files are missing.
I see where the problem is, but it would be helpful having two csv files to test it.

Some comments:
. You could add default csv files in the Files Tab of the prject and copy those when no file exist in the working folder.
- You declare the same Process global variables in each complementary activity. You declare them only once. This point disappears with the suggestion below.
- The two Activity modules are almost the same, the only difference is the filename in line 37 and line 86. You could use only one Activity module by using setting the filename in the main activity.

Best regards.

Yes, I thought that earlier on I'd have to use the "Sender" method I guess? I'll have a look at that during futher updates, thanks for the advice. I did copy them into the files folder in the zip, or at least thought I had! I've attached them again here. Thanks for your time Klaus I'd really like to sort this issue out.
 

Attachments

  • markbook.zip
    1,008 bytes · Views: 169
Upvote 0

School Boy Error

Member
Licensed User
Longtime User
Here you are.

Attached you find a modified version with my previous suggestions included.

Best regards.

Klaus, that looks amazing thank you!! The only problem is the number of columns may change from week to week depending on the number of objectives. So, although before I got the horrible yellow bar, it was able to adapt to a different number of columns.

B4X:
NumberOfColumns = 8

How could I change this so it looks at how many columns are actually in the csv?

Thanks again for you time.
 
Upvote 0

School Boy Error

Member
Licensed User
Longtime User
I've been trying to find the documentation on the "display.dir" command you've used but I've had no luck, everytime I search I've only found the file.dirassets etc could you point me in the right direction please?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Dir is a Process Global variable defined in the Display module.
To access Dir in another module, the variable name must have the module name as a prefix -> Display.Dir
You have the same with Display.FileName.

Attached you find the modfied version with the variable NumberOfColumns.

Best regards.
 
Upvote 0
Top