Ksp reference Manual



Download 0,99 Mb.
Pdf ko'rish
bet59/187
Sana10.02.2022
Hajmi0,99 Mb.
#441108
1   ...   55   56   57   58   59   60   61   62   ...   187
Bog'liq
KONTAKT 610 KSP Reference Manual

9. ARRAY COMMANDS
9.1. array_equal()
array_equal(,)
Checks the values of two arrays. True if all values are equal, false if not
Remarks
This command does not work with arrays of real numbers.
Examples
on init
declare %array_1[10]
declare %array_2[11]
if (array_equal(%array_1,%array_2))
message($ENGINE_UPTIME)
end if
end on
This script will produce an error message as the two arrays don't have the same size
See Also
sort()
num_elements()
search()
9.2. num_elements()
num_elements()
Returns the number of elements in an array
Remarks
With this function you can, e.g., check how many groups are affected by the current event by using
num_elements(%GROUPS_AFFECTED)
.
Examples
on note
message(num_elements(%GROUPS_AFFECTED))
end on
Outputs the number of groups playing
Array Commands
68
KSP Reference Manual


See Also
array_equal()
sort()
search()
%GROUPS_AFFECTED
9.3. search()
search(,)
Searches the specified array for the specified value and returns the index of its first position. If the value is not found, the
function returns -1.
Remarks
This command does not work with arrays of real numbers.
Examples
on init
declare ui_table %array[10] (2,2,5)
declare ui_button $check
set_text ($check,"Zero present?")
end on
on ui_control ($check)
if (search(%array,0) = -1)
message ("No")
else
message("Yes")
end if
$check := 0
end on
Checking if a specific value is present
See Also 
array_equal()
num_elements()
sort()
9.4. sort()
sort(,)
Array Commands
69
KSP Reference Manual


Sorts an array in ascending or descending order.
With direction = 0, the array is sorted in ascending order.
With direction # 0, the array is sorted in descending order.
Examples
on init
declare $count
declare ui_table %array[128] (3,3,127)
while ($count < 128)
%array[$count] := $count
inc($count)
end while
declare ui_button $Invert
end on
on ui_control ($Invert)
sort(%array,$Invert)
end on
Quickly inverting a linear curve display
See Also 
array_equal()
num_elements()
sort()
Array Commands
70
KSP Reference Manual



Download 0,99 Mb.

Do'stlaringiz bilan baham:
1   ...   55   56   57   58   59   60   61   62   ...   187




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish