# \$1: Loop Index of an Inline-loop-expression

### \$1 is the current inline-loop index used in 1 statement sums or other matrix operations, or string ops like palindrome check.

• An inline-loop allows concise and efficient easy-to-read code
• The global variable \$1 is the current InlineLoop index:
• result = operator( F(arrays(\$1, \$, \$R, \$C) )
• \$1 start value in a loop is 1 (as for all \$-variables)
• The loop terminates when F(...) is out of limits
 Sample Arrays REAL :: V(3), W(3), A(3,3), B(3,3), C(3,3) The same result but more code implicit_index 1.. LEN(V) sum = + ( V ) sum = 0 DO i = 1, 3 sum = sum + V3(i) ENDDO matrix_product W is the same as W( \$) W = +( A( \$ ,\$1) * V(\$1) ) \$1 is the +(...) loop index DO i = 1, 3 W(i) = A(i,1)*V(1) + A(i,2)*V(2) + A(i,3)*V(3) ENDDO matrix_times_matrix C and C( \$R, \$C) is the same C = +( A( \$R,\$1) * B(\$1, \$C) DO i = 1, 3 DO j = 1, 3 C(i,j) = 0 DO k = 1,3 C(i,j) = C(i,j) + A(i,k)*B(k,j) ENDDO ENDDO ENDDO Note: C = A*B is the element by element multiplication
 text_inline_loop CHARACTER string="step on no pets" L = LEN(string) Palindrome= ==( string(1:L) == string(L:1) ) string(1:L) == string(L:1) checks equality of left and right character. "=="(..) is the loop operator for equality of all loop results Palindrome is set to 1 because string(left to right) == string(right to left) ":" is the from_to_operator file_section_inline_loop inline-loop file indexing

Support HicEst   ⇾ Impressum