Difference between revisions of "MC-Basic:STRL$"

From SoftMC-Wiki
Jump to: navigation, search
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{Languages|MC-Basic:STRL$}}
 
{{MC-Basic
 
{{MC-Basic
 
|SHORT FORM=
 
|SHORT FORM=
Line 4: Line 5:
  
 
|SYNTAX=
 
|SYNTAX=
STRL$(''<number>'', ''<format_string>'')
+
STRL$(<''number''>, <''format_string''>)
  
 
|AVAILABILITY=
 
|AVAILABILITY=
Line 12: Line 13:
  
 
|TYPE=
 
|TYPE=
''<return value>'': String<br>
+
<''return value''>: String<br>
''<number>'': Long, Double (implicitly converted to Long)<br>
+
<''number''>: Long, Double<br>
''<format_string>'': String<br>
+
<''format_string''>: String<br>
 +
 
 +
{{Note/Important|
 +
A double-type input is implicitly converted to long
 +
}}
  
 
|RANGE=
 
|RANGE=
''<number>'': MinLong to MaxLong<br>
+
<''number''>: MinLong to MaxLong<br>
''<format_string>'': a valid sprintf() integer format - %d, %i, %u, %o, %x, %X, %c
+
<''format_string''>: a valid sprintf() integer format  
 
 
 
<pre>
 
<pre>
 
%d, %i - signed decimal
 
%d, %i - signed decimal
Line 27: Line 31:
 
%c - unsigned char
 
%c - unsigned char
 
</pre>
 
</pre>
 +
 +
{{Note/Warning| '''If an invalid format string is used, the behavior is undefined'''}}
  
 
|UNITS=
 
|UNITS=
Line 42: Line 48:
 
|EXAMPLE=
 
|EXAMPLE=
 
-->PRINT STRL$(60, "%d")<br>
 
-->PRINT STRL$(60, "%d")<br>
60 (singned decimal)<br>
+
60 <br>
 
-->PRINT STRL$(60,"%o")<br>
 
-->PRINT STRL$(60,"%o")<br>
74 (unsigned octal)<br>
+
74 <br>
 
-->PRINT STRL$(60,"%x")<br>
 
-->PRINT STRL$(60,"%x")<br>
3c (unsigned hexadecimal)<br>
+
3c <br>
 
-->PRINT STRL$(60,"%c")<br>
 
-->PRINT STRL$(60,"%c")<br>
< (unsigned char)
+
<  
 
 
 
|SEE ALSO=
 
|SEE ALSO=
* [[Axystems:MC-Basic:VAL|VAL]]
+
* [[MC-Basic:VAL|VAL]]
* [[Axystems:MC-Basic:STR$|STR$]]
+
* [[MC-Basic:STR$|STR$]]
* [[Axystems:MC-Basic:STRD$|STRD$]]
+
* [[MC-Basic:STRD$|STRD$]]
* [[Axystems:MC-Basic:HEX$|HEX$]]
+
* [[MC-Basic:HEX$|HEX$]]
* [[Axystems:MC-Basic:CHR$|CHR$]]
+
* [[MC-Basic:CHR$|CHR$]]
  
  
[[Category:Axystems:MC-Basic:String_Manipulation|STRL$]]
+
[[Category:MC-Basic:String Manipulation|STRL$]]
 
}}
 
}}

Latest revision as of 08:40, 28 April 2017

Language: English  • 中文(简体)‎

STRL$ returns the string representation of long-type number.

Syntax

STRL$(<number>, <format_string>)

Type

<return value>: String
<number>: Long, Double
<format_string>: String

IMPORTANT.svgIMPORTANT

A double-type input is implicitly converted to long

Range

<number>: MinLong to MaxLong
<format_string>: a valid sprintf() integer format

%d, %i - signed decimal
%u - unsigned decimal
%o - octal
%x, %X - hexadecimal 
%c - unsigned char
WARNING.svgWARNING
If an invalid format string is used, the behavior is undefined

Scope

Configuration, Task or Terminal

Limitations

Read only

Examples

-->PRINT STRL$(60, "%d")
60
-->PRINT STRL$(60,"%o")
74
-->PRINT STRL$(60,"%x")
3c
-->PRINT STRL$(60,"%c")
<

See Also