All pastes #886406 Raw Edit

Mine

public text v1 · immutable
#886406 ·published 2008-01-31 17:28 UTC
rendered paste body
	function displayCode() {
		$code = $this->memory->getVar('code');
		$codetodisplay = $this->memory->getVar('codetodisplay');
		$nbligne = count($code);
		for ($i=0;$i<$nbligne;$i++){
			$row = new TTableRow;
			// on affecte comme ID à la ligne le numéro de ligne qu'elle à dans le code
			$row->setID("L".$i);
			$cella = new TTableCell;
			$cellg = new TTableCell; // # de ligne
			$cellb = new TTableCell; // Etiquette
			$cellc = new TTableCell; // INST
			$celld = new TTableCell; // OP1
			$celle = new TTableCell; // OP2
			$cellf = new TTableCell; // OP3
			$cellh = new TTableCell; // Comment
	
			// Affectation des valeurs de texte aux cellules a et b.
			if ($i == 0) {
				$cella->setText("&nbsp;-");
			} else {
				$cella->setText("&nbsp;");
			}
			$cella->setWrap(true);
			$cellg->setText($i);			  $cellg->setWrap(true);
			$cellb->setText($code[$i]['eti']);$cellb->setWrap(true);
			$cellc->setText($code[$i]['inst']);$cellc->setWrap(true);
			$celld->setText($codetodisplay[$i]['op1']);$celld->setWrap(true);
			$celle->setText($codetodisplay[$i]['op2']);$celle->setWrap(true);
			$cellf->setText($codetodisplay[$i]['op3']);$cellf->setWrap(true);
			$cellh->setText($codetodisplay[$i]['comment']);$cellh->setWrap(true);
			// Affectation des cellules ‡ la ligne en cours
			$row->addParsedObject($cella);
			$row->addParsedObject($cellg);
			$row->addParsedObject($cellb);
			$row->addParsedObject($cellc);
			$row->addParsedObject($celld);
			$row->addParsedObject($celle);
			$row->addParsedObject($cellf);
			$row->addParsedObject($cellh);
			// Affectation de la ligne dans le tableaux de script
			$this->parent->Script->addParsedObject($row);
		}
	}


	function colorLine(){
		$line = "L".$this->memory->getVar('CO');
		$this->memory->appendVar("Comment","line :".$line);
		$this->parent->Script->{$line}->setBackColor("green");
	}