<!DOCTYPE html>
<html lang="en-US">	

<head>
<meta charset="utf-8"/>
<title>B4P Reference</title>
<link rel="stylesheet" href="styles.css">
</head>


<div class="wrapper">

<div class="logo">
<a href="index.html">
<img src="Images/B4P_Logo.png" alt="B4P">
</a>
</div>

<div class="header">
<h3>Simple Table Access</h3>
<a accesskey="p" href="LAN_Features_accessing_tables.html"><span>Prev</span></a> <a accesskey="n" href="LAN_Features_horizontal_table_access.html"><span>Next</span></a> 
</div>

<section>
	<div class="nav">
<div class="booktitle_field"><a style="color:white;" href="LAN_Features_Language_Guide.html">Language Guide</a></div>
<ul>
<li class="navi"><a href="LAN_Features_Table_of_Contents.html"><div class="navi"> Table of Contents </div></a></li>
<li class="navi"><a href="LAN_Features_Language_Guide.html"><div class="navi">+  The Language </div></a></li>
<li class="navi"><a href="LAN_Features_Variable.html"><div class="navi">+  Variables </div></a></li>
<li class="navi"><a href="LAN_Features_tables.html"><div class="navi"+>-  Tables </div></a></li>
<li class="navi"><ul>
<li class="navi"><a href="LAN_Features_Tables_-_Example_used_in_the_Following_Sections.html"><div class="navi">    Tables - Example File </div></a></li>
<li class="navi"><a href="LAN_Features_Table_names.html"><div class="navi">    Tables - Naming Rules </div></a></li>
<li class="navi"><a href="LAN_Features_Table_properties.html"><div class="navi">    Table Properties </div></a></li>
<li class="navi"><a href="LAN_Features_Creating_tables.html"><div class="navi">    Creating Tables </div></a></li>
<li class="navi"><a href="LAN_Features_accessing_tables.html"><div class="navi"+>-  Accessing Tables </div></a></li>
<li class="navi"><ul>
<li class="navi"><a href="LAN_Features_simple_table_access.html"><div class="navi navi-selected">    Simple Table Access </div></a></li>
<li class="navi"><a href="LAN_Features_horizontal_table_access.html"><div class="navi">+  Horizontal Table Access </div></a></li>
<li class="navi"><a href="LAN_Features_vertical_table_access.html"><div class="navi">+  Vertical Table Access </div></a></li>
<li class="navi"><a href="LAN_Features_matrix_table_access.html"><div class="navi">    Matrix Table Access </div></a></li>
<li class="navi"><a href="LAN_Features_partial_table_specifications.html"><div class="navi">    Partial Table Specifications </div></a></li>
<li class="navi"><a href="LAN_Features_nested_partial_table_specification.html"><div class="navi">    Nested Partial Table Specifications </div></a></li>
<li class="navi"><a href="LAN_Features_shifted_table_column_specification.html"><div class="navi">    Shifted Table Column Specifications </div></a></li>
<li class="navi"><a href="LAN_Features_header_name_exception_handling.html"><div class="navi">    Header Name Exception Handling </div></a></li>
<li class="navi"><a href="LAN_Features_lookup_access_exception_handling.html"><div class="navi">    Lookup Access Exception Handling </div></a></li>
</ul></li>
<li class="navi"><a href="LAN_Features_memory_effect.html"><div class="navi">    Header Names - Memory Effect </div></a></li>
</ul></li>
<li class="navi"><a href="LAN_Features_Assignments_and_expressions.html"><div class="navi">+  Assignments and Expressions </div></a></li>
<li class="navi"><a href="LAN_Features_Transactions.html"><div class="navi">+  Transactions </div></a></li>
<li class="navi"><a href="LAN_Features_Functions_and_Procedures.html"><div class="navi">+  Functions and Procedures </div></a></li>
<li class="navi"><div>  </div></li>
<li class="navi"><div> <br><br><hr> </div></li>
<li class="navi"><a href="GUI_Features_User_Guide.html"><div class="navi"> User Guide </div></a></li>
<li class="navi"><a href="TAB_Features_Processing_Tables_and_Big_Data.html"><div class="navi"> Table Processing </div></a></li>
<li class="navi"><a href="LIB_Features_Function_Library.html"><div class="navi"> Function Library </div></a></li>
<li class="navi"><div> <br><hr> </div></li>
<li class="navi"><a href="LAN_Features_Index.html"><div class="navi"> Index </div></a></li>
</ul>
	</div>

	<div class="article">
<h4> Introduction</h4>
<p>
The <b>simple table access</b> is one of the four basic <a class="bold_text" href="LAN_Features_accessing_tables.html">table access methods</a> where this one accesses exactly one cell in the table.
</p>
<h4> Syntax for Full Table Specification</h4>
<p>
The table must be referenced inside brackets using a combination of strings and/or numerals.  These may be constant strings and numbers
or expressions providing strings and numerals.  <a class="bold_text" href="LAN_Features_negative_indexing.html">Negative indexing</a> is supported for both rows and columns.

</p><table class="noframe table_syntax" style = "width:730px"><col style = "width:10px"><col style = "width:230px"><col style = "width:10px"><col style = "width:230px"><col style = "width:10px"><col style = "width:230px"><col style = "width:10px">
<tr><th>[       </th><th> Table Name                    </th><th> :     </th><th> Simple Column Specifier       </th><th> ,     </th><th> Simple Row Specifier                  </th><th> ]</th></tr>
<tr><td></td><td> Must be a string              </td><td>       </td><td> - Header name, or             </td><td>       </td><td> - Matching contents (string), or      </td><td></td></tr>
<tr><td></td><td>                               </td><td>       </td><td> - Positive column number, or  </td><td>       </td><td> - Positive row number, or             </td><td></td></tr>
<tr><td></td><td>                               </td><td>       </td><td> - Negative column number      </td><td>       </td><td> - Negative row number                 </td><td></td></tr>
</table><p>

<br>Syntax for lookup access (Choose column, followed by the row, and pick up data from a different column):
</p><table class="noframe table_syntax" style = "width:970px"><col style = "width:10px"><col style = "width:230px"><col style = "width:10px"><col style = "width:230px"><col style = "width:10px"><col style = "width:230px"><col style = "width:10px"><col style = "width:230px"><col style = "width:10px">
<tr><th>[       </th><th> Table Name                    </th><th> :     </th><th> Simple Column Specifier       </th><th> ,     </th><th> Simple Row Specifier                  </th><th> ,     </th><th>  Simple Column Specifier 2            </th><th> ]</th></tr>
<tr><td></td><td> Must be a string              </td><td>       </td><td> - Header name, or             </td><td>       </td><td> - Matching contents (string), or      </td><td>       </td><td> - Header name, or                     </td><td></td></tr>
<tr><td></td><td>                               </td><td>       </td><td> - Positive column number, or  </td><td>       </td><td> - Positive row number, or             </td><td>       </td><td> - Positive row number, or             </td><td></td></tr>
<tr><td></td><td>                               </td><td>       </td><td> - Negative column number      </td><td>       </td><td> - Negative row number                 </td><td>       </td><td> - Negative row number                 </td><td></td></tr>
</table><p>

</p>
<h4> Principle</h4>
<p>
<br/><img src="Images/Description_Table_Simple_Access_Full.jpg" alt="Simple table access, full table specification"><br/>
</p>
<h5> Programming examples</h5>
<div class="code_background_color" ><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table load( table, "Examples&#92;Cities.csv");<br/>
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo( [ table:&nbsp;&nbsp;1,&nbsp;&nbsp;&nbsp;&nbsp;5 ] );<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo( [ table: -7, -10 ] );<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo( [ table:&nbsp;&nbsp;1, -10 ] );<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo( [ table: -7,&nbsp;&nbsp;&nbsp;&nbsp;5 ], new line );<br/>
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo( [ table: City,&nbsp;&nbsp;&nbsp;&nbsp;5 ] );<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo( [ table: City, -10 ], new line );<br/>
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo( [ table: City, San Francisco] ); // Exception to rule: Returns row numbers<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo( [ table: 1, San Francisco] );<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo( [ table: -7, San Francisco], new line );<br/>
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo( [ table: City, San Francisco, Famous attraction] );<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo( [ table: 1, 5, 4] );<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo( [ table: -7, -10, -4] );</code></div>
<h5> Output - Consider travelling</h5>
<div class="output_background_color" ><code>San Francisco<br>San Francisco<br>San Francisco<br>San Francisco<br><br>San Francisco<br>San Francisco<br><br>5<br>5<br>5<br><br>Golden Gate<br>Golden Gate<br>Golden Gate<br></code></div><u>Try it yourself:</u> Open <b>LAN_Features_simple_table_access.b4p</b> in <a class="bold_text" href="B4P_Examples.zip">B4P_Examples.zip</a>. Decompress before use.
<h4> Rules on Column Header Names</h4>
<p>You have full freedom to specify the header names as you wish.  Some rules need to be followed:
</p><ul class="bullets"><li class="bullets">If the header name contains 1 or more words and optionally single spaces inbetween, and they contain no special symbol which could be interpreted by           B4P otherwise (e.g. hypen as minus sign), then the name can be used without quotation marks.
</li><li class="bullets">If you want to refer a header name which is a number (e.g. 1, 24.12, etc.), then make sure to provided these numbers as strings, e.g. with quotation           marks or using the <a class="bold_text" href="LIB_Function_str.html">str</a>() function to convert numeric results to strings.</li></ul><p></p>
	</div>
</section>

<div class="footer">
Copyright (C) 2007 - 2024 Georg A. zur Bonsen, All Rights Reserved
</div>

</div>

</html>