Howto:Start using vectors and hashes in Nasal: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 70: Line 70:
  print( waypoints[3] ); # print wp4
  print( waypoints[3] ); # print wp4
  print( waypoints[4] ); # print wp5
  print( waypoints[4] ); # print wp5
</syntaxhighlight>
waypoints being a vector, we can use a foreach loop to process each element easily:
<syntaxhighlight lang="php">
var waypoints = ["wp1","wp2","wp3","wp4","wp5"];
foreach(var wpt; waypoints)
print(wpt);
</syntaxhighlight>
</syntaxhighlight>


Navigation menu