|
#11
|
||||
|
||||
|
What's new:
Code:
* Merged ISArcEx into FMXInno. - need to be tested to make sure everything is ok. * Added new function FXMathExp (which parses math expressions). - function FXMathExp(Exp: WideString): Double; - it's different from the Calc function in MFT. Code:
----------ISArcEx----------:
>> remove the following lines highlighted in red from your current script.
[Files]
// External
Source: ".\Unpack\English.ini"; DestDir: {tmp}; Flags: dontcopy
//Source: ".\Unpack\Russian.ini"; DestDir: {tmp}; Flags: dontcopy
Source: ".\Unpack\arc.ini"; DestDir: {tmp}; Flags: dontcopy
Source: ".\Unpack\unarc.dll"; DestDir: {tmp}; Flags: dontcopy
Source: ".\Unpack\ISArcEx.dll"; DestDir: {tmp}; Flags: dontcopy
[Code]
{ ISArcEx v0.4 }
var
ISArcExDiskCount: Integer;
ISArcExCancel: integer;
ISArcExError: boolean;
ISArcDiskAddingSuccess: boolean;
type
TCallback = function(OverallPct, CurrentPct, DiskTotalMB, DiskExtractedMB: Integer; DiskName, CurrentFile, TimeStr1, TimeStr2, TimeStr3, Speed: WideString): LongWord;
function ISArcExInit(WinHandle: Longint; TimeFormat: Integer; Callback: TCallback): Boolean; external 'ISArcExInit@files:FMXInno.dll stdcall';
function ISArcExAddDisks(Inputfile, Password, OutputPath: Widestring): Boolean; external 'ISArcExAddDisks@files:FMXInno.dll stdcall';
function ISArcExExtract(DiskNumber: Integer; CfgFile, WorkPath: Widestring): Boolean; external 'ISArcExExtract@files:FMXInno.dll stdcall';
function SuspendProc: Boolean; external 'SuspendProc@files:FMXInno.dll stdcall';
function ResumeProc: Boolean; external 'ResumeProc@files:FMXInno.dll stdcall';
procedure ISArcExStop; external 'ISArcExStop@files:FMXInno.dll stdcall';
procedure ISArcExCleanUp; external 'ISArcExCleanUp@files:FMXInno.dll stdcall';
function ChangeLanguage(Language: Widestring): boolean; external 'ChangeLanguage@files:FMXInno.dll stdcall';
function Exec2(filename, Param: WideString; Show: Boolean): Boolean; external 'Exec2@files:FMXInno.dll stdcall';
{ - End - }
Code:
----------FXMathExp---------:
var
Exp, Ans: String;
function InitializeSetup(): Boolean;
begin
Exp := 'Sin(Pi/6) + ATan(1) * (Pow(7*2,2) - (Fact(4) - Floor(8.46))) / Pi + Sqrt(Abs(-553 + Sqrt(9) * LogN(2, 2) / 2^2))';
Ans := Format('%0.2n', [FXMathExp(Exp)]); // Ans = 69.00
MsgBox('answer: ' + Ans, mbInformation, MB_OK);
result:= False;
end;
Code:
Numeric Operators:
x + y, x - y, x * y, x / y, x % y (or Mod),
x ^ y [Power], x \ y (or Div)
Comparison Operators:
x > y, x < y, x >= y, x <= y, x = y, x <> y,
!x (not), x & y (and), x | y (or), x xor y
Logical operators:
& (and), | (or), xor, ! (not)
Logical Functions:
iff(e, x, y) -> iff(10 > 3, 1, 0) = 1
isnumber('x')-> isnumber('25') = 1
Bitwise operations:
x && y (band), x || y (bor), !!x (bnot),
x bxor y, x >> y (shr), x << y (shl)
Code:
Statistical Functions:
max -> max(2, 4.87, 0.24, 10.0, 11)
min -> min(3, 4, 7.4, 11.0)
sum -> sum(0.25, 4.0, 11, 8)
avg -> avg(7, 3, 5)
count -> count(x,y,z,...)
stddev -> stddev(x,y,z,...) - standard deviation (unbiased)
stddevp -> stddevp(x1,x2,...) - standard deviation (biased)
sumofsquares -> sumofsquares(x,y,...) - sum of passed values squares
variance -> variance(x,y,...) - variance (unbiased)
variancep -> variancep(x,y,...) - variance (biased)
String Functions:
number -> number("+835xyz") = 835, number("2e2") = 200
length(s) - length of the string.
pos(t, s) - returns the index value of the first character of t that occurs in s.
hex(s) - returns numeric value for hexadecimal string.
Sign of a number:
sign -> sign(-5) = -1, sign(5) = 1, sign(0) = 0
Code:
Predefined Constants: Pi = 3.1415926535897932385 e = 2.71828182845905 True = 1 False = 0 Exponent of 10: e -> 1e+3 or le3 = 1000 Trigonometric, hyperbolic and invert functions: sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), cosh(x), sinh(x), tanh(x), asinh(x), acosh(x), atanh(x), sinD(x), cosD(x), tanD(x), RadToDeg(x), DegToRad(x) Exponential and logarithmic functions: log(x), lg(x) (log base 10), ln(x), LogN(x, y), exp(x), sqrt(x), sqr(x), Pow(x, y), Ldexp(x, y), LnXP1(x) Numeric and factional part of number: abs -> abs(-24) Int -> Int(1.951) = 1 frac -> Frac(12.75) = 0.75 ceil -> Ceil(-2.8) = -2, Ceil(2.8) = 3 floor -> Floor(-2.8) = -3, Floor(2.8) = 2 Round -> Round(1234567, -3) = 1235000, Round(1.235, 2) = 1.24 Trunc -> Trunc(1234567, -3) = 1234000, Trunc(1.235, 2) = 1.23 Fact -> Fact(4) = 24 - Factorial Random number generator: rnd, randomize Last edited by BLACKFIRE69; 31-03-2023 at 09:53. |
| The Following 4 Users Say Thank You to BLACKFIRE69 For This Useful Post: | ||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Windows Fluent Effects Standalone API - InnoSetup / VCL / FXM | BLACKFIRE69 | Conversion Tutorials | 0 | 15-11-2023 17:35 |
| Windows Phone Installer similar to razor12911's original design? | Kitsune1982 | Conversion Tutorials | 0 | 02-07-2020 13:04 |
| INDEX - Conversion Tutorial Index | Razor12911 | Conversion Tutorials | 5 | 11-06-2020 02:05 |
| Frequently Asked Questions | Joe Forster/STA | PC Games - Frequently Asked Questions | 0 | 29-11-2005 09:48 |