scketch in scketch

The OP just wants to combine 2 sketches so that action in the first sketch code causes the incorporated second sketch code to execute.