Introduction to Programming

Mark Hildreth

Where is programming used?

What do Programs Look Like?

private void RunWithLink(DBLink link)
{
	var view = CompositeView.Build(link, "AR0024");

	string usageString = "ConnectWise used this Customer in the following transactions:n{0}";
	usageString = String.Format(usageString, this.customerUsage.Format("n", "* {0}"));

	// Check for spaces now. If I try it in the Filter below, an error will be raised.
	if (this.customerUsage.Item.Contains(" "))
	{
		var msg = "The Customer XRef '{0}' is invalid for Sage 300: Customer XRef cannot contain spaces. ";
		msg = String.Format(msg, this.customerUsage.Item);
		throw new ValidationException(msg + usageString);
	}

	var custView = view["AR0024"];
	int count = custView.FilterCount(String.Format("IDCUST={0}", this.customerUsage.Item), 0);
	if (count != 1)
	{
		var msg = "The customer '{0}' has an invoice to be transferred, but was not found in your Sage 300 system. ";
		msg = String.Format(msg, this.customerUsage.Item);
		throw new ValidationException(msg + usageString);
	}
}
		
		

Programming Languages

The Peanut Butter and Jelly Experiment

The Peanut Butter and Jelly Experiment (My Results)

Elements in Computer Programs

Variables

C#
		int age = 26;
		string name = "Mark";
		
Python
		age = 26
		name = "Mark"
		

Elements in Computer Programs

Branches

Elements in Computer Programs

Loops

Elements in Computer Programs

Functions

Elements in Computer Programs

Libraries/APIs

Programming Exercises