डेल्फी 200 ई 2283 त्रुटि के साथ शिकायत करता है: [डीसीसी त्रुटि] outputcode.pas (466): ई 2283 बहुत सारे स्थानीय स्थिरांक। छोटी प्रक्रियाओं का उपयोग करेंमुझे "बहुत सारे स्थानीय स्थिरांक" त्रुटि क्यों मिलती है?
डेल्फी 2007 बस ठीक है। मुझे स्थानीय स्थिरांक की बहुतायत नहीं मिल रही है, यह एक छोटी (500 लाइन) इकाई है। क्या आप कॉन्स्टेंट या शाब्दिकों की कोई बहुतायत देखते हैं जिन्हें मैं संबोधित कर सकता हूं?
procedure TOutputCodeForm.FormCreate(Sender: TObject);
var
poParser : TStringStream;
begin
if (IsWindowsVista()) then
begin
SetVistaFonts(self);
end;
poParser := TStringStream.Create(gstrSQLParser);
SQLParser := TSyntaxMemoParser.Create(self);
SQLParser.RegistryKey := '\Software\Advantage Data Architect\SQLSyntaxMemo';
SQLParser.UseRegistry := True;
SQLParser.CompileFromStream(poParser);
FreeAndNil(poParser);
poParser := TStringStream.Create(gstrCPPParser);
cppParser := TSyntaxMemoParser.Create(self);
cppParser.RegistryKey := '\Software\Advantage Data Architect\SQLSyntaxMemo';
cppParser.UseRegistry := True;
cppParser.CompileFromStream(poParser);
FreeAndNil(poParser);
poParser := TStringStream.Create(gstrPasParser);
pasParser := TSyntaxMemoParser.Create(self);
pasParser.RegistryKey := '\Software\Advantage Data Architect\SQLSyntaxMemo';
pasParser.Script := ExtractFilePath(Application.ExeName) + 'pasScript.txt';
pasParser.CompileFromStream(poParser);
{* Free the stream since we are finished with it. *}
FreeAndNil(poParser);
poCodeOutput := TSyntaxMemo.Create(self);
poCodeOutput.Parent := Panel1;
poCodeOutput.Left := 8;
poCodeOutput.Top := 8;
poCodeOutput.Width := Panel1.Width - 16;
poCodeOutput.Height := Panel1.Height - 16;
poCodeOutput.ClipCopyFormats := [smTEXT, smRTF];
poCodeOutput.Font.Charset := ANSI_CHARSET;
poCodeOutput.Font.Color := clWindowText;
poCodeOutput.Font.Height := -11;
poCodeOutput.Font.Name := 'Courier New';
poCodeOutput.Font.Style := [];
poCodeOutput.GutterFont.Charset := DEFAULT_CHARSET;
poCodeOutput.GutterFont.Color := clWindowText;
poCodeOutput.GutterFont.Height := -11;
poCodeOutput.GutterFont.Name := 'MS Sans Serif';
poCodeOutput.GutterFont.Style := [];
poCodeOutput.HyperCursor := crDefault;
poCodeOutput.IndentStep := 1;
poCodeOutput.Margin := 2;
poCodeOutput.Modified := False;
poCodeOutput.MonoPrint := True;
poCodeOutput.Options := [smoSyntaxHighlight, smoPrintWrap, smoPrintLineNos, smoPrintFilename, smoPrintDate, smoPrintPageNos, smoAutoIndent, smoTabToColumn, smoWordSelect, smoShowRMargin, smoShowGutter, smoShowWrapColumn, smoTitleAsFilename, smoProcessDroppedFiles, smoBlockOverwriteCursor, smoShowWrapGlyph, smoColumnTrack, smoUseTAB, smoSmartFill, smoOLEDragSource];
poCodeOutput.ReadOnly := False;
poCodeOutput.RightMargin := 80;
poCodeOutput.SaveFormat := sfTEXT;
poCodeOutput.ScrollBars := ssBoth;
poCodeOutput.SelLineStyle := lsCRLF;
poCodeOutput.SelStart := 3;
poCodeOutput.SelLength := 0;
poCodeOutput.SelTextColor := clWhite;
poCodeOutput.SelTextBack := clBlack;
poCodeOutput.TabDefault := 4;
poCodeOutput.TabOrder := 0;
poCodeOutput.VisiblePropEdPages := [ppOPTIONS, ppHIGHLIGHTING, ppKEYS, ppAUTOCORRECT, ppTEMPLATES];
poCodeOutput.WrapAtColumn := 0;
poCodeOutput.OnKeyDown := FormKeyDown;
poCodeOutput.ActiveParser := 3;
poCodeOutput.Anchors := [akLeft, akTop, akRight, akBottom];
poCodeOutput.Parser1 := pasParser;
poCodeOutput.Parser2 := cppParser;
poCodeOutput.Parser3 := SQLParser;
SQLParser.AttachEditor(poCodeOutput);
cppParser.AttachEditor(poCodeOutput);
pasParser.AttachEditor(poCodeOutput);
poCodeOutput.Lines.AddStrings(poCode);
if (CodeType = ctCPP) then
poCodeOutput.ActiveParser := 2
else if (CodeType = ctPascal) then
poCodeOutput.ActiveParser := 1
else
poCodeOutput.ActiveParser := 3;
MainForm.AdjustFormSize(self, 0.95, 0.75);
end;
मुझे समस्या मिली। GstrCPPParser का संदर्भ। वह वैश्विक स्ट्रिंग एक स्ट्रिंग का राक्षस है। –
और मेमोरी वार, स्ट्रिंग्स को डेल्फी 200 के साथ दो गुना बड़ा मिला है (: यह कितना बड़ा था? –