Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 20-02-2020, 22:51
Gupta Gupta is offline
Banned
 
Join Date: Aug 2016
Location: https://t.me/pump_upp
Posts: 399
Thanks: 139
Thanked 716 Times in 231 Posts
Gupta is on a distinguished road
Send a message via ICQ to Gupta Send a message via AIM to Gupta Send a message via Yahoo to Gupta
current GetFlayByLine function is pretty hard to understand, reading the description can't we do it in this way;
and please whoever is developing current CIU please try to use meaningful variable names. L1 LN S1 doesn't make any sense
Code:
function GetFlagByLine: TArrayOfInteger;
var
  FlagDist, CurrFlagCount: String;
  I, LangCount, LangUsed, LastLineCount: Integer;
begin
  LangCount := LangNumber;
  LangUsed  := 0;
  LastLineCount := 0;
  SetArrayLength(Result, 0);
  FlagDist := GetValStr('LangBox', 'FlagByLine', '0') + ',';
  while (Length(FlagDist) > 0) and (LangUsed < LangCount) do begin
    CurrFlagCount := Trim(Copy(FlagDist, 0, Pos(',', FlagDist) - 1));
    FlagDist := Copy(FlagDist, Pos(',', FlagDist) + 1, Length(FlagDist));
    SetArrayLength(Result, GetArrayLength(Result) + 1);
    I := GetArrayLength(Result) - 1;
    Result[I] := StrToInt(CurrFlagCount);
    if Result[I] > LangCount - LangUsed then
        Result[I] := LangCount - LangUsed;
    LangUsed := LangUsed + Result[I];
    LastLineCount := Result[I];
  end;
  if LangUsed <> LangCount then
  begin
      if LastLineCount = 0 then
      begin
        SetArrayLength(Result, GetArrayLength(Result) + 1);
        Result[GetArrayLength(Result) - 1] := LangCount - LangUsed;
      end else begin
        while LangUsed <> LangCount do
        begin
            SetArrayLength(Result, GetArrayLength(Result) + 1);
            I := GetArrayLength(Result) - 1;
            Result[I] := LangCount - LangUsed;
            if Result[I] > LastLineCount then
                Result[I] := LastLineCount;
            LangUsed := LangUsed + Result[I];
        end;
      end;
  end;
end;

Last edited by Gupta; 20-02-2020 at 23:01.
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Game Installer Designer by altef_4 altef_4 Conversion Tutorials 236 28-05-2021 02:54
PREVIEW | Transparent Installer + T_Installer Designer (FMX) STB13 Conversion Tutorials 9 08-12-2018 14:49
CIUv2 Designer Alpha 2 jamel2013 Conversion Tutorials 8 21-02-2016 03:42



All times are GMT -7. The time now is 01:19.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com