software development

3GL languages such as C, Pascal, VB etc have six basic elements




			VBA			C



data variables		dim x as double		double x;	// values such as 1.82




variable assignments	x = 20			x = 20;




if statements		if x > 10 then		if (x > 10)
						{

			endif			}




loops			while x > 0		while (x > 0)

			for i = 1 to 100	for (i=0; i < 100; i++)




functions		function y()		function y()
						{
				y = 5			return (5);
				
			end function		}

	


built-in functions 	x = sqrt( 10 )		x = sqrt( 10 )
      and operators





Other notes

	pointers, etc.






example



	// distance between two locations


function dist( x1, y1, x2, y2 )

	x = x1 - x2

	y = y1 - y2

	dist = sqr( x*x + y*y )		// sqr - square root function	

	print dist

end function