{"id":5038,"date":"2014-03-30T18:13:27","date_gmt":"2014-03-30T18:13:27","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-lazarus-collection-of-common-programming-errors\/"},"modified":"2014-03-30T18:13:27","modified_gmt":"2014-03-30T18:13:27","slug":"problem-about-lazarus-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-lazarus-collection-of-common-programming-errors\/","title":{"rendered":"problem about lazarus-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/BPO0Z.png?s=32&amp;g=1\" \/><br \/>\nBraiam<br \/>\ndpkg lazarus<br \/>\nI&#8217;m trying to install lazarus from here. I had broken packages, but I fixed the problem by removing sources in gedit \/var\/lib\/dpkg\/status as described here. Then I tried to install lazarus again, and the lazarus itself installs, but fpc and fpc-src packages cannot be installed. It gives me this error:Reading database &#8230; (Reading database &#8230; 5% (Reading database &#8230; 10% (Reading database &#8230; 15% (Reading database &#8230; 20% (Reading database &#8230; 25% (Reading database &#8230; 30% (Reading database &#8230;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/59ff894ae0ff062d229c8228738c213b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nFilburt<br \/>\ndelphi lazarus dynamic-forms<br \/>\nI have 5 forms created at design time. I need to dynamically create an instance of each form and put on a tab.My question: If the form names are in an array of strings and I call my procedure like this:ShowForm(FormName[3]);\/\/ To show the 3rd form on a tab page.How can I define and create the new instance for each form?This is what I have for now:procedure TForm1.ShowFormOnTab(pProcName:String); varNewForm: TfrmSetupItemCategories;\/\/***HERE IS MY PROBLEM***NewTab: TTabSheet;FormName: String;begi<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7c884aa865844e86c5de1acdcb8a6e25?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMarco van de Voort<br \/>\nwindows visual-studio gui lazarus<br \/>\nI need to develop a simple Windows application with 6 or 7 forms. Its main purpose is to manage files and launch a external program. These are my wishes, in descending importance orderFree Be Visual, I mean, the possibility to paint forms and object in the screen. Possibility to carry it in a USB pen-drive.I need a light\/small size language, not a very complex one. My program is going to have very few forms and its functionality is simple.Is there any language that meet this wishes? If not, is<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d6b3f1a4100f56e3e3c0874c82141ff6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTLama<br \/>\nfixed lazarus tstringgrid<br \/>\nI am using Lazarus 0.9.30.2. I have a standard TForm with a standard TStringGrid on it. The string grid has no columns or rows on it at design time. In the Object Inspector the following values are set.ColCount = 0 Columns = 0 FixedCols = 0 FixedRows = 0 RowCount = 0I want to add a number of TGridColumns at run time, and have been able to do so but always get a fixed column, which I don&#8217;t want. I have written code very similar to the sample below to do so. When I compile and run it I get the f<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b6116ac3c4b5835c6745570ea73a85c1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nCharles<br \/>\nconsole freepascal lazarus writeln debugln<br \/>\nWhen writing a Lazarus program, you have the option of using $APPTYPE console or deselecting the Win32 GUI Application (-WG option) in the Project Options .I noticed that without these options DebugLn and WriteLn raise exceptions. Is there a way to create a console even if the program is not compiled above mentioned options and output to it with DebugLn and WriteLn afterwards?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3c0aac2191718ef0309dbc034d9b9961?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDavid Heffernan<br \/>\ndelphi lazarus<br \/>\nI&#8217;m creating tabs at run-time like this:procedure TForm1.ShowFormOnTab(pProcName:String); varNewform: TForm;ClassToUse: TFormClass;NewTab: TTabSheet;FormName: String;beginNewTab := TTabSheet.Create(PageControl1);NewTab.PageControl:= PageControl1;PageControl1.ActivePage := NewTab;if pProcName=&#8217;ProcfrmSetupItemCategories&#8217; thenClassToUse := TfrmSetupItemCategorieselse if pProcName=&#8217;ProcfrmZones&#8217; thenClassToUse := TfrmZoneselseClassToUse := nil;if Assigned(ClassToUse) thenbeginNewForm := ClassTouse<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/BPO0Z.png?s=32&amp;g=1\" \/><br \/>\nBraiam<br \/>\ninstallation lazarus<br \/>\nI have a little problem with installing and running Lazarus. I just upgrade ubuntu from 13.04 to 13.10. When i had 13.04, i could install lazarus without any problems, but in 13.10 lazarus magicaly dissapeared, and when i tried install it from ubuntu software center, it said something like in my software resources lazarus-ide-0.9.30.4 doesnt exist.After some research on net i tried delete all files from earlier installations, download deb packages from sourceforge and install them, but when i wa<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/021d0d3a0676561486d5ec92339e3bb4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmamcx<br \/>\nconditional lazarus freepascal<br \/>\nI need to disable some code when run under the debugger.So, I just imagine that doing:{$IFNDEF DEBUG} &#8230; {$ENDIF}However, the code inside the ifndef is executed in the debugger, makin it crash.I have lazarus 0.9.29 &amp; FPC 2.4.0<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4725e478b3758cc62ea2142fc39b161d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nArcturus<br \/>\nmono dllimport lazarus<br \/>\nI&#8217;m stucked with a problem with Mono Interop in Linux. I have a native shared library (made in Lazarus) that I need to use in a C# assembly. The shared library is used by a Mono C# assemblie on Windows and on Linux.The assembly loads the shared library via DllImport at runtime, and calls an exported function that generates a file and returns a string with the new file&#8217;s name. The function in the shared library works fine, but in Linux the Mono runtime crashes at Object.__icall_wrapper_mono_marsh<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/X1Xfu.jpg?s=32&amp;g=1\" \/><br \/>\nBen Hooper<br \/>\nclipboard pascal freepascal lazarus<br \/>\nI&#8217;m going to admit, right off the bat, that I&#8217;m Pascal-inexperienced, to say the least. So, any help I can get will be greatly appreciated. :)As part of a larger program, I need to write a string variable to the clipboard. I&#8217;ve created a new project in Lazarus (version 1.0.12) so I can try to figure out how to do so without the complications caused by extra, unnecessary code, which I have included below:program varToClipboard;uses Clipbrd;vartextToCopy:string;begintextToCopy := &#8216;Test text from P<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c2e4f5ab6157e55697ed534fd34f6631?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\n1_bug<br \/>\nprocedure lazarus sigsegv unhandled-exception turbo-pascal<br \/>\nI have to write procedure for euler&#8217;s method to differential equations in Pascal. I have this:program Euler_proc;{$mode objfpc}{$H+} uses{$IFDEF UNIX}{$IFDEF UseCThreads}cthreads,{$ENDIF}{$ENDIF}Classes{ you can add units after this };{$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}{THIS PART I JUST COPIED FROM BOOK: }type fxy = function (x,y : Extended) : Extended; function f(x,y:Extended): Extended; far; begin f:= x+x*y+y+1; end;procedure Euler (var x0 : Extended;x1 : Extended;var y : Extended;f<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9ec8b2140e6b316f3c01a4255ee1735b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGustavo Carreno<br \/>\nlazarus fpc apache-modules<br \/>\nI finally had success compiling a &#8220;blank&#8221; Apache module, but now I&#8217;ve hit a rather annoying snag.I want to communicate with a MongoDB server and I opted for the only lib around for FreePascal\/Lazarus, pebongo.Dependency for pebongo is synapse.Somehow I&#8217;m getting &#8220;\/usr\/lib\/apache2\/modules\/mod_visius.so: undefined symbol: WSRegisterCustomImageList&#8221; when loading my module into Apache.I&#8217;ve tracked down the symbols onto Menus.pp, I think, and lazarusall(something) also plays a role in this. Again, I<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Braiam dpkg lazarus I&#8217;m trying to install lazarus from here. I had broken packages, but I fixed the problem by removing sources in gedit \/var\/lib\/dpkg\/status as described here. Then I tried to install lazarus again, and the lazarus itself installs, but fpc and fpc-src packages cannot be installed. It gives me this error:Reading database &#8230; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5038","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5038","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5038"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5038\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}