22.01.2015 Views

HDevelop User's Manual

HDevelop User's Manual

HDevelop User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

72 CHAPTER 3. LANGUAGE<br />

In no case does a nonexistent or insufficient field width cause truncation of a field; if the<br />

result of a conversion is wider than the field width, the field is simply expanded to contain<br />

the conversion result.<br />

Examples for the string conversion can be found in the program ×ØÖÒºÚ.<br />

The string concatenation (·) can be applied in combination with strings or all numerical types;<br />

if necessary, the operands are first transformed into strings (according to their standard representation).<br />

At least one of the operands has to be already a string so that the operator can act<br />

as a string concatenator. In the following example a filename (e.g., ³ÆѺس) is generated.<br />

For this purpose two string constants (³Æѳ and ³ºØ³) and an integer value (the<br />

loop-index ) are concatenated:<br />

ÓÖ ½ ØÓ Ý ½<br />

ÖÑ ´Ð¸ ³Æѳ··³ºØ³µ<br />

ÒÓÖ<br />

×ØÖ´ÖµÖ´×½¸×¾µ returns the index of the first (last) as a tuple occurrence of one character in<br />

×¾ in string ×½, or¹½ if none of the characters occurs in the string.<br />

×ØÖ´Öµ×ØÖ´×½¸×¾µ returns the index of the first (last) occurrence of string s2 in string s1, or<br />

¹½ if s2 does not occur in the string.<br />

×ØÖÐÒ´×µ returns the number of characters in ×.<br />

× returns the character at index position in ×. The index ranges from zero to the length of<br />

the string minus 1. The result of the operator is a string of length one.<br />

×½¾ returns all characters from index position ½ up to position ¾ in × as a string. The<br />

index ranges from zero to the length of the string minus 1.<br />

×ÔÐØ´×½¸×¾µ devides the string ×½ into single substrings. The string is split at those positions<br />

where it contains a character from ×¾. As an example the result of<br />

×ÔÐØ´³»Ù×ֻѻÙ×Ö»ÔÖӻѳ¸³³µ<br />

consists of the two strings<br />

³»Ù×ֻѳ¸³»Ù×Ö»ÔÖӻѳ℄<br />

3.5.8 Comparison Operators<br />

In <strong>HDevelop</strong>, the comparison operators are defined not only on atomic values, but also on tuples<br />

with an arbitrary number of elements. They always return values of type ÓÓÐÒ. Table 3.12<br />

shows all comparison operators.<br />

Ø Ø and Ø Ø are defined on all types. Two tuples are equal (ØÖÙ), if they have the same<br />

length and all the data items on each index position are equal. If the operands have different<br />

types (ÒØÖ and ÖÐ), the integer values are first transformed into ÖÐ numbers. Values<br />

<strong>HDevelop</strong> / 2000-11-16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!