This is part of the HicEst documentation

$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.

⇒Home ⇒Contents ⇒more Programming

Bookmarks:


  ⇒file_section_inline_loop   ⇒implicit_index   ⇒matrix_product   ⇒matrix_times_matrix   ⇒text_inline_loop
Sample Arrays
  • REAL :: V(3), W(3), A(3,3), B(3,3), C(3,3)
The same result but more code
1.. LEN(V)
  • sum = + ( V )
  • sum = 0
  • DO i = 1, 3
  • sum = sum + V3(i)
  • ENDDO

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

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
  • 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
inline-loop file indexing



Support HicEst   ⇒ Impressum
©2000-2016 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.