Re: [DUG] Sizeof record gives error

2011-08-24 Thread Colin Johnsun
Haven't got into the details of your problem, but here is an article which goes into the details of array of const. http://rvelthuis.de/articles/articles-openarr.html Hope it helps, Cheers, Colin On 25 August 2011 09:40, David Moorhouse (DUG) del...@moorhouse.net.nz wrote: I have the

Re: [DUG] Delphi Digest, Vol 94, Issue 7

2011-08-04 Thread Colin Johnsun
What version of Delphi are you using? Could the string be returned as a Unicode string? or is it an AnsiString? Secondly, shouldn't the for loop be: for i := 0 to Length(sRaw) do Regards, Colin On 5 August 2011 10:34, Marshland Engineering marshl...@marshland.co.nzwrote: I still have

Re: [DUG] Jira book on special today

2011-06-12 Thread Colin Johnsun
Just bought the eBook. I've only so far read the first chapter on roles vs groups and all I can say is that it seems to fill in the gaps that the online documentation leaves out. In that respect it is worth having. With Jira only costing $10 and the ebook at only $8. Its probably the cheapest

Re: [DUG] RE Data validation.

2011-06-06 Thread Colin Johnsun
Try Application.ActiveForm.ActiveControl Cheers, Colin On 6 June 2011 13:12, Marshland Engineering marshl...@marshland.co.nzwrote: After a bit of experimenting, it seems that the OnValidate is triggered once you leave the dbEdit box and it is before the Post is committed. This means that

Re: [DUG] Validate data entry

2011-06-02 Thread Colin Johnsun
Hi Wallace, Don't know if you missed my post or not but if you do your validation on the OnDataChange event on the TDataSource component, it gets triggered everytime you modifiy a field value. So if you are in a DBGrid and you change a value in a column and then move to the next column, the event

Re: [DUG] Validate data entry

2011-06-01 Thread Colin Johnsun
Hi John, Don't have the details in front of me but have a look at TField.OnGetText event. Wherever the field gets displayed it will call on its OnGetText event if it has been defined. In that event you can reformat you field into what ever string format you like. Hope this helps, Colin On 1

Re: [DUG] Delphi version for 64 bit

2011-05-02 Thread Colin Johnsun
Currently none. Versions from Delphi 2 to Delphi XE (except for Delphi 8) compile to Win32. Embarcadero has released a beta version of their 64-bit compiler to beta testers. You can assume that this version will be out later this year. If you need Win64 bit executables have a look at

Re: [DUG] [DCC Error] F2039 Could not create output file 'ShelfGenie.exe'

2011-03-18 Thread Colin Johnsun
Just checking the Embarcadero newsgroups, it seems this can happen when your virus checker grabs hold of your exe but does let go of it. Try disabling your virus checker and see what happens (or replace it with a less intrusive one). Cheers, Colin On 19 March 2011 08:38, Charlie

Re: [DUG] [DCC Error] F2039 Could not create output file 'ShelfGenie.exe'

2011-03-18 Thread Colin Johnsun
Glad to help :) Generally speaking, access violation occur when you are trying to access an object that doesn't exist (anymore). Since you get this error when closing the main form, it is very likely the program is trying to access an object that has already been freed (prematurely). You may need

Re: [DUG] Conditionally change name of output exe

2011-03-08 Thread Colin Johnsun
Hi Alistair, On 9 March 2011 17:17, Alistair Ward alist...@fred.gen.nz wrote: Hi, I had just composed an answer suggesting using Build Configurations and Post-Build events, when I re-read your message and saw the D7 :-) Don't hold back :) I'm sure those of us who use a more recent version of

Re: [DUG] Variables stored

2011-01-21 Thread Colin Johnsun
Actually is Self.Create safe - rather than TMyDialog.Create? I think Jolyon explained it better than me but for me, it means that there is less code that needs to be modified/maintained. Self in the class method will refer the class that the method is being called from. In the case that I

Re: [DUG] Variables stored

2011-01-20 Thread Colin Johnsun
I don't use the with clause that often but I do use it in class methods to instantiate dialog boxes. eg. class function TMyDialog.Execute: Boolean; begin with Self.Create(nil) do try Result := ShowModal = mrOk; finally Release; end; end; Cheers, Colin On 21 January 2011 14:44,

Re: [DUG] Facebook / Twitter etc.

2010-11-30 Thread Colin Johnsun
There is a guy named Simon Stuart (@LaKraven) on Twitter that I follow who has created a Delphi component for Twitter integration. I haven't used it but you may want to have a look to see if it matches your needs. http://www.lakraven.com/delphi-stuff/ttwitter/ Cheers, Colin On 1 December 2010

Re: [DUG] Toolsets (was Re: Company closing)

2010-11-29 Thread Colin Johnsun
On 30 November 2010 09:56, Jolyon Smith jsm...@deltics.co.nz wrote: What we need is a Delphi for Cocoa. What we *don't* need is a Delphi (or a VCL) for a Lowest Common Denominator that fits Windows and Mac and Linux and phones and toasters and key-fobs. Totally agree with Jolyon.

Re: [DUG] Upgrading to XE - Unicode strings questions

2010-11-22 Thread Colin Johnsun
I won't answer everything but just on this one question: On 23 November 2010 11:04, John Bird johnkb...@paradise.net.nz wrote: Extra question: It looks like code like for i:=1 to length(string1) do begin DoSomethingWithOneChar(string1[i]); end; cannot be used

Re: [DUG] Upgrading to XE - Unicode strings questions

2010-11-22 Thread Colin Johnsun
*From:* delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] *On Behalf Of *Colin Johnsun *Sent:* Tuesday, 23 November 2010 14:31 *To:* NZ Borland Developers Group - Delphi List *Subject:* Re: [DUG] Upgrading to XE - Unicode strings questions I won't answer everything

Re: [DUG] D2010 and XE on the same machine

2010-11-08 Thread Colin Johnsun
Could it have anything to do with the search paths used by 2010 and XE? On 9 November 2010 09:21, Jeremy North jeremy.no...@gmail.com wrote: No. I have Delphi 2007 - Delphi XE on my main machine and they are work fine. I have Delphi 5 - Delphi XE on the build machine and they are all fine as

Re: [DUG] D2010 and XE on the same machine

2010-11-08 Thread Colin Johnsun
If you're game, there is an updated beta IDEFixPack from* *Andreas Hausladenhttp://andy.jgknet.de/blog which attempts to fix the slowness in code insight. You can find it at: http://andy.jgknet.de/blog/2010/11/the-idefixpack-4-0-beta-begins/ On 9 November 2010 09:54, Jeremy Coulter

Re: [DUG] D2010 and XE on the same machine

2010-11-08 Thread Colin Johnsun
From Andrea's blogpost, code-completion also continues to works after compiles. I haven't installed it yet but I am waiting for it to come out of beta. And when it does, it'll be on my PC faster than a normal code-completion process! Colin On 9 November 2010 13:23, Jeremy Coulter

Re: [DUG] TradioGroup without a border

2010-11-04 Thread Colin Johnsun
Hi Wei, That's pretty neat! I think i can use this in a project that uses DBRadioGroups. Very cool! Thanks, Colin On 5 November 2010 09:36, Cheng Wei (FMI) che...@fmi.co.nz wrote: Hi, Below works for us: procedure TForm1.FormCreate(Sender: TObject); SetWindowRgn(ARadioGroup.Handle,

Re: [DUG] XE Upgrade

2010-08-30 Thread Colin Johnsun
Hi Jolyon, On 31 August 2010 13:12, Jolyon Smith jsm...@deltics.co.nz wrote: I might be more impressed if they had actually fixed some of the bugs I myself reported that have languished in QC for 8+ years (and had not introduced new ones related to those in the meantime). Just curious,

Re: [DUG] Icon

2010-07-21 Thread Colin Johnsun
+1 for IcoFX. No mucking about with scaling graphics. Just drop a graphic image onto the canvas and it will scale it down to the size of the icon (and still look decent!) On 22 July 2010 08:30, Cameron Hart cameron.h...@flowsoftware.co.nz wrote: Use IcoFX for anything to do with ICOs.  It

Re: [DUG] unit source code size

2010-07-04 Thread Colin Johnsun
Can you refactor your code? See if you can break your classes or methods into smaller segments. Depending upon your class relationship, can you reduce it to one class per unit? If you have such large methods (200 lines seems like is a lot!), you can break them up into smaller methods. If it

Re: [DUG] unit source code size

2010-07-04 Thread Colin Johnsun
Hi Leigh, On 5 July 2010 14:54, Leigh Wanstead lei...@softtech.co.nz wrote: Hi Colin, I am constantly refactoring code, but sometimes the form unit just grows bigger and bigger. Regards Leigh -Original Message- The amount of code shouldn't bother you. What matters is that the

Re: [DUG] Windows 7

2010-07-02 Thread Colin Johnsun
Hey Bob, I could probably be totally off-track, but why don't you check the order of the creation of forms. Go to Projects | Options... | Forms and place the datamodule as the first item (or at least before the form) in the auto-create form list. It may make a difference. Cheers, Colin On 3

Re: [DUG] DateTimePicker

2010-06-28 Thread Colin Johnsun
If you are only interested in the Date part of the TDateTime you could always use the Trunc function. ie. if Trunc(DatePicker1.Date) = Date then... Cheers, Colin On 29 June 2010 11:42, John Bird johnkb...@paradise.net.nz wrote: When a TDateTime is set from a DateTimePicker that is being used

Re: [DUG] Delphi on Windows Mobile

2010-05-04 Thread Colin Johnsun
Hi, You might be able to do something with Monotouch and Prism (for iPhone) - but I haven't investigated this as a possibility. You can develop iPhone apps with Monotouch with the current iPhone SDK. Unfortunately, with the advent of the new iPhone 4.0 SDK, the rules have been changed (by

Re: [DUG] Delphi on Windows Mobile

2010-05-04 Thread Colin Johnsun
I guess if you are not planning to market your iPhone app to the wider community via the App Store and just building an enterprise application that is used specifically within a business, then you may be able to getaway with developing with Monotouch. I might just add that I am just speculating

Re: [DUG] Delphi on Windows Mobile

2010-05-04 Thread Colin Johnsun
, at 3:03 PM, Colin Johnsun wrote: Hi, You might be able to do something with Monotouch and Prism (for iPhone) - but I haven't investigated this as a possibility. You can develop iPhone apps with Monotouch with the current iPhone SDK. Unfortunately, with the advent of the new iPhone 4.0 SDK

Re: [DUG] Enable CheckBox

2010-04-26 Thread Colin Johnsun
I like David's version but why not get rid of the not to: DBCheckBox4.Enabled := DBEdit2.Text ''; Cheers, On 27 April 2010 09:40, Ian Drower idro...@gmail.com wrote: Hi Bob I'd use if DBEdit2.Text '' then DBCheckBox4.Enabled := true else DBCheckBox4.Enabled := false Ian On

Re: [DUG] Enable CheckBox

2010-04-26 Thread Colin Johnsun
Yeah, that was my thinking on the topic too! But you said it much better :) BTW, I'm wondering if Bob, the originator of this thread, wants to chime in and let us know if any of these suggestions helped or not. On 27 April 2010 10:34, Jolyon Smith jsm...@deltics.co.nz wrote: Maybe it’s just

Re: [DUG] Need help in format function

2010-03-03 Thread Colin Johnsun
Hey Phil :) You beat me too it! It's clean, readable and concise. Plus there's no mucking around with strings!! +1 from me :) cheers, Colin On Thursday, March 4, 2010, Phil Scadden p.scad...@gns.cri.nz wrote: I think it easier to do format( '%.2f', [trunc(value*100)/100]); Notice: This

Re: [DUG] Need help in format function

2010-03-03 Thread Colin Johnsun
or disclose it to anyone. Please consider the environment before printing this email -Original Message- From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On Behalf Of Colin Johnsun Sent: Thursday, 4 March 2010 9:44 a.m. To: NZ Borland Developers Group - Delphi List

Re: [DUG] Interbase Blobs in Delphi 2010

2010-03-03 Thread Colin Johnsun
Sounds like a Unicode issue. The default string in D2010 is a unicode string. Can you use: IBQuery1.ParamByName('blobby').AsString := 'blah blah blah'; ? Colin On 4 March 2010 11:08, Jeremy Coulter jscoul...@gmail.com wrote: Hi All. I am just working thru converting a D2007 app to D2010.

Re: [DUG] Interbase Blobs in Delphi 2010

2010-03-03 Thread Colin Johnsun
Jeremy On Thu, Mar 4, 2010 at 2:17 PM, Colin Johnsun colin.a...@gmail.comwrote: Sounds like a Unicode issue. The default string in D2010 is a unicode string. Can you use: IBQuery1.ParamByName('blobby').AsString := 'blah blah blah'; ? Colin On 4 March 2010 11:08, Jeremy Coulter jscoul

Re: [DUG] Zipmaster

2010-02-26 Thread Colin Johnsun
On 27 February 2010 14:36, Jeremy North jeremy.no...@gmail.com wrote: Abbrevia It can be found at http://sourceforge.net/projects/tpabbrevia/ ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin:

Re: [DUG] ADUG Symposium

2010-02-24 Thread Colin Johnsun
Hi you better check your calendar again. The Melbourne symposium is on the 25th March :) Cheers, Colin On 25 February 2010 17:14, Arjan Noordhoek arjan.noordh...@gmail.comwrote: Hi Rohit, A colleague and I will be attending the Melbourne symposium on the 24th. Cheers, Arjan Noordhoek