| **Navigation:**  [[clarion.htm|Clarion.Net (Clarion#)]] > [[clarion net language reference.htm|Clarion# Language Extensions]] > Clarion.NET FAQs > Language >====== Notes on Zero-based Arrays ====== | [[handling unmanaged code with clarion .htm|{{btn_prev_n.gif|Previous page}}]][[clarion net language reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[adding a web usercontrol to your asp net projects.htm|{{btn_next_n.gif|Next page}}]] | | || Common STRING functions, when used with the Clarion# language, now uses zero-based arrays where applicable. Here is some example code that illustrates this behavior: **Example:** | **ns    STRING** | | **cs    CLASTRING(26)** | | **array BYTE,DIM(10,12)  !first dimension is 10 elements** | | | | **  CODE** | | **  ns = 'abcdefghijklmnopqrstuvwxyz'** | | **  cs = ns** | | | | ** ! all of the following are expected, at position zero is the first character** | | **  i# = 0** | | **  SUB(ns,i#,1)  !returns 'a'** | | **  SUB(cs,i#,1)  !returns 'a'** | | **  ns[i#]        !returns 'a' (slice)** | | **  cs[i#]        !returns 'a' (slice)** | | | | **  !the dimension starts at zero** | | **  MAXIMUM(array,0)       ! so this returns 10 (zero is first dimension)** | | | | ** ! but these functions return one (1) as the first "STEP"** | | ** INSTRING('a',ns,1,0)    ! we start search at 0 position and it returns STEP 1** | | ** INLIST('a','a','b','c') ! returns 1** | Note that the behavior shown above is consistent. The arrays are all zero based, but the "step number" starts at 1. Stated another way, you can't have a zero step.