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 following code snippet

 code
 type
  PConstArray = ^TConstArray;
  TConstArray = array of TVarRec;

 function CreateConstArray(const Elements: array of const): TConstArray;

 type
  TLogType = (ltError, ltWarn, ltInfo);
  PLogData = ^TLogData;
  TLogData = record
    LogType: TLogType;
    LogArgs: TConstArray;
  end;

 

 procedure TUserClass.Log(const LogType: TLogType; const Args: array of
 const );
 var
  LogData: PLogData;
 begin
    // size of record TLogData does not work
    GetMem(LogData, sizeof(TLogData));
    LogData.LogType := LogType;
 // blows up on next line
    LogData.LogArgs := CreateConstArray(Args);
 //  ... do some other stuff with the LogData item finally calling FreeMem
 end;

 function CreateConstArray(const Elements: array of const): TConstArray;
 var
  I: Integer;
 begin
  SetLength(Result, Length(Elements));
  for I := Low(Elements) to High(Elements) do
    Result[I] :=  // assign a TVarRec here
 end;
 /code

 The code that assigns the memory only assigns 8 bytes - and an access
 violation ensues.  If I replace the call to sizeof with the number 16,
 the code works fine.

 My understanding of dynamic arrays was that the compiler created a 4 byte
 field before the first element that contained the length of the array.

 So why does the sizeof  function not reflect this ?  And why do I need 16
 bytes not 12  (4 for LogType + 4 for length of array + 4 for array
 pointer)?
 Also regardless of the number of items in the open array parameter, 16
 bytes works, so it does not relate the length of the TConstArray.

 Your thoughts ?

 David



 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
 unsubscribe


___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


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 something wrong

 I sending
serial_send('B');
serial_send('C');
 and a terminal program reads BC correctly

 My Delphi code is as below but something is wrong with the second
 character.

if SerialPortNG.NextClusterSize = 0 then begin
   sRaw:=SerialPortNG.ReadNextClusterAsString;
   memo1.Lines.Add(sRaw);
   sData:='';
   for i:=1 to length(sRaw) do begin
   iValue:= ORD(sRaw[i]);
   sData:=sData+IntToStr(iValue)+'  ';
end;
   memo1.Lines.Add(sData);

 Result
 Bè
 66  232
 Bè
 66  232
 Bè
 66  232

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 commercial issue tracker on the market.

Cheers,
Colin

On 13 June 2011 08:31, Alister Christie alis...@salespartner.co.nz wrote:

 For those at the Embarcadero event in Auckland last week, you will
 remember Richard talking about Jira,  O'Reilly have a short Jira book on
 sale today (US $8) for those wanting to get started with issue tracking
 http://oreilly.com/
 I haven't read the book (yet) so I don't know if it is any good - but it
 is recently published, so presumably up to date.

 --
 Alister Christie
 Computers for People
 Ph: 04 471 1849 Fax: 04 471 1266
 http://www.salespartner.co.nz
 Follow us on Twitter http://twitter.com/salespartner
 PO Box 13085
 Johnsonville
 Wellington


 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 you get a message directly after the box you have just entered
 the data into.

 This words great for data validation across many forms, but, it tells you
 the error, however it does not does not return you the box you have just
 left. Is there a way to put the cursor back to the dbEdit box if an error is
 encountered ?

 Along a similar line, is there a way to find where the cursor is within a
 string in and edit box ?

 Thanks Wallace






 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 is fired.

OnValidate happens before posting but OnDataChange occurs whenever a field
is modified of if you scroll to new record.
If you move to a new record you just ignore it by testing the Field
parameter is nil.

Cheers,
Colin

On 2 June 2011 18:00, Marshland Engineering marshl...@marshland.co.nzwrote:

  Form inheritance or Frames to cut
 down on the number of different entry points.

 The program is set of sequences for machining. A DBGrid displays the
 operations.

 On double clicking the DBGrid operation, opens a form with the relevant
 data and the graphics is displayed.
 The data entry points are placed on the graphic at the point of interest.
 So each entry form is completely different.

 The machining steps are

 Thread, Rough Turn, Plunge cut, Face etc and all can be internal as well.

 However for example - each form has a Depth Of Cut that has a range of 0.02
 -2.5 mm.

 My thoughts

 -Create a new DB aware component that has a maximum and minimum range and
 use it on each form. Not ideal as I have to ensure consistency between all
 forms.

 -If I use OnValidate in the DM, when is this event triggered? On Post ?
 If so then I could have several errors occurring at the same time when the
 data validated, which error belongs to which field ?

 If I use OnValidate - when I append a record, will it run all the
 OnValidate procedures at once ?

 It looks like I may have to split the operation into to parts - check that
 the data entered is in the correct format (Form Property) and another to
 check it is in the right range (Database Property)

 PS Why Delphi didn't have a DBEditNumeric or EditNumeric  component I'll
 never know.


 Thanks Chaps.




 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 June 2011 21:59, John Bird johnkb...@paradise.net.nz wrote:

 I have a related question - I have been wondering how to display data in a
 dataset that is not either simple integer, string or date-time.

 Examples are:

 dates stored as an 8 digit integer (MMDD) (want to display as
 dd-mmm- and I already have the code to format it how I want)

 IRD numbers - 9 digits displayed as XXX-XXX-XXX

 Bank accounts  integers displayed as XX--XXX-XX

 Credit card numbers displayed as ---

 in each case stored as integers, but how could I intercept the display on
 displaying the data and after entry to reformat them like this?
 What do others do?

 For displaying I am hoping the answer is not just to store them as strings,
 as I still have the issue of how I validate entry.

 John

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 Lazarus/Free Pascal
Compiler. This is similar to Delphi but can compile to Win64.

Cheers,
Colin

2011/5/3 Rogério Martins rogmart...@gmail.com:
 Hi !
 Which delphi version (minimum) can compile Win 64 bit executables ?
 Thanks

 --
 The Ubuntu Counter Project - user number # 33192


 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe


___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


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 kersc...@bellsouth.net wrote:
 My application is in CodeGear 2007 using dBase. I’m getting the error in the
 “subject” about 8 out of 10 times when I compile. Any help would be
 appreciated.

 Thank you,

 Charlie



 Charlie Kerscher

 Williamson GA

 Cell: 770.468.1757



 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe


___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


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 to place a breakpoint on the main form's close event and
step into the code (F7) as it traverses to each line across the
project to identify at which point it crashes. Alternatively, when you
are running the application from within the IDE in debugger mode, when
the access violation occurs and it'll ask you to break or continue.
Just break and view the call stack to see where the error occurred and
then hopefully you will be able to identify what object it is trying
to access.

Hope this helps,

Colin


On 19 March 2011 09:06, Charlie kersc...@bellsouth.net wrote:

 Hi Colin, it appears it might be Kaspersky Internet Security. I did disable
 the protection and didn't encounter the error.
 Now if I could just solve the problem of getting Access Violation errors
 when I create a report with ACE Reporter. Every time that I access the form
 on which the report is and run the report, close the form which takes me
 back to my main form and close the main form I'm getting an AV.
 Thank you,

 Charlie Kerscher

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

 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 kersc...@bellsouth.net wrote:
 My application is in CodeGear 2007 using dBase. I'm getting the error in
 the
 subject about 8 out of 10 times when I compile. Any help would be
 appreciated.

 Thank you,

 Charlie



 Charlie Kerscher

 Williamson GA

 Cell: 770.468.1757



 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe


 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


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 Delphi could benefit from your wisdom!

Cheers,
Colin
___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


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 have group of dialog boxes with the same standard
behaviour, I can define a class method Execute in the base class and
use the Self identifier without having to define the Execute class
method in each and every descendant class.

Cheers,
Colin
___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


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, Jolyon Smith jsm...@deltics.co.nz wrote:
 It doesn’t take “with” to break the Delphi refactorings.  Perfectly
 ordinary, healthy, unexceptional, uncomplex code can do that !!  I find the
 refactorings to be next to useless as a result – when they work at all they
 simply cannot be relied on to have worked completely correctly.



 The one thing “with” does do is “break” the debugger, but even that isn’t
 accurate.  It is more accurate to say that “with” reveals a bug in the
 debugger (scope resolution that does not match that applied by the compiler)
 that should be fixed.



 There are very, very, VERY (one more time: VERY) few occasions when with
 should be used, but one that I see no problem with [sic] is:



   with SomeComboBox do

      ItemIndex := Items.IndexOf( someStringValue );





 (or at least I do when working with combobox/list classes that don’t provide
 a more convenient way of selecting an item by value, rather than index)



 J



 From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On
 Behalf Of Alister Christie
 Sent: Friday, 21 January 2011 16:11

 To: NZ Borland Developers Group - Delphi List
 Subject: Re: [DUG] Variables stored



 With is pretty dangerous because of scoping issues - and it breaks all the
 refactorings.  I'd like to see a with f : MyDataModule.MyDataSet do or
 similar construct.  I believe there is something like this in Prism.



 Alister Christie

 Computers for People

 Ph: 04 471 1849 Fax: 04 471 1266

 http://www.salespartner.co.nz

 PO Box 13085

 Johnsonville

 Wellington

 On 21/01/2011 3:32 p.m., Ross Levis wrote:

 Yes.  But I have done things like this.



 procedure DoSomething;

 begin

   with MainForm do

   begin

     …

   end;

 end;



 Definitely lazy.



 From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On
 Behalf Of John Bird
 Sent: Friday, 21 January 2011 3:17 PM
 To: NZ Borland Developers Group - Delphi List
 Subject: Re: [DUG] Variables stored



 Lazy? or simpler and convenient?



 plain functions that might be useful anywhere in any program are best done
 like this I would think.   Examples are in Delphi units afterall, eg
 StrUtils



 John



 I use some global variables.  I also have what I assume are other bad habits
 like creating plain functions or procedures instead of declaring them inside
 the form class.  Just lazy.



 Ross.



 From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On
 Behalf Of Jolyon Smith
 Sent: Friday, 21 January 2011 9:44 AM
 To: 'NZ Borland Developers Group - Delphi List'
 Subject: Re: [DUG] Variables stored



 Assignable typed constants are pointless.



 If you are going to declare a constant and then use a compiler switch to
 make it behave like a variable, then be honest and just use a variable!!



 Typed constants cannot even be used where “normal” constants can be:



     const

    ONE: Integer = 1;



    procedure Foo(aIndex: Integer = ONE);   // ERROR: Constant expression
 expected



 or:



   case iValue of

     ONE: ;  // ERROR: Constant expression expected

   end;



 Remove the type declaration from the ONE const, and both compile just fine
 (note that this is independent of the Assigned Typed Constants compiler
 setting).



 A typed constant is to all intents and purposes a variable, and might as
 well be declared as such (note that you can initialise a unit variable as
 part of it’s declaration):



   var

     ONE: Integer = 1;





 One final comment – Delphi really has no concept of a “global” variable.
 The highest visibility is “unit variable”.  You still have to explicitly
 “use” a unit to bring it into scope, and if two units declare variables of
 the same name normal scoping rules apply but you can explicitly qualify a
 reference using the unit name if you need to override the default scope.



 Most of the time global/unit variable is close enough that the distinction
 doesn’t matter, but when it comes to dogma the old rules that “global
 variables are the spawn of Satan himself” needs to be tempered in Delphi
 with the fact that they are a bit better “behaved” than the sort of global
 variable that those ritualistic rules were originally devised for.



 However, it is still true that the occasions when a unit variable is called
 for are relatively few, but they should not be simply outlawed for being
 something they are not.



 J







 From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On
 Behalf Of Robert martin
 Sent: Friday, 21 January 2011 09:18
 To: NZ Borland Developers Group - Delphi List
 Subject: Re: [DUG] Variables stored



 Hi John

 While all you suggest may be true (I 

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 10:36, Matthew Comb m...@ferndigital.com wrote:

 Hi,

 Has anyone achieved a Facebook and or Twitter post using Delphi ?

 Matt.

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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.

Initially, I was really looking forward to Delphi for Mac. But the more I
think about it, solutions that are not based on the native GUI frameworks
for each platform will most likely result in sub-par applications. If I want
to design a cross-platform app for both Windows and Mac, then my design
decision would be to refactor out all of the non-gui logic into their own
units and then build separate user interfaces using the native UI components
for each platform.

As Jolyon stated, what makes sense/looks good in a Mac application does not
necessarily make it appropriate for a Windows application and vice versa. If
you want to do a proper job, you will most likely create seperate UI's for
each platform. If that, being the case, it makes no sense to aim for that
lowest common denominator because in the end you will please neither of your
Windows or Mac users.

I think Embarcadero's plan to use a common 'VCL will initially satisfy the
uninitiated who wants to go cross-platform easily and quickly but will
be annoying if you want to create apps that are designed specifically for
the platform that they are to be hosted on. I see this as the same problem
with the attempt to get existing Delphi applications Unicode-ready. The
ideas was to make it easy for existing code to become Unicode but it made
it confusing for new apps going forward. I think this will be the same for
cross platform development for Delphi using this common VCL approach.

Colin
___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 reliably.   The problems are that length(string1) looks like
 it cannot be safely used - as unicode characters may include 2 codepoints
 and length(string1) highlights that there is a difference between the
 number
 of unicode characters in a string and the number of codepoints.   Still
 figuring out what is the best practice here, as I have quite a lot of
 string
 routines.   Should be be OK as long as the unicode text actually is ASCII.


you can use something like this:

var
  C: Char;
...
  for C in String1 do
  begin
DoSomethingWithOneChar(C);
  end;

In this case you don't need to know the index of each character, you just
get the char using the for..in..do loop.
___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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

2010-11-22 Thread Colin Johnsun
Doh! Thanks Jolyon for clearing that misunderstanding on my part. I was
aware of the surrogate pair issue but I wrongly assumed that this might have
been taken care by the iterator implementation. I guess not.

Thanks again!
Cheers,
Colin

On 23 November 2010 13:06, Jolyon Smith jsm...@deltics.co.nz wrote:

 Colin, the for C in loop and the for i := 1 to Length() loops are
 functionally identical!  The only difference is that the “for in” version
 incurs the slight overhead of the enumerator framework invoked by the
 compiler and runtime magic to support that syntax.



 But in neither case will the loop itself help detect/respond to surrogate
 pairs (a single “WideChar” is potentially only ½ the data required to form a
 complete “*character*”).  The only way to reduce an iterator over a string
 to a simple char-wise loop, whether explicit or using enumerators, is to
 first convert to UTF32, the facilities for which in the Delphi RTL are
 cough rudimentary, to put it politely.  Non-existent may be nearer the
 mark.



 The precise mechanics of the loop construct used is not material to that
 problem.





 However, just as before Unicode when most people didn’t care and just wrote
 code that assumed ANSI==ASCII, these days people won’t care and will write
 code that assumes that Unicode==BMP (Basic Multilingual Plane), ignoring
 surrogate pairs just as they used to ignore extended ASCII and ANSI
 characters.



 And for most people, that will probably actually work.



 J





 *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 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 reliably.   The problems are that length(string1) looks like
 it cannot be safely used - as unicode characters may include 2 codepoints
 and length(string1) highlights that there is a difference between the
 number
 of unicode characters in a string and the number of codepoints.   Still
 figuring out what is the best practice here, as I have quite a lot of
 string
 routines.   Should be be OK as long as the unicode text actually is ASCII.





 you can use something like this:



 var

   C: Char;

 ...

   for C in String1 do

   begin

 DoSomethingWithOneChar(C);

   end;



 In this case you don't need to know the index of each character, you just
 get the char using the for..in..do loop.







 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 well - although I don't often use the IDE's on that machine.

 I'd suggest trying a repair on Delphi 2010 however that might
 (shouldn't) effect XE. So you might have to repair both.


 On Tue, Nov 9, 2010 at 9:14 AM, Jeremy Coulter jscoul...@gmail.com
 wrote:
  Hi all. I have installed Delphi XE on to the same machine as I have D2010
  installed on, and now Delphi 2010 runs like an absolute PIG !
  If I type in Tr   for Try  it goes away, becomes unresponsive for about
  40-60 seconds, then the compiling window shows then it sits there for
 ages
  (like a good minute or more) then it finally compiles.
  It makes doing anything REALLY painful and SLWWW!  Its like its
 running
  on a real low end pc, and it isnt.
 
  Anyone else had this?
 
 
  Jeremy
  ___
  NZ Borland Developers Group - Delphi mailing list
  Post: delphi@delphi.org.nz
  Admin: http://delphi.org.nz/mailman/listinfo/delphi
  Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
  unsubscribe
 

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 jscoul...@gmail.com wrote:

 yes I think its the code-complete stuff too. After its compiled and run
 thru the IDE once then I run it again straight away, it runs straight away
 as you would expect. aghhate computers :-)



 On Tue, Nov 9, 2010 at 11:51 AM, Jan Bakuwel jan.baku...@omiha.comwrote:

 Hi Jeremy,

 I have D2010 on Windows 7 running as a VM on Linux with 1.5GB RAM and
 experience painful slowness from time to time. I haven't figured it out
 fully yet but I think things like code-completion and whether or not the
 Delphi Help is running do make a difference. It doesn't happen always though
 and usually I just check emails then get back to it and it's all back to
 normal. A bit frustrating I must admit though.

 cheers,
 Jan



 On 09/11/10 11:14, Jeremy Coulter wrote:

   Hi all. I have installed Delphi XE on to the same machine as I have
 D2010 installed on, and now Delphi 2010 runs like an absolute PIG !
 If I type in Tr   for Try  it goes away, becomes unresponsive for about
 40-60 seconds, then the compiling window shows then it sits there for ages
 (like a good minute or more) then it finally compiles.
 It makes doing anything REALLY painful and SLWWW!  Its like its
 running on a real low end pc, and it isnt.

 Anyone else had this?


 Jeremy


 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz

 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
 unsubscribe



 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe



 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 jscoul...@gmail.com wrote:

 well after all my posts, I had to do a reboot, and hey presto, not my PC is
 fine again, even tho I rebooted earlier.
 the thing I am enjoying about the IDEFix is that if you have an error in
 code, code-complete STILL WORKS !!! thats a big improvment IMHO.
 It does seem a bit snappier too...but that might be just because of the
 problem i was haveing before my reboot.

 Jeremy

 On Tue, Nov 9, 2010 at 2:48 PM, John Bird johnkb...@paradise.net.nzwrote:

   Is this IDEFixPack worth installing for D2007?  This rings a bell – I
 might have tried this or something like it when D2007 first came out, and it
 made little difference.   What really did make a huge difference was
 doubling my RAM.   It was obviously having to swap different parts of the
 IDE into memory.

 In general D2007 works just fine – occasionally goes off into cuckoo land
 when looking up code completion or syntax checking for 10-20secs, but not
 often enough to need to do anything.

 What are others experience with these IDEFixPacks?   Worth bothering
 about?




 John


  If you're game, there is an updated beta IDEFixPack from* *Andreas
 Hausladen http://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 jscoul...@gmail.com wrote:

 yes I think its the code-complete stuff too. After its compiled and run
 thru the IDE once then I run it again straight away, it runs straight away
 as you would expect. aghhate computers :-)




 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe



 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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, CreateRectRgn(7, 14,
 ARadioGroup.Width - 2, ARadioGroup.Height - 2), True);
 end;

 HTH

 Cheng Wei
 Software Development Manager
 Fairview Metal Industries

 M   +64 21 410 776
 P+64 9 984 4917
 F+64 9 984 4993
  che...@fmi.co.nz
  www.fmi.co.nz


 |-Original Message-
 |From: delphi-boun...@delphi.org.nz
 |[mailto:delphi-boun...@delphi.org.nz] On Behalf Of Ayers, Stephen
 |Sent: Friday, 5 November 2010 11:15 a.m.
 |To: delphi@delphi.org.nz
 |Subject: [DUG] TradioGroup without a border
 |
 |Hi there
 |
 |Does anyone know how to remove the border from a TRadioGroup?
 |I can not seem to find a property that does this, either I am
 |blind or there isn't one.  Any help would be appreciated.
 |
 |Thanks
 |
 |
 |
 |___
 |NZ Borland Developers Group - Delphi mailing list
 |Post: delphi@delphi.org.nz
 |Admin: http://delphi.org.nz/mailman/listinfo/delphi
 |Unsubscribe: send an email to delphi-requ...@delphi.org.nz
 |with Subject: unsubscribe
 |

 #
 Scanned by MailMarshal - M86 Security's comprehensive email content
 security solution.
 Download a free evaluation of MailMarshal at www.m86security.com

 #

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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, did they ever get around to fixing those reported bugs this
time round. From my understanding of the history of Delphi, during that time
(8 years ago) Borland really turned its back on Delphi in its push to get
away from its dev tool roots. But in the last year or two EMBT had made a
big effort to address those concerns and really tackle a lot of those cases
in QC. Did they deliver?

Cheers,
Colin
___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 handles imported other formats
 to make them into icons.





 From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On
 Behalf Of Jolyon Smith
 Sent: Thursday, 22 July 2010 9:57 a.m.
 To: 'NZ Borland Developers Group - Delphi List'
 Subject: Re: [DUG] Icon



 As far as I can tell, Paint.NET (as of the 3.5.5 release at least) doesn’t
 support the ICO format either for reading or writing, which pretty
 effectively limits its usefulness for converting to/from ICO files.  J





 From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On
 Behalf Of Eric A
 Sent: Thursday, 22 July 2010 09:38
 To: delphi@delphi.org.nz
 Subject: Re: [DUG] Icon



 I use Paint .NET but prefer the GIMP (Windows) for graphics manipulation (I
 think that does the conversion too?)

 Eric

 From: johnkb...@paradise.net.nz
 To: delphi@delphi.org.nz
 Date: Wed, 21 Jul 2010 08:46:41 +1200
 Subject: Re: [DUG] Icon

 I think it disappeared in later Delphi,

 I use any of IrfanView, PhotoFiltre, Paint.Net - all freeware - Irfanview
 is a converter and viewer, the other two are excellent image editors and
 convert too.

 What do others use?

 John

 --
 From: David del...@275a.com
 Sent: Wednesday, July 21, 2010 8:14 AM
 To: NZ Borland Developers Group - Delphi List delphi@delphi.org.nz
 Subject: Re: [DUG] Icon

  Hi,
 
  Not sure about BDS2006 but many Delphis have Alt-Tools-Image Editor
  In there you can open the bitmap, copy it to clipboard, then make a new
  icon and paste the bitmap in
  then you just select the transparency colour and fill in the background.
 
 
  Bob Pawley wrote:
  Hi
 
  Can someone suggest a tool for converting a BMP to Icon?
 
  I don't suppose my BDS 2006 this capability??
 
  Bob
 
 
  __ Information from ESET Smart Security, version of virus
  signature database 5296 (20100720) __
 
  The message was checked by ESET Smart Security.
 
  http://www.eset.com
 
  
 
  ___
  NZ Borland Developers Group - Delphi mailing list
  Post: delphi@delphi.org.nz
  Admin: http://delphi.org.nz/mailman/listinfo/delphi
  Unsubscribe: send an email to delphi-requ...@delphi.org.nz with
  Subject:
  unsubscribe
 
 
  __ Information from ESET Smart Security, version of virus
  signature database 5296 (20100720) __
 
  The message was checked by ESET Smart Security.
 
  http://www.eset.com
 
 
 
 
 
  __ Information from ESET Smart Security, version of virus
  signature database 5296 (20100720) __
 
  The message was checked by ESET Smart Security.
 
  http://www.eset.com
 
 
  ___
  NZ Borland Developers Group - Delphi mailing list
  Post: delphi@delphi.org.nz
  Admin: http://delphi.org.nz/mailman/listinfo/delphi
  Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
  unsubscribe


 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

 
 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe


___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


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 make sense, you could possibly extract a base class out of your
existing class and have that in another unit.
Or rather than extracting out a base class, you can make your classes
more coherent by redefining them based on their functionality. eg an
order class that maintains a list of order items, calculates their
totals and taxes and generates a printed invoice can be broken into
several smaller (but associated) classes - one for maintaining items,
one for calculating totals and taxes and another for printing
invoices.

Just a thought,

Colin

On 5 July 2010 13:50, Leigh Wanstead lei...@softtech.co.nz wrote:
 Good afternoon,



 I am facing a trouble. Some of the class I wrote reaches more than 1600
 lines. I don’t like it. The methods in the class are ordinary range from one
 line to 200 lines. I really like each method sitting in their own unit.
  Just like abap in sap. It is easy to maintain 200 lines in a source code
 unit than 2000 lines.



 Without using include, what can I do?



 BTW, I don’t understand why classes.pas in Delphi contain 11103 lines? Just
 to save Delphi programmer less uses clause?



 TIA



 Regards

 Leigh

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe


___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


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 code
is in manageable and maintainable chunks.

If your form unit is growing then you definitely have a problem of
embedding your business code with your UI code.

This article isn't strictly about Delphi but it was an inspiration for
me with regards to not junking my forms with business code. Its
simplistic but the idea behind it is good.

The Humble Dialog box
www.objectmentor.com/resources/articles/TheHumbleDialogBox.pdf

Cheers,
Colin
___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


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 July 2010 08:39, Bob Pawley rjpaw...@shaw.ca wrote:
 Hi John

 I set up the data aware components and datasets in a trial project and
 everything worked fine.

 I then created a second datamodule (DM2) within the original project and
 copied the dataset and table to it, then connected the data aware components
 from the main form..

 This worked well. So I am now pretty certain it has something to do with the
 datamodule form itself (DM1).

 You suggested settings not being loaded at the correct time. I would
 appreciate some idea of how to check this out.

 I could just rebuild the project on DM2, however that's no guarantee that it
 won't happen again.

 The ini file itself seems ok - at least to me.

 Bob
 From: John Bird
 Sent: Thursday, July 01, 2010 5:24 PM
 To: NZ Borland Developers Group - Delphi List
 Subject: Re: [DUG] Windows 7
 I have D2007 on Windows 7, as far as I know I haven't used a Data module on
 yet.   However I have used a data module in a project running inside a
 VMWare XP virtual PC on the Windows 7 box definitely with no problem
 accessing databases.   I do recall that the 'Database Not Set'  might be
 caused by some settings (loaded from an ini file) not yet being in place
 when the Form Create runs, so you might want to make sure this is not what
 is behind it.   I had similar problems which were due to that.

 If you are still stuck let me know, I could try a quick project - but I have
 D2007 not 2006.

 John

 Hi

 I've just installed my BDS 2006 based project on Windows 7.

 I have data aware components on a form communicating with datasets and
 tables on a Data Module Form (DM1).

 I have no problem when the database is empty. I can compile the project,
 enter information into the databases and close the project and the
 information is distributed properly.

 However, when I attempt to re-open the project (with the database containing
 information) it gives me a 'database not set' error and fails to compile.

 When I move the dataset and table to the component form and reconnect them
 to the components on the same form, the project compiles and I can add and
 delete information and re-compile with no problem.

 It seems that the problem may lay in a communication problem from the DM1 to
 the components.

 Is this possible??

 Bob

 

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

 

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe


___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


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 for Date
 selections what is set for the time component?  Or is it random?   I am
 wondering because two different pickers seem to return unrelated times and
 it looks like  I have to do some testing and correcting.

 And for testing - I think that a test such as

 if DatePicker1.date = date then..

 might not be a reliable test (if both are effectively floating point)

 This is D5 in case later versions have smarter testing

 John


 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 Apple) so only apps (originally) developed in C, Objective
C or C++ will be accepted by the App Store.

Cheers,
Colin
___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 and have no real idea as to
whether the gatekeepers at Apple will or wont stop this kind of development
as well.

Regards,
Colin

On 5 May 2010 14:05, Jolyon Smith jsm...@deltics.co.nz wrote:

  I'm not sure that the new licensing is an issue for monotouch as they
  support iPhoneOS 4 presently - I think the licensing is more aimed at
  Adobe (I'm not sure why Apple hates flash so much).  But I'm sure
  others on this list know more about this than I.


 The language in the license quite clearly and obviously applies equally to
 MonoTouch.

 Novell would have been working on 4.0 support long before the license terms
 were changed.  So of course they announced support for it, they weren't
 about to throw all that work away.  And MonotTouch can support OS 4.0
 without violating the license.  People can even still use it to develop
 apps
 without violating the license.  The license only affects whether those apps
 will then be permitted access to the store.

 It's like the landlord in your pub... he will happily sell you beer.  If on
 the way home you then get pulled over and arrested for drunk driving, well,
 that's between you and the law, nothing to do with the landlord.  (don't
 pull too closely at that analogy... landlords typically are limited by the
 law in some respects, e.g. to not serve intoxicated persons, but someone
 doesn't have to be intoxicated to be over the drink drive limit).


 But whole debacle is a bit pointless.

 The license also already gave Apple the right to deny access to/withdraw
 any
 app from the store without reason.  By introducing this language I think
 they are covering their legal backsides against a potential law suit from
 someone who feels their development language/tool/framework is being
 specifically and unfairly targeted by Apple.

 This language gives them plausible cause:  The license clearly states...
 etc etc, so we're sorry, but all those applications written in/for your
 product willfully violated those terms. You knew that when you started
 developing/selling/marketing your product to developers.


 Presently they have Adobe Flash in the public gun-sights - the MonoTouch
 guys aren't being targeted at present (but neither have Apple said that
 MonoTouch escapes being covered by the license language).

 The bottom line is that anyone using MonoTouch to deploy code written in
 Delphi Prism, C# or any language other than those specifically allowed in
 the license for iPhone/iPad cannot now complain in the future if they have
 their app pulled/denied access to the store on the basis of it being a
 MonoTouch app.

 They couldn't complain before either of course, but a single developer
 irked
 at not being allowed to distribute his app isn't who the license is aimed
 at... it's aimed at the legal departments of the
 language/tool/framework/runtime vendors that those developers might choose
 to use.


 Just my 0.02

  -Original Message-
  From: delphi-boun...@delphi.org.nz [mailto:delphi-
  boun...@delphi.org.nz] On Behalf Of Alister Christie
  Sent: Wednesday, 5 May 2010 3:28 p.m.
  To: NZ Borland Developers Group - Delphi List
  Subject: Re: [DUG] Delphi on Windows Mobile
 

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

Re: [DUG] Delphi on Windows Mobile

2010-05-04 Thread Colin Johnsun
I guess that's the way things are going now.

If you want to develop of Windows Mobile 7 then you need to do it with
Silverlight.
If you want to develop for Android or WebOS then get yourself up on Java.
If you want to develop for the iPhone/iPad then start learning Objective-C.


On 5 May 2010 14:11, Colin Fraser colin.fra...@hill-labs.co.nz wrote:

 I imagine that will be a very big _ouch_ for some people...

 I have done a bit of playing with the Android API... not that hard
 really... though I had a small amount of java and Eclipse experience
 already.

 Regards
 Colin




 On 5/05/2010, 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, the rules have
 been changed (by Apple) so only apps (originally) developed in C, Objective
 C or C++ will be accepted by the App Store.

 Cheers,
 Colin
 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe


  --

 *Attention:*

 The information in this email and in any attachments is confidential. If
 you are not the intended recipient then please do not distribute, copy or
 use this information. Please notify us immediately by return email and then
 delete the message from your computer. Any views or opinions presented are
 solely those of the author.

 --


 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 27/04/2010 10:52 a.m., David O'Brien wrote:

  Why the four quotes in the false and a space in the true?



 I would use something like:



 DBCheckBox4.Enabled := not (DBEdit2.Text = '') ;



 *From:* delphi-boun...@delphi.org.nz 
 [mailto:delphi-boun...@delphi.org.nzdelphi-boun...@delphi.org.nz]
 *On Behalf Of *Bob Pawley
 *Sent:* Tuesday, 27 April 2010 10:39 a.m.
 *To:* NZ Borland Developers Group - Delphi List
 *Subject:* [DUG] Enable CheckBox



 Hi



 I am attempting to enable a checkbox only when a DBEdit has a value.
 (Disabled when no string in DBEdit.)



 Following is my code which disables the CheckBox after a delete from the
 DBEdit.



 But it is not enabled when I add a string to the DBEdit.

 --

 procedure TForm4.DBEdit2Change(Sender: TObject);
 begin



  if
   DBEdit2.Text = ' '



   then
   DBCheckBox4.Enabled := True



   Else if DBEdit2.Text = 



   then
DBCheckBox4.Enabled := False ;



 end;



 Thanks for any help.



 Bob


 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
 unsubscribe



 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 me, but “A doesn’t equal B” surely reads more closely to
 the *real meaning* than “not (A does equal B)”.



 Apart from anything else, the latter *requires* parentheses to avoid the
 compiler getting confused and trying to do : “(Not A) equals (B)”.  i.e. the
 latter syntax is also to the compiler less close to the real meaning (since
 it requires disambiguation).



 From a human perspective the scanning is more fluid:  A  B, reads left to
 right entirely as intended:  “A does not equal B”.



 NOT (A = B) on the other hand requires me to read it like a syntax tree
 parser:  “NOT “ … (OK, store the fact that I have to logically invert what
 follows, keep a mental note of parentheses) … then what follows is “( A is
 equal to B )” , right OK, so “A is equal to B inverted”, i.e. A does not
 equal B.



 In other words, exactly what is menat literally and clearly when I write… A
  B.



 But as I say, maybe it’s just me.



 NOT (I think like a computer).



 ;)



___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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 email and any attachments are confidential. If received in error 
 please destroy and immediately notify us. Do not copy or disclose the 
 contents.

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe


Re: [DUG] Need help in format function

2010-03-03 Thread Colin Johnsun
I don't remember reading in the original post that Vikas needed the function
in a multi-threaded app?
In fact, the original FloatToStrF that Vikas used in his original post is
the non-threaded version, so I think it is reasonable to assume that he was
using it in a single threaded fashion. But thanks for pointing out how
useless *Format ( Const Formatting  : string; Const Data  : array of const)
: string; *is for multi-threaded situations.

Regards,
Colin

On 4 March 2010 08:07, Cameron Hart cameron.h...@flowsoftware.co.nz wrote:

 And completely useless when it comes to multiple threads...

 Atleast use the thread safe version

 function Format ( Const Formatting  : string; Const Data  : array of
 const; FormatSettings  : TFormatSettings ) : string;



 Cameron Hart | Development Manager | Flow Software Limited
 P: +64 9 476 3579 | M: +64 21 222 3569 | E:
 cameron.h...@flowsoftware.co.nz
 PO Box 305-237, Triton Plaza, Auckland 0757, New Zealand |
 www.flowsoftware.co.nz

 This message is intended for the addressee named above. It may contain
 privileged or confidential information. If you are not the intended
 recipient of this message you must not use, copy, distribute 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
 Subject: Re: [DUG] Need help in format function

 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 email and any attachments are confidential. If received
 in error please destroy and immediately notify us. Do not copy or
 disclose the contents.
 
  ___
  NZ Borland Developers Group - Delphi mailing list
  Post: delphi@delphi.org.nz
  Admin: http://delphi.org.nz/mailman/listinfo/delphi
  Unsubscribe: send an email to delphi-requ...@delphi.org.nz with
 Subject: unsubscribe
 
 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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.
 Its taken me most of the moring to get updated controls, install them,
 convert strings etc.etc. but this one has stumpted me.

 I am inserting some data into a blob field in Interbase like so (or
 similar)

 IBQuery1.ParamByName('blobby').AsBlob := 'This is the data to go into the
 blob field';

 Now interesingly enough, this works fine In D7 and D2007, but D2010 says
 [DCC Error] untWebEPortal.pas(2223): E2010 Incompatible types: 'TBytes' and
 'string'

 I guess I now have to do something else, can someone point me in the right
 direction?

 Jeremy

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

Re: [DUG] Interbase Blobs in Delphi 2010

2010-03-03 Thread Colin Johnsun
Well alternatively, you can try passing in an AnsiString into your blob
field. I haven't tried it myself but it may be worth a go.

Colin

On 4 March 2010 12:21, Jeremy Coulter jscoul...@gmail.com wrote:

 well, the thing is, this IS a blob field not a string field. but I will
 give it a try

 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...@gmail.com wrote:

  Hi All.
 I am just working thru converting a D2007 app to D2010.
 Its taken me most of the moring to get updated controls, install them,
 convert strings etc.etc. but this one has stumpted me.

 I am inserting some data into a blob field in Interbase like so (or
 similar)

 IBQuery1.ParamByName('blobby').AsBlob := 'This is the data to go into the
 blob field';

 Now interesingly enough, this works fine In D7 and D2007, but D2010 says
 [DCC Error] untWebEPortal.pas(2223): E2010 Incompatible types: 'TBytes' and
 'string'

 I guess I now have to do something else, can someone point me in the
 right direction?

 Jeremy

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe



 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe



 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

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
 Senior Developer
 Soft Tech (NZ) ltd

 On 24 February 2010 09:43, Rohit Gupta r.gu...@xtra.co.nz wrote:

 Is anyone going to the ADUG symposium ?  If so, Melbourne or Canberra ?

 Rohit

 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe



 ___
 NZ Borland Developers Group - Delphi mailing list
 Post: delphi@delphi.org.nz
 Admin: http://delphi.org.nz/mailman/listinfo/delphi
 Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject:
 unsubscribe

___
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe