SAIL - Compare

Gotowe kody SAIL'a, informacje na temat moddingu, itd.

Moderator: zoNE

Post Reply
User avatar

Topic author
zoNE
The Great Uniter & Site Administrator
The Great Uniter & Site Administrator
Posts: 1328
Joined: Fri Feb 17, 2006 3:44 pm
Location: Poland
Contact:

SAIL - Compare

#1

Post by zoNE » Sun Feb 05, 2017 10:47 am

Serpent wrote:Poniżej zamieszczam dwie nowe funkcje.

Compare - porównuje dwie wartości.

Code: Select all

Export Function Compare(val1, val2);
begin
if val1 = val2 then
   result := true
    else
     result := false;
End;
Funkcja ta umożliwia porównanie na przykład dwóch elementów tablic gdyż normalny zapis: tablica[1] = tabliczka[2] jest niedozwolony.

CompareArray - porównuje dwie tablice pod kątem wielkości i zawartości.

Code: Select all

Export Function CompareArray(array1, array2);
var i;
begin
result := true;

     if array1 = array2 then
        begin
        for i = 1 to array1 do
            if not Compare(array1[i], array2[i]) then
               begin
               result := false;
               break;
               end;
        end
         else
          result := false;
End;
Author: Serpent
Topic: viewtopic.php?f=42&t=4856
PC MB: MSI Z97-G43 | CPU: Intel Xeon E3-1231v3 3.4GHz + Raijintek EreBoss | RAM: HyperX 2x8GB 1866MHz DDR3 CL9 | GPU: MSI GeForce GTX 970 100ME 4GB GDDR5 (256bit) | SSD: Crucial BX100 250GB | HDD: 4TB | LCD: EIZO FlexScan 22" S2243W Black | AUDIO: Asus Xonar D2 + KODA DRA-660 + KODA AV-701 + SW-550 v2 + Sennheiser HD 595 | OS: Windows 10 Pro
Laptop DELL Precision M6500 CPU: i5-520M RAM: 8GB DDR3 SSD: 128GB HDD: 500GB GPU: ATI FirePro M7740 1GB DDR5 OS: Windows 7 Ultimate 64-bit

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest