//---------------------------------------------------------------------------
AnsiString __fastcall TBolBradesco::GetAgenciaCedente(void)
{
    AnsiString AG = Agencia;
    AG.Insert("-",5);
    AnsiString CC = CodigoCedente;
    CC.Insert("-",8);
    return(AG + "/" + CC);
}
//---------------------------------------------------------------------------
AnsiString __fastcall TBolBB::GetAgenciaCedente(void)
{
  AnsiString RAgencia = Agencia;
  RAgencia.Insert("-",Agencia.Length());

  AnsiString RConta = ContaCorrente;
  RConta.Insert("-",ContaCorrente.Length());

  return(RAgencia+"/"+RConta);
};
//---------------------------------------------------------------------------
AnsiString __fastcall TBolBradesco::GetCodigoDeBarra(void)
{
    AnsiString CodigoBarra = CodigoBanco + CodigoMoeda + FatorVencimento + ValorBoleto + GeraCampoLivre();
    AnsiString DV = CalculaModulo11(CodigoBarra);
    CodigoBarra.Insert(DV,5);
    return(CodigoBarra);
}
Example #4
0
void TfrmText::InsertTextCP(const AnsiString& line, bool bCommas)
{
	AnsiString txt = (bCommas)?AnsiString("\"")+line+AnsiString("\""):line;
	if (!txt.IsEmpty()){
    	AnsiString h 	= mmText->Lines->Strings[mmText->CaretPos.y];
        h.Insert		(txt,mmText->CaretPos.x+1);
        mmText->Lines->Strings[mmText->CaretPos.y] = h;
    }
}
Example #5
0
//---------------------------------------------------------------------------
/// Metoda odpowiedzialna za dostosowanie znaków specjalnych w tekœcie (apostrofy itp.),
/// poprzez dodanie dodanie "\"
void __fastcall ParsujDane::DostosujZnakiSpecjalne(AnsiString &AText)
{
	AnsiString str;
	int pozycjaZnacznik = 0;

	while(pozycjaZnacznik != AText.Length())
	{
		str = AText[pozycjaZnacznik];
		if (str == "\'" || str == "\"") AText.Insert("\\", pozycjaZnacznik - 1);
		pozycjaZnacznik++;
	}
}
Example #6
0
bool CFolderHelper::MakeFullName(TElTreeItem* begin_item, TElTreeItem* end_item, AnsiString& name)
{
	if (begin_item){
    	TElTreeItem* node = begin_item;
        name = node->Text;
		node = node->Parent;
        while (node){
			name.Insert(node->Text+AnsiString('\\'),0);
        	if (node==end_item) break;
            node=node->Parent;
        }
        return true;
    }else{
		name = "";
        return false;
    }
}
Example #7
0
//---------------------------------------------------------------------------
/// Metoda odpowiedzialna za usunieciê przekazanych znaczników z przekazanego tekstu,
/// metoda umo¿liwia umieszczenie znacznika konca lini w zamian za przyjmowany znacznik
void __fastcall ParsujDane::UsunZnacznik(AnsiString &AText, AnsiString AZnacznik, bool AWstawENDL)
{
	int pozycjaZnacznik, i;
	i = 0;
	while (true)
	{
		pozycjaZnacznik = AText.Pos(AZnacznik);
		if (AZnacznik == ' ')
		{
			if (AText.Pos(' ') > 1) break;
		}
		if (pozycjaZnacznik > 0) AText.Delete(pozycjaZnacznik, AZnacznik.Length());
		if (pozycjaZnacznik > 0 && AWstawENDL) AText.Insert("<ENDL>",pozycjaZnacznik);
		if (pozycjaZnacznik == 0) break;
	}
	AText.TrimLeft(); AText.TrimRight();
}
//---------------------------------------------------------------------------
AnsiString __fastcall TBolItau::GetCodigoDeBarra(void)
{
  GetNossoNumero();
  AnsiString Codigo = CodigoBanco +
                   CodigoMoeda +
                   FatorVencimento +
                   ValorBoleto +
                   Carteira +
                   NossoNumero + DVNossoNumero+
                   Agencia +
                   ContaCorrente +
                   CalculaModulo10(Agencia+ContaCorrente) +
                   "000";
  DVCodBarras = CalculaModulo11(Codigo);
  Codigo = Codigo.Insert(DVCodBarras,5);

  ValidaCodigoDeBarra(Codigo);
  return(Codigo);
}
Example #9
0
// собирает имя от стартового итема до конечного
// может включать либо не включать имя объекта
bool CFolderHelper::MakeName(TElTreeItem* begin_item, TElTreeItem* end_item, AnsiString& name, bool bOnlyFolder)
{
    name = "";
	if (begin_item){
    	TElTreeItem* node = (u32(begin_item->Data)==TYPE_OBJECT)?begin_item->Parent:begin_item;
        while (node){
			name.Insert(node->Text+AnsiString('\\'),0);
        	if (node==end_item) break;
            node=node->Parent;
        }
        if (!bOnlyFolder){
        	if (u32(begin_item->Data)==TYPE_OBJECT) name+=begin_item->Text;
            else return false;
        }
        return true;
    }else{
        return false;
    }
}
Example #10
0
/*
 =======================================================================================================================
 =======================================================================================================================
 */
void __fastcall TSCFormasCompactas::Button1Click(TObject *Sender)
{
	/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
	extern vector<bool> ocultarNANDNOR;
	/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

	NANDyNOR->StringGrid->ColCount = Tabla.NumColumnas();
	NANDyNOR->ScrollBar1->Max = Tabla.NumColumnas();

	// metemos las cadenas en el StringGrid Este tratamiento es las funciones y las "X"
	for(int j = 0; j < Tabla.NumColumnas(); j++)
	{
		/*~~~~~~*/
		int i = 0;
		/*~~~~~~*/

		NANDyNOR->StringGrid->Cells[j][0] = "";
		NANDyNOR->StringGrid->Cells[j][1] = "";
		while(StringGrid1->Cells[j][i] != "")
		{
			NANDyNOR->StringGrid->Cells[j][0] = NANDyNOR->StringGrid->Cells[j][0] + StringGrid1->Cells[j][i];
			i = i + 1;
		}

		/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
		AnsiString	temp = NANDyNOR->StringGrid->Cells[j][0];
		/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

		temp.Delete(temp.Length(), 1);
		NANDyNOR->StringGrid->Cells[j][0] = temp;
		NANDyNOR->StringGrid->Cells[j][2] = temp;

		i = 0;
		while(StringGrid2->Cells[j][i] != "")
		{
			NANDyNOR->StringGrid->Cells[j][1] = NANDyNOR->StringGrid->Cells[j][1] + StringGrid2->Cells[j][i];
			i = i + 1;
		}

		temp = NANDyNOR->StringGrid->Cells[j][1];
		temp.Delete(temp.Length(), 1);
		NANDyNOR->StringGrid->Cells[j][1] = temp;
		NANDyNOR->StringGrid->Cells[j][3] = temp;
	}

 	ocultarNANDNOR.clear();

	/*~~~~~~~~~~~~~*/
	AnsiString	temp;
	/*~~~~~~~~~~~~~*/

	if(Disyuntivo->Checked == true)
	{
		// POS
		for(int j = 0; j < Tabla.NumColumnas(); j++)
		{
			temp = NANDyNOR->StringGrid->Cells[j][0];
			if(Trim(temp).AnsiPos("*"))
				ocultarNANDNOR.push_back(false);
			else
				ocultarNANDNOR.push_back(true);
			if(Trim(NANDyNOR->StringGrid->Cells[j][0]) != "")
			{
				// Estas llamadas son para NOR - funciones
				temp = NANDyNOR->StringGrid->Cells[j][0];
				temp = InvertirExpresiones(temp);
				temp = CambiarSignos(temp, true);
				temp.Insert("~(", 1);
				temp.Insert(")", temp.Length());
				NANDyNOR->StringGrid->Cells[j][2] = temp;

				// Hacemos el cambio a Expresion NAND - funciones
				temp = NANDyNOR->StringGrid->Cells[j][0];
				temp = InvertirVariables(temp);
				temp = InvertirExpresiones(temp);
				temp = CambiarSignos(temp, false);
				temp.Insert("~(~(", 1);
				temp.Insert(")", temp.Length());
				temp.Insert(")", temp.Length());
				NANDyNOR->StringGrid->Cells[j][0] = temp;

				// Ahora hay que escribirlo en su formulario
			}
			else
			{
				NANDyNOR->StringGrid->Cells[j][0] = "";
			}

			temp = NANDyNOR->StringGrid->Cells[j][1];
			if(Trim(NANDyNOR->StringGrid->Cells[j][1]) != "")
			{
				// Estas llamadas son para NOR - "X"
				temp = NANDyNOR->StringGrid->Cells[j][1];
				temp = InvertirExpresiones(temp);
				temp = CambiarSignos(temp, true);
				temp.Insert("~(", 1);
				temp.Insert(")", temp.Length());
				NANDyNOR->StringGrid->Cells[j][3] = temp;

				//
				// Ahora hay que escribirlo en su formulario
				// Hacemos el cambio a Espresion NAND - "X"
				//
				temp = NANDyNOR->StringGrid->Cells[j][1];
				temp = InvertirVariables(temp);
				temp = InvertirExpresiones(temp);
				temp = CambiarSignos(temp, false);
				temp.Insert("~(~(", 1);
				temp.Insert(")", temp.Length());
				temp.Insert(")", temp.Length());
				NANDyNOR->StringGrid->Cells[j][1] = temp;
			}
			else
			{
				NANDyNOR->StringGrid->Cells[j][1] = "";
			}
		}
	}
	else	// Ahora hacemos tratamiento de la expresion SOP
	{
		for(int j = 0; j < Tabla.NumColumnas(); j++)
		{
			temp = NANDyNOR->StringGrid->Cells[j][0];
 			if(Trim(temp).AnsiPos("+"))
				ocultarNANDNOR.push_back(false);
			else
				ocultarNANDNOR.push_back(true);
			if(Trim(NANDyNOR->StringGrid->Cells[j][0]) != "")
			{
				// Estas llamadas son para NOR - funciones
				temp = NANDyNOR->StringGrid->Cells[j][0];
				temp = InvertirVariables(temp);
				temp = InvertirExpresiones(temp);
				temp = CambiarSignos(temp, false);
				temp.Insert("~(~(", 1);
				temp.Insert(")", temp.Length());
				temp.Insert(")", temp.Length());
				NANDyNOR->StringGrid->Cells[j][2] = temp;

				//
				// Ahora hay que escribirlo en su formulario
				// Hacemos el cambio a Espresion NAND - funciones
				//
				temp = NANDyNOR->StringGrid->Cells[j][0];
				temp = InvertirExpresiones(temp);
				temp = CambiarSignos(temp, true);
				temp.Insert("~(", 1);
				temp.Insert(")", temp.Length());
				NANDyNOR->StringGrid->Cells[j][0] = temp;

				// Ahora hay que escribirlo en su formulario
			}
			else
			{
				NANDyNOR->StringGrid->Cells[j][0] = "";
			}

			temp = NANDyNOR->StringGrid->Cells[j][1];
			if(Trim(NANDyNOR->StringGrid->Cells[j][1]) != "")
			{
				// Estas llamadas son para NOR - "X"
				temp = NANDyNOR->StringGrid->Cells[j][1];
				temp = InvertirVariables(temp);
				temp = InvertirExpresiones(temp);
				temp = CambiarSignos(temp, false);
				temp.Insert("~(~(", 1);
				temp.Insert(")", temp.Length());
				temp.Insert(")", temp.Length());
				NANDyNOR->StringGrid->Cells[j][3] = temp;

				// Hacemos el cambio a Espresion NAND - "X"
				temp = NANDyNOR->StringGrid->Cells[j][1];
				temp = InvertirExpresiones(temp);
				temp = CambiarSignos(temp, true);
				temp.Insert("~(", 1);
				temp.Insert(")", temp.Length());
				NANDyNOR->StringGrid->Cells[j][1] = temp;
			}
			else
			{
				NANDyNOR->StringGrid->Cells[j][1] = "";
			}
		}
	}

	for(int j = 0; j < Tabla.NumColumnas(); j++)
	{
		NANDyNOR->StringGrid->Cells[j][0] = NombresCompletos(NANDyNOR->StringGrid->Cells[j][0]);
		NANDyNOR->StringGrid->Cells[j][2] = NombresCompletos(NANDyNOR->StringGrid->Cells[j][2]);
		NANDyNOR->StringGrid->Cells[j][1] = NombresCompletos(NANDyNOR->StringGrid->Cells[j][1]);
		NANDyNOR->StringGrid->Cells[j][3] = NombresCompletos(NANDyNOR->StringGrid->Cells[j][3]);
	}

	NANDyNOR->Exp->Checked = false;
	NANDyNOR->ShowModal();

	// SCFormasCompactas->Hide();
}