Any Automatic Parenthesis completion?


This year I'm really trying to get myself to start using Delphi 2007 instead of Delphi 7. And you know, this is a really painful transistion. CodeGear has asked people what is stopping them from upgrading. And while I agree ...
Posted On: Tuesday 27th of November 2012 12:57:08 AM Total Views:  272
View Complete with Replies

RELATED TOPICS OF Delphi Programming PROGRAMMING LANGUAGE




number conversion (any base to any base) :)

Hi all, I'd thought I'd share a routine I created with you all in case you find it useful :-) Function BaseToBaseConversion(Const AInNumber : String; Const AInBase,AOutBase : Byte; Const AMinOutBaseDigits : Byte) : String; // Inputs: // AInNumber = input number to convert from (base 2 - 36) // AInBase = input base number (2 - 36) // AOutBase = input base number (2 - 36) // AMinOutBaseDigits = minimum number of 'digits' to use in the output string // // Outputs: // Result = the AInNumber converted to the AOutBase base (if possible) Const cDigits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; Var Decimal : LongInt; Remainder : LongInt; Power : Integer; DigitValue : Integer; Index : Integer; Begin Result := ''; If Not(AInBase In[2..36]) Then Exit; If Not(AOutBase In[2..36]) Then Exit; If AInNumber = '' Then Exit; Decimal := 0; Power := 1; For Index := Length(AInNumber) Downto 1 Do Begin DigitValue := Pos(AInNumber[Index],cDigits) - 1; If DigitValue < 0 Then Exit; // illegal input digit found so bomb out Decimal := Decimal + Power * DigitValue; Power := Power * AInBase; End; If Decimal = 0 Then Begin Result := cDigits[1]; Exit; End; While Decimal 0 Do Begin Remainder := Decimal Mod AOutBase; Decimal := Decimal Div AOutBase; Result := cDigits[Remainder + 1] + Result; End; For Index := 1 To (AMinOutBaseDigits - Length(Result)) Do Result := cDigits[1] + Result; End; If you find it useful, enjoy Cheers, Paul. "The plastic veneer of civilization is easily melted in the heat of the moment" - Paul Nicholls. paulfnicholls@gmail.NOSPAM.com Remove ".NOSPAM" to reply.
VIEWS ON THIS POST

141

Posted on:

Monday 1st October 2012
View Replies!

Unable to Find or Create any Code to Set Printer Source or Bin

After searching the internet for 2 days I am unable to create any code that sets a printers source or bin. Why doesn't this work The code executes but does not change the bin procedure SetPaperBin( PrtrName: string; Bin: word ); var hndPrinter: Thandle; BuffSize: integer; PtrPrtrInfo2: PPrinterInfo2; begin OpenPrinter( PChar( PrtrName ), hndPrinter, nil ); {get size of buffer for printer info 2} GetPrinter( hndPrinter, 2, nil, 0, @BuffSize ); PtrPrtrInfo2 := ocMem( BuffSize ); {get printer info 2 ...} GetPrinter( hndPrinter, 2, PtrPrtrInfo2, BuffSize, @BuffSize ); {... change bin if selected bin current bin} if ( PtrPrtrInfo2^.pDevMode^.dmDefaultSource Bin ) then begin PtrPrtrInfo2^.pDevMode^.dmDefaultSource := Bin; WinSpool.SetPrinter( hndPrinter, 2, PtrPrtrInfo2, 0 ); end; ClosePrinter( hndPrinter ); FreeMem( PtrPrtrInfo2 ); end; As a suggestion to CodeGear.... Delphi needs better information in the help file for setting up printers as well as new components to set printer settings not available in TPrinter.
VIEWS ON THIS POST

132

Posted on:

Monday 1st October 2012
View Replies!

WinXP SP3 anyone?

Did somebody installed Windows XP SP3 How does our favorite IDE run against it http://tinyurl.com/5frydj This link will start downloading it. Can be downloaded from windowsupdate too. Clment
VIEWS ON THIS POST

203

Posted on:

Monday 1st October 2012
View Replies!

Has anyone else had trouble

Getting to the embarcadero web site
VIEWS ON THIS POST

174

Posted on:

Wednesday 3rd October 2012
View Replies!

Delphi is not opening any projects

My Delphi 2006 is not opening any projects now. I don't what is wrong! I keeps on showing an error message 'Unable to write to d:\temp\Junk\MyTest.stat'. What is this message. How can I get rid of is permanently so that Delphi starts functioning as it used to previously. I have not installed anything new. Yes I have deleted the Junk folder. That is it but nothing.....
VIEWS ON THIS POST

243

Posted on:

Wednesday 3rd October 2012
View Replies!

Re: Time for a new keyboard - Suggestions anyone??

"Kevin Powick" > Well, it's about time to replace my well-used, quite dirty, but now > failing keyboard. It's a very old Belkin Ergonomic Smartkeyboard and > has served me well over the years. > I've tried to research the topic of ergonomic keyboards via Google, but > most reviews are targeted towards gaming keyboards. I need one for > regular programming/typing. Old good Microsoft Natural Keyboard Pro rulez!!! It is durable, it is heavy, it is ergonomic, it have classic layout of numpad and arrow block, it have very clear touch and click. It is the best keyboard I ever seen and touched. http://www.codinghorror.com/blog/archives/000400.html My friend searched this keyboard entire Moscow for two days and found it. Only USD $85 and I'm happy owner of this useful thing. Perhaps Microsoft Ergonomic Keyboard 4000 also worth to look at.
VIEWS ON THIS POST

160

Posted on:

Wednesday 3rd October 2012
View Replies!

Console app 'Press any key to continue...'?

How can I wait for a key to be pressed in a console application without the key being printed in the screen At the moment I am using readln; to pause execution. But its a bit unprofessional because the user can type whatever garbage they want all over the screen before pressing enter. Is there a way I could implement a 'Press any key to continue...' style behavior
VIEWS ON THIS POST

187

Posted on:

Wednesday 3rd October 2012
View Replies!

raised too many consecutive exceptions: floating point divide byzero. DLL, Delphi 2007

, I have been working on a project for several years where the application is written in VB6 and a major DLL in Delphi. Up to and inclusing Delphi 7 everything was fine but when I upgraded to Delphi 2007, I get the following error message: Project xxxxx raised too many consecutive exceptions: floating point divide by zero at yyyy It appears after the project has been run from the Delphi IDE for like a minute or two. I can just click OK and then continue with F9, but it is irritating, when this application is supposed to run for literally years. When the application runs by itself or from the VB6 environment, it's all fine, and as it showed up as soon as I upgraded, it also works fine in D7 and below. Any ideas
VIEWS ON THIS POST

404

Posted on:

Saturday 6th October 2012
View Replies!

any suggestion for serialization of TPersistent

I have problem with large TPersistent object serialization, spend one week searching for solution without luck. Could someone suggest solution to save object to stream and load it. TStream has methods to ReadComponen/WriteComponen TPersistent objects to stream, but this solution is good with small objects, my object can be up to 10mb and TStream.ReadComponen gives "Out of memory" sometimes.
VIEWS ON THIS POST

107

Posted on:

Saturday 6th October 2012
View Replies!

anyone can help? delphi 7 TADOTable cannot connect to 400 columns excel

I use a TADOConnection (e.g. connection1) to connect a Excel 2007 file with about 400 columns in a worksheet, using the following connectionString: Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\temp\exportFG.xlsx;Extended Properties="Excel 12.0;HDR=YES;" when I set the connected properties to true, no error occur. but when i put a TADOTable and set its connection to connection1, tableDirect = true, only 256 columns can be retrieved!! is this a limitation in Delphi 7 components (I know before Excel 2007, a worksheet has maximum 256 columns only) I am using Delphi 7.
VIEWS ON THIS POST

497

Posted on:

Sunday 7th October 2012
View Replies!

Force code in project to run before anything else, including other units?

Hi all, I have a delphi application (console application) that also runs under freepascal, and so I have created my own cross-platform resource system to store images, and other data which is compiled into the main exe file. One thing I am trying to use it for is write some DLLs (SDL.dll, and others to come, etc. ) from the 'resource file' to the programs folder when the program runs, but before anything else is executed... This is just so I can distribute a single exe file to make it easier. I tried to add a unit in the uses clause before every other unit being used, but that first unit's Initialization section is not executed before the program complains that it can't find SDL.dll, etc. Is it true that the first unit in the uses clause is supposed to have it's Initialization part run first I put a breakpoint in the Initialization part of the unit but it never gets there in the IDE... thanks in advance, Cheers, Paul. "The plastic veneer of civilization is easily melted in the heat of the moment" - Paul Nicholls. paulfnicholls@gmail.NOSPAM.com Remove ".NOSPAM" to reply.
VIEWS ON THIS POST

216

Posted on:

Sunday 7th October 2012
View Replies!

Has anyone else had trouble

Getting to the embarcadero web site
VIEWS ON THIS POST

154

Posted on:

Tuesday 16th October 2012
View Replies!

I don't understand the world anymore

What happens with the best development tool Am I crazy or the world I have to write my applications in VS now. Why Because of UNICODE. Now I'm two times slower, applications are more than two times slower and bigger. What I do for 5 minutes whit DOA, takes hours in VS. And ..... I don't want even to mention Java. I don't care who owns Delphi. Sell it to Martian, if you want. What I want is stable Delphi version, with good Help, UNICODE (I can say it 100 times) and generics, reasonable subscription price (I'm paying 1 VS and 2 DevExpress subscriptions yearly) - direct payable per Internet, and detailed road-map for at least 18 month from now. Godegear, leave the buzz and go programming now.
VIEWS ON THIS POST

99

Posted on:

Tuesday 16th October 2012
View Replies!

Codegear sold : For how many U.S. dollars was sold ?

Hi For how many U.S. dollars was sold i have read : 23 MIL USD. but.... ONLY 23 mil. \t why
VIEWS ON THIS POST

87

Posted on:

Tuesday 16th October 2012
View Replies!

Form with maaany elements - and a slow down

I am working on a form designer and have encountered a problem I'll try to explain here. I am able to create a simple app where I observe exactly same behavior as in my main app. 1. Let's say ...
VIEWS ON THIS POST

101

Posted on:

Saturday 10th November 2012
View Replies!

Re: TDateTime - any round up?

On a related matter, after a lot of study and testing, I have filed the QC report #56957, titled "A Fix for DateUtils Date-Time Compare Functions", with sources for a program which tests suggested fix to the DateUtils module. For ...
VIEWS ON THIS POST

60

Posted on:

Thursday 15th November 2012
View Replies!

Too many defaults

I've just made the surprising discovery that more than one control on the same form can have its Default property set to True. This produces unpredictable results when [Enter] is keyed. Is there a switch that prevents this beahaviour (i.e. ...
VIEWS ON THIS POST

83

Posted on:

Thursday 15th November 2012
View Replies!

how many running instances on a LAN

I want to know how many instances of my app (BDS2007/BDE/PARADOX) currently run on my LAN. Every PC runs only one instance. I thought to use a shared file created by the first user and deleted by the last, ...
VIEWS ON THIS POST

65

Posted on:

Thursday 22nd November 2012
View Replies!

FmtStr - any advantage

myStr: String; FmtStr(myStr, '%s', ['GoodBye']); myStr := 'GoodBye'; What do you think the advantage of using FmtStr in this case...
VIEWS ON THIS POST

80

Posted on:

Sunday 25th November 2012
View Replies!

Does anyone use datamodules

Hi , I've been using Delphi since version 1, and using datamodules since they've been available (Ver 3). I've recently 'updated' from 2006 to 2007 and now when I execute an application from the IDE (F9), the names on the ...
VIEWS ON THIS POST

168

Posted on:

Tuesday 27th November 2012
View Replies!