//--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { AnsiString s; TFileStream* fs; int i; s = ""; if (lbTables->SelCount > 0) for (i = 0; i < lbTables->Items->Count; i++) if (lbTables->Selected[i]) { ACRTable1->TableName = lbTables->Items->Strings[i]; s = s + ACRTable1->ExportTableToSQL( cbExportStructure->Checked, cbAddDROPTable->Checked, cbExportIndexes->Checked, cbAddDROPIndex->Checked, cbExportData->Checked, cbExportBLOBFields->Checked, cbUseBrackets->Checked); }; Memo1->Text = s; fs = new TFileStream("test.sql",fmCreate); fs->WriteBuffer(&s[1],s.Length()); delete fs; }
void TUserIniFile::RecreateSections() { const String CR = "\n"; String* S; TFileStream* FileStream = new TFileStream(FileName, fmCreate); try { for(int i=0; i < SectionCount(); i++) { FileStream->Seek(0, soFromEnd); S = new String(); *S = Format((String)"%s[%s]%s", ARRAYOFCONST((CR, SectionNames[i], CR))); FileStream->WriteBuffer((const void *)S, S->Length()); delete S; } } __finally { delete FileStream; } }
//--------------------------------------------------------------------------- void __fastcall TForm1::Button4Click(TObject *Sender) { AnsiString s; TFileStream* fs; s = ACRDatabase1->ExportDatabaseToSQL( cbExportStructure->Checked, cbAddDROPTable->Checked, cbExportIndexes->Checked, cbAddDROPIndex->Checked, cbExportData->Checked, cbExportBLOBFields->Checked, cbUseBrackets->Checked); Memo1->Text = s; fs = new TFileStream("test.sql",fmCreate); fs->WriteBuffer(&s[1],s.Length()); delete fs; }
BOOL TStripInfo::SaveInfo(CONST TCHAR* szFilePath) { TFileStream* inStream = new TFileStream(szFilePath, fmCreate); inStream->WriteBuffer(&_stripVisual->fPRSMarkX, sizeof(INT32)); inStream->WriteBuffer(&_stripVisual->fPRSMarkY, sizeof(INT32)); inStream->WriteBuffer(&_stripVisual->fDeviceSizeX, sizeof(FLOAT)); inStream->WriteBuffer(&_stripVisual->fDeviceSizeY, sizeof(FLOAT)); inStream->WriteBuffer(&_stripVisual->clSelectUnitSheet, sizeof(TColor)); inStream->WriteBuffer(&_stripVisual->clSelectUnitOutline, sizeof(TColor)); inStream->WriteBuffer(&_stripVisual->clDefaultUnitSheet, sizeof(TColor)); inStream->WriteBuffer(&_stripVisual->clDefaultUnitOutline, sizeof(TColor)); inStream->WriteBuffer(&_stripVisual->nAngle, sizeof(INT32)); inStream->WriteBuffer(&_stripVisual->clIndicateLine, sizeof(TColor)); inStream->WriteBuffer(&_stripVisual->nOriginLocation, sizeof(INT32)); inStream->WriteBuffer(&_stripUnits->fUnitXSize, sizeof(FLOAT)); inStream->WriteBuffer(&_stripUnits->fUnitYSize, sizeof(FLOAT)); inStream->WriteBuffer(&_stripUnits->fUnitXPitch, sizeof(FLOAT)); inStream->WriteBuffer(&_stripUnits->fUnitYPitch, sizeof(FLOAT)); inStream->WriteBuffer(&_stripUnits->nUnitXCountPerBlock, sizeof(INT32)); inStream->WriteBuffer(&_stripUnits->nUnitYCountPerBlock, sizeof(INT32)); inStream->WriteBuffer(&_stripUnits->fFirstMarkToUnitCenterX, sizeof(FLOAT)); inStream->WriteBuffer(&_stripUnits->fFirstMarkToUnitCenterY, sizeof(FLOAT)); inStream->WriteBuffer(&_stripBlock->nBlockXCount, sizeof(INT32)); inStream->WriteBuffer(&_stripBlock->nBlockYCount, sizeof(INT32)); inStream->WriteBuffer(&_stripBlock->fBlockXPitch, sizeof(FLOAT)); inStream->WriteBuffer(&_stripBlock->fBlockYPitch, sizeof(FLOAT)); delete inStream; return true; }