View Single Post
Old 21-02-2020, 09:19
Gupta Gupta is offline
Registered User
Join Date: Aug 2016
Location: India
Posts: 397
Thanks: 139
Thanked 705 Times in 229 Posts
Gupta is on a distinguished road
Originally Posted by Cesar82 View Post
I am currently developing on the CIU script.
At the time KaktoR didn't know much about programming and I helped him to solve some problems in the script and then he gave me the opportunity to continue editing the script.
KaktoR tests and takes care of the compressors and shares the versions I send to him.
I use variables S1, L1, etc so that the code is smaller and better visualization of most of the code in the Inno Setup interface. But each variable has its meaning in relation to what it does.
S1, S2, S3 = Temporary Strings.
FL = Flags per line.
FC = Flags count.
LN = Language Number.

In this GetFlagByLine function, if the number of parameters in FlagsByLine= key (setup.ini) does not cover all flags, the next lines will have the same amount as the previous one. The same is true in the GetFlagBoxAlign function.
Example containing 17 flags.
line 1 with 3 flags
line 2 with 2 flags
line 3 with 5 flags
line 4 with 5 flags
line 5 with 2 flags (3 + 2 + 5 + 5 + 2 = 17)

Look the test with my code in the attached file.
It avoids several errors due to lack of information that can happen if the user does not configure Setup.ini correctly.
It also only makes it possible to activate the BOX mode and no other keys are needed to create a square with the flags.
You should write some comments, the code I shared above do the same but imho its more concise and understandable I'm not good with naming variable but it still imho it does the job pretty well
I still didn't get why you used sqrt and other function
Will come back to you on tomorrow
Reply With Quote