DirectoryResourcesBlog Details for "Tips Delphi"

Tips Delphi

Tips Delphi
Dicas de Delphi Tips and Tricks of Delphi. Samples Sources
Articles: 1, 2

Articles

Listando informações dos Aliases
2007-12-24 18:56:00
Com o código abaixo você poderá desenvolver um pequeno aplicativo para obter informações dos aliases contidos em sua máquina. Inicie uma nova aplicação. Insira no formulário, 4 componentes do tipo TLabel e um TListBox. No evento OnCreate do objeto Form1 digite o seguinte código:procedure TForm1.FormCreate(Sender: TObject);beginSession.GetAliasNames(ListB ox1.Items);end;Agora no evento OnClick do componente ListBox insira:procedure TForm1.ListBox1Click(Sender: TObject);vartStr: array[0..100] of char;Desc: DBDesc;beginif ListBox1.Items.Count = 0 thenexit;StrPLCopy(tStr, ListBox1.Items.Strings[ListBox1.ItemIndex ], High(tStr));DbiGetDatabaseDesc(tStr, @Desc);with Desc dobeginLabel1.Caption := StrPas(Desc.szName);Label2.Caption := StrPas(Desc.szPhyName);Label3.Caption := StrPas(Desc.szDbType);Label4.Caption := StrPas(Desc.szText);end;end;
Tools for the Development Team (2)
2007-10-15 22:20:00
To continue where I left off, the management team, of which I am a member, looked at Jira in a totally different manner. Each person had their own needs for a tool ever so slightly different to Jira. This caused some problems as I was then asked to evaluate a number of other tools that, perhaps with some compromise, everyone can use. Some suggestions were forthcoming and I dutifully took at look at each one. The problem with the approach that I made to the management team was that I had obviously failed to impress what the development team needed in the tool. You see, I was out to sell the tool to the rest of the company and in doing so I was focusing on their needs instead of the development team's. This meant that instead of learning how the development team were going to contribute and communicate better, they were thinking "how can I use this new tool", which invariably led to "I need this tool to do X, and I know one that does X much better than this". Of course, that meant ...
More About: Tools , Development , Team
Tools for the Development Team
2007-10-11 23:47:00
We placed Jira onto our live server and began using it for real about 2 weeks ago now. So how's it going? Rather well as it turns out. (Jira is from Atlassian (http://www.atlassian.com/software/jira/) and is an issue tracker tool, see earlier posts for discussions.) I did a demo for the Development Team and they took to it like a duck to water, now that they understood what it's used for and how. I did the same for the rest of the Management Team and they took to it as well, but in a different way. Initially it was not used as well as I'd have liked so I put a little pressure on the team by being a bit of a pain in the neck for a couple of days.. Me: "What are you working on?" Developer: "I'm updating xyz here that needs a new abc because Freda from WxyCorp has found a glitch with it" Me: "I don't see this in Jira, have you added it?" Developer: "Um... (ticidatacida) .. I have now (grin)" Me: "Oh, OK then. You know that if you are working on anything, no matt...
More About: Tools
Firebird System Tables (Part IV)
2007-10-05 10:30:00
The system table for stored procedure is like here. The purpose of this view is the same like in Firebird System Table (Part II). CREATE VIEW "vSYS_FindProcSource"( "procName", "procSource")ASselect r.rdb$procedure_name, r.rdb$procedure_sourcefrom rdb$procedures rwhere r.rdb$system_flag = 0;Fonte: http://firebird-with-delphi.blogspot.com
More About: Tables , Stem
Firebird 2.0.3 is released
2007-09-29 13:48:00
On 26 September 2007, Firebird version 2.0.3 is released, you can download in here. This version is only bug fixed version from FB 2.0Fonte: http://firebird-with-delphi.blogspot.com
More About: Released
Installing Jira - The Development Support Tool
2007-09-28 05:57:00
We are a relatively small (less than 20 employees) software development house with about half a dozen mainline products as well as any number of consulting projects going on. We have some very big name clients in several countries and therefore need to ensure work is completed on time and efficiently. While there are normal enhancement projects and major installation projects going on, there are also a number of items that come up for customers wanting changes or where something doesn't go quite as planned. These can disrupt the programmers day and disturb the development of future enhancements or otherwise frustrate the project timelines. We have a web based system for clients to record requests and log bugs. This is monitored by our support staff and an email is fired off to developers where necessary. All this means that as more emails come in, the developer has to judge the urgency of the email and either drop everything to perform that task, or note that this is another ite...
More About: Development , Tool , Support
Installing ZeosDBO in Delphi (rev version)
2007-09-27 05:04:00
I already make some revision on my previous post about how to install ZeosDBO components in Delphi . The revision link is here. ZeosDBO is one of the direct connection components to many RDBMS including Firebird. The idea of ZeosDBO is like JDBC, and to switch from one database to another database is really easy, find it by yourself after trying this amazing components. One thing, this component is FREE and OPEN SOURCEFonte: http://firebird-with-delphi.blogspot.com
More About: Version
Firebird System Tables (Part III rev 1)
2007-09-27 04:49:00
Here is some revision (from Romkin idea) to the query of Firebird System Tables part III.In this query, it doesn't need anymore to has "case" statement to get the convertion from numeric type_name to more readable name. And I want to say thank you for the supporting comment on this little articles. Once correction from Milan Babuskov that told me "CONTAINING" is in Firebird since the first versions 1.0. Hope all articles in this blog can be usefull for FB community. Wait for the next Firebird System Tables again, stay tune on the same channel he..he..he.. :)CREATE VIEW "vSYS_FindDependencies"( "dependentName", "dependentType", "dependedOnName", "dependedOnFieldName", "dependedOnType")ASselect d.RDB$DEPENDENT_NAME DEPENDENT_NAME, (select t.RDB$TYPE_NAME from RDB$TYPES t where d.RDB$DEPENDENT_TYPE=t.RDB$TYPE and t.RDB$FIELD_NAME = 'RDB$OBJECT_TYPE' ) DEPENDENT_TYPE, d.RDB$DEPENDED_ON_NAME DEPENDED_ON_NAME, d.RDB$FIELD_NAME DEPEND...
More About: Part , Stem
Finally closing this blog
2007-09-24 11:01:00
Well, it is about time to close this blog officially, however, not without starting a new blog on my own server. So yes, I will start blogging again and I will write about Programming with Delphi (and C#) as well as other aspects of my life.The new blog supports categories and is just starting, so you have not missed anything so far ;-)To read my new blog, go to http://www.gumpi.com/ and start reading.Thanks to all readers in the past, and hello to all readers to come.* * * THIS BLOG IS CLOSED NOW * * *Fonte: http://delphi-notes.blogspot.com
More About: Blog , Finally
Firebird System Tables (Part III)
2007-09-21 06:12:00
This article idea (Part III) is belong to the someone that put comment on my previous article, so I just accomodate his/her idea. And I already arrange to become a view like this:CREATE VIEW "vSYS_FindDependencies"( "dependentName", "dependentType", "dependedOnName", "dependedOnFieldName", "dependedOnType")AS select RDB$DEPENDENT_NAME, case RDB$DEPENDENT_TYPE when 0 then 'Table' when 1 then 'View' when 2 then 'Trigger' when 3 then 'Computed field' when 4 then 'Validation' when 5 then 'Procedure' when 6 then 'Expression index' when 7 then 'Exception' when 8 then 'User' when 9 then 'Field' when 10 then 'Index' when 14 then 'Generator' else RDB$DEPENDENT_TYPE end DEPENDENT_TYPE, RDB$DEPENDED_ON_NAME, RDB$FIELD_NAME, case RDB$DEPENDED_ON_TYPE when 0 then 'Table' when...
More About: System , Tables , Stem
Back again
2007-09-20 23:37:00
Thanks for your patience, I have finally shifted house and started my new role as Software Development Manager for a software house in Hamilton. The shift included a few days in Wellington visiting friends and generally spending time away. Holidays have been a very rare occurrence for me, having at one time, spent more than 12 years without a holiday, I find that taking a break occasionally is a requirement. The new role is interesting. Based on Oracle technologies the product is a very stable and sizeable system. The team contains some excellent technical expertise and I will be working hard to install some processes and a decent methodology to ensure that they are supported as much as possible. That's all for now as I'm still finding my feet here. Fonte: http://stevepeacocke.blogspot.com
More About: Back
Firebird System Table (Part II)
2007-09-20 05:51:00
Another FB system table is system table for trigger. The reason I create this view is to scan for some code inside the source of the trigger. For example, I want to change the field type of table A, then I want to know, this field is being used by which trigger, so I can search thorough this view:CREATE VIEW "vSYS_FindTriggerSource"( "triggerName", "tableName", "triggerInactive", "triggerSource")ASselect r.rdb$trigger_name, r.rdb$relation_name, r.rdb$trigger_inactive, r.rdb$trigger_sourcefrom rdb$triggers rwhere r.rdb$system_flag = 0If you want to seach some text in the trigger source then you can use this simple query:select *from "vSYS_FindTriggerSource"where "triggerSource" containing 'some_field'The keyword "containing" here (if I'm not forget) is exists from FB 2. The difference between "containing" and "like" is the "like" is case sensitive where "containing" is case insensitive, and also you not need the "%" sign like in "like" keyword.That view also display...
More About: System , Part , Table , Stem
Firebird System Tables (Part I)
2007-09-18 08:06:00
Hi, whew it's has been long time since my last time post, yes I a little bit busy now, with some of my own project and some of my family work. Ok, now I want to share about Firebird System Tables , they are tables that side on every FB database that consist of metadata of user tables (table that you created), many question about this and also many purpose to know about this.I often use this technique when I develop a database that consist of many tables and where there is an error on one of the field and then I must know this field is belong on which table, to solve that problem, I create a view like this:CREATE VIEW "vSYS_FindField"("tableName","fieldName", "default_val")ASselect r.rdb$relation_name, f.rdb$field_name, f.rdb$default_sourcefrom RDB$RELATIONS r, RDB$RELATION_FIELDS fwhere r.rdb$system_flag = 0 and r.rdb$relation_name=f.rdb$relation_name;T he FB System Tables can be known from "RDB$RELATIONS.RDB$SYSTEM_FLAG" greater than 0 (zero). The "RDB$RELATIONS" is a system table...
More About: Part , Stem
Returning the outer directory
2007-09-09 22:47:00
Returning the directory before the current one should be a simple one-line call but I have so often seen a number of very highly convoluted ways of finding the last slash () in the directory string and using copy() and other ways that I have decided to relate a simple and direct way to obtain any or all directories prior to, and including the current one.The problem with finding the last slash is that you have to watch out for cases where the current directory is a root directory. The good news is that you can ignore all of that.You should know that finding the currently running exe program name including directories is Application.ExeName found in SysUtils. This should return something like..C:Program FilesCodeGearDelphi5.0inMyProgram.exeOf course the directory structure may be different as I'm sure you're not running your programs in the Delphi in directory :o)But to get the directory that MyProgram.exe is running in, the call is ExtractFileDir(Application.ExeName). Th...
More About: Directory , Dire , Rect
Accessing Interbase/Firebird Metadata in Delphi
2007-09-06 13:43:00
WARNING: Interbase and Firebird system tables are not for the faint hearted. It is not recommended that you alter anything in these tables if you ever want to use them again - and keep your job. Major stuff-ups can occur.I was looking at some old Delphi 7 code of mine when I was attempting to get in behind the scenes of Interbase and Firebird tables and fields to learn a little more about them. I came across these little pieces of information I'd like to share.The following will list all the tables in one grid and, for each table, list all the fields in another grid. Drop on your TIBDatabase and direct it at your Interbase or Firebird server.Now drop a TIBTransaction, TIBQuery, TDataSource, and a TDBGrid and connect them all. Enter the following query into the IBQuery1... SELECT DISTINCT RDB$RELATION_NAME as MyTable FROM RDB$RELATION_FIELDS WHERE RDB$SYSTEM_FLAG=0 AND RDB$VIEW_CONTEXT IS NULL ORDER BY RDB$RELATION_NAMEand make IBQuery1 live. Now drop on another TDBGrid, TIBQu...
More About: Metadata
Scrolling to the right place in TMemo
2007-09-04 22:12:00
After programmatically inserting a number of lines I find that the TMemo will show at the last line as it normally should. However, sometimes what I really want is for TMemo to move to the first line, or perhaps even move to the top of the last lot of inserted lines.Here are a few little gems I have picked up on my travels that work a treat.Move to a particular line in a Memo...function MemoMoveToLine(LineNo: integer);begin with Memo1 do begin SelStart := Perform(EM_LINEINDEX, LineNo, 0); Perform(EM_SCROLLCARET, LinePos, 0); end;end; What this is doing is calling TControl.Perform. This function actually uses a Windows message to perform some task, in this case placing the cursor at a line number, and then scrolling to that line. Let's take a look at using that function...var CurrentLine: integer;begin // Get the current position with Memo1 do CurrentLine := Perform(EM_LINEFROMCHAR, SelStart, 0); AddLotsOfLines; // Move to the line we...
More About: Place
What's this Soundex in Delphi?
2007-08-30 22:00:00
Delphi has a Soundex routine found in StrUtils, so why am I giving you another? This blog is about how Soundex works. understanding Soundex will help you decide how and when to use it to enhance your program. I am not suggesting for a moment that you dump the already written Soundex routine within Delphi, unless you really want to, but rather I am suggesting that this may be a way to understand how a Soundex code is put together. In the early 1980's I wrote a Soundex routine in Turbo Pascal and released it to the world through the bulletin boards that were available back then (before the Internet became readily available to the masses). By releasing it to the public domain, I was more interested in sharing than in copyrighting everything.Over the following years, to my great amusement, I found my routine copied several times, sometimes word for word, line for line including comments, with my name replaced with someone else claiming to be the author (I would not be so amused these d...
More About: Delphi
Have an iif() function in Delphi
2007-08-23 01:32:00
There are many advantages to learning other programming languages, but there are also some problems as well. The "Immediate If" (iif) function is one of those. In most, if not all, the other languages there is an immediate if function that makes programming just a little easier and allows you to say things in much less lines. Consider the following... if Str = 'Top' then s := 'Woohoo!' else s := 'Climb some more'; While in Delphi we can effectively write this on one line as... if Str = 'Top' then s := 'Woohoo!' else s := 'Climb some more'; This looks untidy. If we were using another language with immediate if, that would look like this... s := iif(Str='Top', 'Woohoo!', 'Climb some more'); Now I realise to some Delphi programmers that are not multiple programming language experienced, all that seems a little esoteric but it is standard use in even Excel. Here's how it works...iif(condition, TrueResult, FalseResult) : Strin...
More About: Function
Firebird Won 2 Sourceforge Community Awards
2007-08-16 04:37:00
From InfoWorld:SourceForge unveils the winners of the ‘open-source Oscars’“…The Firebird relational database was another double winner, being voted both best project for the enterprise and the project providing the best user support.”Fonte: http://firebird-with-delphi.blogspot.com
More About: Awards , Community , Sourceforge , Unit
Firebird 5th International Conference
2007-08-16 04:34:00
This years conference will be held in the Telekom Conference Hotel in Hamburg, Germany. There are different international flights to Hamburg. We recommend to check www.air-berlin.com with a lot of european destinations and very cheap pricing. Hamburgs international airport code: HAM http://www.ham.airport.de/index_en.phtml There is a public train station nearby conference hotel. A map of the location with traveling infos will be send to all visitors This year we have a special entry level track on thursday and friday. For advanced visitors you find a seperate thread. In the codecamp, you can ask on both days the experts and let them analyze your real world problem. On saturday you will find more general session topics. Early bird conference fees (valid until 20th sep 2007):-Full Conference Package 599 Euro *3 days conference, 4 nights in the conference hotel(17.-21.) , breakfast, lunch, dinner, evening events -Conference Only Package 399 Euro *3 days conference, lunch -Main Conferen...
More About: International
New site Firebird FAQ
2007-08-16 04:28:00
Hi guys, there is a new site for Firebird, it is Firebird FAQThis site is built by Firebird users, for Firebird users to answer the most frequently ask question (FAQ). It's also has a good index to separate question topic. So if you want to know more about this fenomenal database, check it out :)Fonte: http://firebird-with-delphi.blogspot.com
More About: Site , New Site
Practical Development Methodologies
2007-08-16 00:33:00
Over the years I have designed and installed a number of development methodologies into various organisations (I'll not list them here). What I'm interested in is a description of the development methodology that is adopted by your company, why, and how well its working.I'd also like to know your description of the development method, not just the company's blurb sheet. For example, I was once working for a company who was the major client of a software development company. I was asked to report on the development methodology that the software company had adopted and how well it was working in favour of the client.The company, like a great many others I know, proudly advertised their methodology as "Agile". Agile is not itself a methodology but rather a concept. There are a number of methodologies which come within the concept of "Agile". Upon investigation, the company was operating under "Iterative and Incremental Development " (IID). After getting to know both the development ...
More About: Method , Logi
The Shell Sort
2007-08-15 01:34:00
Yes, I know Delphi comes with a number of sorting routines, but I thought I'd describe a shell sort as it is fascinating little sort routine that is easily understood and a very fast routine.[Steve: Although the "Shell sort" algorythm was first published by Donald Shell (as pointed out by Anthony Mills, thanks Anthony), this 'Shell Sort ' uses a different approach that would be closer to a "Bubble Sort" with some changes. I therefore take a little 'artistic licence' in describing it in ways that people can visually understand]The name "Shell Sort" comes from those games that are played by the magician, conman, or simply the swift of hand when they try to get money from the average passerby. Having usually 3 shells, a small coin or marble is placed under one of the shells. The shells are then swapped around at speed and the passerby is asked to bet on which shell contains the marble.The shell sort routine does that same swapping around, but only to place all the shells in order. C...
The Delphi/Pascal Sentence
2007-08-14 02:07:00
...or "When/Where to use semicolons".Apologies to all you long time Pascal gurus, but in the last few days I was pondering on the advice I gave a few students learning Pascal and felt that Today's post should be directed at those learning the language.Many new-comers find it difficult to grasp when they should be using a semicolon. The rules seem complex and inconsistant to them, when in fact they are reasonably consistant. Consider this..."Pascal is a sentence"Writing in Delphi Pascal is writing sentances, its that simple. Consider the following simple piece of code...if x > 0 then ShowMessage('x is worth something')else ShowMessage('x is worthless');That equates to a sentence of "If x is greater than zero then x is worth something otherwise x is worthless.". Some people call that a Pascal statement, but I like to think of it as a sentence. Sentence s are normally ended in a full stop, but in Pascal, sentances are ended in a semicolon and only the program is ended in a full s...
Use of Try/Except/Finally
2007-08-10 05:39:00
[Steve: I have altered the example to a more suitable one - that should teach me to quickly post then leave for the weekend without reading it].I have seen a number of discussions recently showing that some developers can be confused over try/except and try/finally blocks. I can give an example in the kind of work that I was doing this morning.I often read or write to an external device (let's just call it "the device" as it could be any external device). That device can sometimes send back confusing errors that I try to trap. However because those errors are confusing, I must let the user know all the various issues and ways around them.Here's a simplified version of my code (the procedures can raise their own exception with the error message returned from the device).var curSave : TCursor;begin try curSave := Screen.Cursor; Screen.Cursor := crHourGlass; // Show hourglass cursor try OpenDeviceConnection; // each will raise an exceptio...
More About: Finally
Vote for Firebird in Sourceforge Awards
2007-07-09 05:18:00
Firebird is a finalist in four categories of the Sourceforge Community Choice Awards for 2007. In each category the Firebird project is up against 9 otherprojects all selected for excellence from hundreds of thousands of SFprojects. Categories are Best Tool or Utility, Best Project for theEnterprise, Best User Support and Best Project Overall. Voting is open until July 20 so take this opportunity to creditFirebird with your recognition. Full details and links here: http://sourceforge.net/community/index.ph p/landing-pages/cca07/Fonte: http://firebird-with-delphi.blogspot.com
More About: Vote
Nice Function Added in Firebird 2.1 (beta)
2007-07-06 07:24:00
Here is the list of built in function in Firebird 2.1 (now, it's still beta). My favourite function: String function: LPAD, RPAD, LEFT, RIGHT, POSITION, REPLACE, REVERSE Date function: DATEDIFF, DATEADD Numeric function: ROUND, TRUNC, ABS, MIN_VALUE, MAX_VALUE, GEN_UUID, HASH So with this new built in function, my previous article can be achieve with more short statement like this: select current_date,right(extract(year from current_date), 2) ||right('0' || extract(month from current_date), 2) as Year_Monthfrom rdb$database But in my opinion it would be nice if Firebird team extend the capability of SUBSTRING function like this: the "length" value can be negative so it can achieve the same result like RIGHT function with the capability of "start position". Example: Substring('Hello World' from 9 to -3) will result "Wor"Fonte: http://firebird-with-delphi.blogspot.com
More About: Beta , Nice , Function
FB Date Manipulation
2007-07-06 07:24:00
Last week I have a question from Delphindo (Indonesian Delphi community) thorough YM conference. The question is how to make SQL query for Firebird to obtain the same result as we do this (to_char(sysdate, 'YYMM');) in Oracle. I must admit that Firebird doesn't have this "to_char" built in function, but we can create the same result with the trick like this: select current_date,substring(extract(year from current_date) from 3)||casewhen char_length(extract(month from current_date))=1 then '0'||extract(month from current_date)else extract(month from current_date)end as Year_Monthfrom rdb$database Thank's to the new feature of Firebird 2, that can make this happen without installing any UDF. I use the "char_length" and "substring" built in function that come in Firebird 2 (version 1.5xx still not support this built in function).Fonte: http://firebird-with-delphi.blogspot.com
More About: Manipulation , Pula
Firebird Date Literals
2007-07-06 07:23:00
Today I go to firebirdnews and found that this article is good and it may guide you to know more about FB date time. Here is the linkFonte: http://firebird-with-delphi.blogspot.com
Firebird 2.1 is in Alpha state
2007-07-06 07:23:00
Here is the link of release note FB2.1Alpha . Wow it's time to try.Some cool feature:Use of domains for Trigger/SP variable definition (SQL Server or MySQL doesn't have it (CMIIW))Global temporary tablesCommon table expressions, recursive queriesDatabase TriggersDatabase Monitoring via SQLAdmin information via selectGet ODS Version and Dialect via SQLFonte: http://firebird-with-delphi.blogspot.com
More About: State
More articles from this author:
1, 2
40978 blogs in the directory.
Statistics resets every week.


Contact | About
© Blog Toplist 2008 - SEO by FeWorks
eXTReMe Tracker