Raven
������������
������: ������ �����������: ����. 2004
�����: 408 ���������
|
TeamX prodly presents... Fun with strings vol.2... get_char, wordar and cust_str procedures... ����, �����, ��� ������� �� �����������, �������� ���� ������� ����� ��� ��������������� ����������, �������� ���������� atoi. �� ������� � ���. 1. char get_char(var original_string, var part_of_string); ������� ��������� ������ ������ � ����� ���������, ���������� ��������� �� ���������� ������ (�������� �� ASCII ������� �� 32 �� 125 ������������ - ��������� � ������� �����, �����, ������, �������, ����� ���������� � ������) ��� "Z". ������: ------------------------------------- char:=get_char("Ab c%4?78hj","Ab c%4"); display_msg("char="+char); ------------------------------------- �������: ------------------------------------- char=? ------------------------------------- 2. string wordar(var array, var cell); ��������� ������ ���� "abcd|efgh|klmn|...", ��� ������ ���� ����� �������� �� ����� ��������, ���������� get_char. ������ �������� - ����� �� ���� � ���� - ����� ������, ���������� ������� ���� �������. ������: ------------------------------------- word:=obj_name(dude_obj)+"|"+obj_name(self_obj); display_msg("str="+wordar(word,1)); ------------------------------------- ������� ��� self_obj. 3. string cust_str(var string_template, var word_array); �������� ������ ������ � ������ ����. ����� ����� ������ ���������� ������ � �������� � ��� ������� "###" �� ����� (��������������� ������� ���������) �� �������. ������1: acklint.ssl ------------------------------------- float_msg(self_obj,cust_str(mstr(20),obj_name(dude_obj)+"|"+obj_name(self_obj)),0); ------------------------------------- acklint.msg ------------------------------------- {20}{}{Hello, ###, my name is ###. How it goes?} ------------------------------------- ������� ��������� (������ �������� � ������, ��� ���� None): ------------------------------------- Hello, None, my name is Klint. How it goes? ------------------------------------- ������2: acklint.ssl ------------------------------------- word:=mstr(random(21,22))+"|"+mstr(random(23,24))+"|"+mstr(random(25,26)); float_msg(self_obj,cust_str(mstr(20),word),0); ------------------------------------- acklint.msg ------------------------------------- {20}{}{###, ###, ###?} {21}{}{Hello} {22}{}{Hi} {23}{}{pal} {24}{}{friend} {25}{}{how it goes} {26}{}{any news} ------------------------------------- ��� ������� ���� � 7 ������� ������ ����� ���� �� ��������� �����������: ------------------------------------- Hello, pal, how it goes? Hello, pal, any news? Hello, friend, how it goes? Hello, friend, any news? Hi, pal, how it goes? Hi, pal, any news? Hi, friend, how it goes? Hi, friend, any news? ------------------------------------- 8 ��������� ���������. ��������������, ������ {20}{}{### ### ### ###.} � ����� ���������� ��� ������� ��������� (13 ����� ������ + 2 ������ ����) ���� ��� 3^4=81 �������. ������, ������� ������ ������� ���? :-) [������ ����� ������] (� ���� �������� � �������� �������. ��� ����� ��� ����� ������ - ��� ����� :-)) ���� ������� cust_str: string cust_str(var string_template, var word_array, var num_of_variants_for_every_word); ������ �������� ����� ���������� ��������� ��� ������� �����. ����� ������ (���������������� � �������), ����� ����� �������: acklint.ssl ------------------------------------- float_msg(self_obj,cust_str(mstr(20),mstr(21)+"|"+mstr(22)+"|"+mstr(23),3),0); ------------------------------------- acklint.msg ------------------------------------- {20}{}{###, ###, ###?} {21}{}{Hello|Hi|Hey} {22}{}{pal|friend|man} {23}{}{how it goes|any news|wazzup} ------------------------------------- ��������: 3^3=27 ����. �� �� ���� ���� ������� ����, 4 ������ � msg. int+msg+���������: http://raventx.nm.ru/custstr.rar
|