Difference between revisions of "Manuals/calci/MID"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div id="6SpaceContent" class="zcontent" align="left"> <font color="#484848"><font face="Arial, sans-serif"><font size="2">'''MID'''</font></font></font><font color="#48484...")
 
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<div id="6SpaceContent" class="zcontent" align="left">
+
<div style="font-size:30px">'''MID (Text,Start_Char,Num_Char)'''</div><br/>
 +
where,
 +
*<math>Text</math> is a text string containing the characters to be extracted,
 +
*<math>Start-Char</math> is the starting position of the first character to be extracted, and
 +
*<math>Num-Char</math> represents the number of characters to be displayed.
 +
**MID(), returns a specific number of characters from a text string starting at the position you specify.
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''MID'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">(</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''txt'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''snum'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''noc'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">)</font></font></font>
+
== Description ==
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">where t</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''xt '''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">is the text string containing the characters that want to extract and s</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''num'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is the position of the first character that want to extract in text and </font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''noc is '''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">the number of characters.</font></font></font>
+
MID (Text,Start_Char,Num_Char)
 +
e.g. MID("String",1,3) displays '''Str''' as a result.
 +
*MID counts 1 byte per characters. MID works with the languages that use 'Single Byte Character Set' (SBCS).
 +
*If argument <math>Text</math> is directly entered in the command, it should be enclosed in double quotes (e.g. "Name").
 +
*<math>Start-Char</math> should be &gt;= 1, else Calci displays #N/A error message.
 +
*If <math>Start-Char</math> &gt; 'length of text', Calci displays empty text ("").
 +
*If <math>Start-Char</math> + <math>Num-Char</math> &gt; 'length of text', Calci displays the characters up to the end of text.
 +
*If <math>Num-Char</math> is negative, Calci displays #N/A error message.
  
</div>
+
== Examples ==
----
 
<div id="1SpaceContent" class="zcontent" align="left">
 
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">MID calculates a specific number of characters from a text string, starting at the position that specify, based on the number of characters that specify.</font></font></font>
+
<div id="2SpaceContent" class="zcontent" align="left">
  
<font color="#484848" face="Arial"></font>
+
{| id="TABLE3" class="SpreadSheet blue"
 +
|- class="even"
 +
| class="sshl_f" |WelCome
 +
| class=" " |
 +
| class=" " |
  
<font color="#ff0000"><font face="Arial, sans-serif"><font size="2">'''Note'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">  MID works with languages that use the single-byte character set (SBCS),</font></font></font>
+
|- class="odd"
 +
| class="sshl_f" |Apple Orange
 +
| class=" " |
 +
| class=" " |
  
</div>
+
|- class="even"
----
+
| class="sshl_f" |*123*123
<div id="7SpaceContent" class="zcontent" align="left">
+
| class=" " |
 +
| class=" " |
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">When snum is greater than the length of text, MID displays 0.</font></font></font>
+
|- class="odd"
 +
| class="sshl_f" |
 +
| class=" " |
 +
| class=" " |
 +
|}
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">MID displays 0 ,when snum is less than the length of text, but snum plus noc exceeds the length of text.</font></font></font>
+
=MID(A1,1,3) : Displays 3 character string in cell A1 starting from 5th position. <br />Displays '''Wel''' as the output.
 +
=MID(A2,7,14) : Displays 14 characters in cell A2 starting from 7th position. <br />Displays '''Orange''' as the output.
 +
=MID(A3,1,1) : Displays  character string in cell A3 starting from 1st position. <br />Displays '''*''' as the output.
 +
=MID("good" & "morning",1,8) : Joins the two strings and returns 8 characters starting from 1st position. <br />Displays '''goodmorn''' as the output.
 +
 +
==Related Videos==
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">MID displays 0 when snum is less than 1.</font></font></font>
+
{{#ev:youtube|6uxeKVfA8JQ|280|center|MID}}
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">When noc is negative, MID displays 0.</font></font></font>
+
== See Also ==
  
</div>
+
*[[Manuals/calci/MIDB | MIDB]]
----
 
<div id="12SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="left">
 
  
MID
+
== References ==
  
</div></div>
+
*[http://en.wikipedia.org/wiki/String_(computer_science) String]
----
 
<div id="8SpaceContent" class="zcontent" align="left">
 
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">let’s see an example in (Column1 Row 1)</font></font></font>
 
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">Column1Row1 = Thermal Energy</font></font></font>
 
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2"><nowiki>=MID(C1R1,9,14) is Energy</nowiki></font></font></font>
+
*[[Z_API_Functions | List of Main Z Functions]]
 
 
[javascript:ToggleDiv('divExpCollAsst_4') <font color="#666666"><font face="Arial, sans-serif"><font size="2">///rly =MID(C1R1,2,4) is her</font></font></font>]
 
 
 
</div>
 
----
 
<div id="10SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Syntax </div><div class="ZEditBox"><center></center></div></div>
 
----
 
<div id="4SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Remarks </div></div>
 
----
 
<div id="3SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Examples </div></div>
 
----
 
<div id="11SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Description </div></div>
 
----
 
<div id="2SpaceContent" class="zcontent" align="left">
 
 
 
{| id="TABLE3" class="SpreadSheet blue"
 
|- class="even"
 
| class=" " |
 
| Column1
 
| class="  " | Column2
 
| Column3
 
| Column4
 
|- class="odd"
 
| class=" " | Row1
 
| class=" " | Thermal Energy
 
| class="sshl_f" | Energy
 
| class="sshl_f" | her
 
| class="                                                            sshl_f  " |
 
|- class="even"
 
| class="  " | Row2
 
| class="sshl_f  " | 0
 
|
 
| class=" SelectTD SelectTD" |
 
<div id="2Space_Handle" title="Click and Drag to resize CALCI Column/Row/Cell. It is EZ!"></div><div id="2Space_Copy" title="Click and Drag over to AutoFill other cells."></div>
 
|
 
|- class="odd"
 
| Row3
 
| class="                                      sshl_f  " |
 
|
 
|
 
|
 
|- class="even"
 
| Row4
 
|
 
|
 
|
 
| class="  " |
 
|- class="odd"
 
| class=" " | Row5
 
|
 
|
 
|
 
|
 
|- class="even"
 
| Row6
 
|
 
|
 
|
 
|
 
|}
 
  
<div align="left">[[Image:calci1.gif]]</div></div>
+
*[[ Z3 |  Z3 home ]]
----
 

Latest revision as of 16:18, 13 August 2018

MID (Text,Start_Char,Num_Char)


where,

  • is a text string containing the characters to be extracted,
  • is the starting position of the first character to be extracted, and
  • represents the number of characters to be displayed.
    • MID(), returns a specific number of characters from a text string starting at the position you specify.

Description

MID (Text,Start_Char,Num_Char) e.g. MID("String",1,3) displays Str as a result.

  • MID counts 1 byte per characters. MID works with the languages that use 'Single Byte Character Set' (SBCS).
  • If argument is directly entered in the command, it should be enclosed in double quotes (e.g. "Name").
  • should be >= 1, else Calci displays #N/A error message.
  • If > 'length of text', Calci displays empty text ("").
  • If + > 'length of text', Calci displays the characters up to the end of text.
  • If is negative, Calci displays #N/A error message.

Examples

WelCome
Apple Orange
*123*123
=MID(A1,1,3) : Displays 3 character string in cell A1 starting from 5th position. 
Displays Wel as the output. =MID(A2,7,14) : Displays 14 characters in cell A2 starting from 7th position.
Displays Orange as the output. =MID(A3,1,1) : Displays character string in cell A3 starting from 1st position.
Displays * as the output. =MID("good" & "morning",1,8) : Joins the two strings and returns 8 characters starting from 1st position.
Displays goodmorn as the output.

Related Videos

MID

See Also

References