[DUG] Produce PDF from text file

2011-08-03 Thread John Bird
Using D2007 and Rave reports - should be easy to produce a PDF version of a 
text file report.

The reports need to be printed using a non-proportional font, which is why I 
would like to use PDF rather than Notepad (which is often set to display in 
proportional fonts and users do not know how to change it).

Anyone have sample code/examples?

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


Re: [DUG] Email/SMTP code

2011-08-03 Thread John Bird
Have code working now nicely, email me if anyone wants what I am using.

Is there a way to find the default settings from Outlook or Registry for:

1 - smtp setting
2 - users email address (for the From: address)

At present I have to ask the users for this, should ideally be set from default 
email program settings.

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

Re: [DUG] Email/SMTP code

2011-07-16 Thread John Bird
FYI Your original version had a small error in it that you fixed in the later 
version you posted – at the IdMessage.free line – which I should already been 
free’d by the previous SMTP.free, ie the IdMessage.free was not needed

John

From: David O'Brien 
Sent: Tuesday, July 12, 2011 2:01 PM
To: NZ Borland Developers Group - Delphi List 
Subject: Re: [DUG] Email/SMTP code

Wrote this a while ago, but still works...

 

procedure SendEmail(msgFrom, msgTo, msgSubject: String; msgBody: TStringList; 
Attachments: TStringList) ;

var

  IdMessage: TIdMessage;

  SMTP: TIdSMTP;

  t: TDateTime ;

  i: Integer ;

begin

  try

if ASettings.SMTPServer  '' then

begin

  SMTP := TidSMTP.Create(nil) ;

  IdMessage := TIdMessage.Create(SMTP);

  try

idMessage.Clear ;

idMessage.From.Address := msgFrom ;

idMessage.Recipients.Add.Address := msgTo ;

idMessage.Subject := msgSubject ;

if pos('html', lowercase(msgBody.Text))  0 then

  idMessage.ContentType := 'text/html' ;

if msgBody  nil then

  IdMessage.Body.Assign(msgBody) ;

t := now ;

while (SMTP.Connected) and

  (now  t + 10 * (1/86400)) do // 10 Seconds

  sleep(10) ;

if Assigned(Attachments) then

  for i := 0 to pred(Attachments.Count) do

TIdAttachmentFile.Create(IdMessage.MessageParts, Attachments[i]) ;

SMTP.Host := ASettings.SMTPServer ;

SMTP.Port := ASettings.SMTPPort ;

SMTP.Username := ASettings.Username ;

SMTP.Password := ASettings.Password ;

SMTP.Connect ;

try

  SMTP.Send(idMessage) ;

finally

  SMTP.Disconnect ;

end ;

  finally

SMTP.Free ;

IdMessage.Free ;

  end;

end;

  except

EmailFailed := True ;

  end ;

end ;

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of John Bird
Sent: Tuesday, 12 July 2011 1:47 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] Email/SMTP code

 

Anyone got a recommendation for the best (free) code/samples to drive Indy10 
for sending an email with attachment

 

-Indy10.2.3

-Send attachment

-SMTP server and email addresses will be known

 

I have tried a couple (eg AtoZed SendMail example) but it seems to time out 
connecting to the SMTP 

 

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] Email/SMTP code

2011-07-14 Thread John Bird
Trying to debug this SMTP program, having tweaked the code a little – I am 
getting “Connection timed out” 

However I cannot debug, as on Windows 7 this program requires admin access.

I restarted the IDE (BDS.EXE) running as administrator but still get the error 
message

“Cannot create process”   (Debug)

or

“Access denied”  (Run without debugger).

Can run the program outside of the IDE by right clicking and selecting “Run as 
administrator” but there is no debugging then!

What have I missed?

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

Re: [DUG] Email/SMTP code

2011-07-14 Thread John Bird
It looks like its the presence of the SMTP and IdMessage components that cause 
the UAC (Admin access)there is only this unit and a test unit to drive it...

Any ideas why running IDE as administrator on Windows 7 still will not debug?


John

 

From: David O'Brien 
Sent: Thursday, July 14, 2011 7:12 PM
To: NZ Borland Developers Group - Delphi List 
Subject: Re: [DUG] Email/SMTP code

Put the code in another project that doesn’t require admin access?

What server are you pointing at, and are you going through a proxy server?

 

Username  password are both blank in my implementation.

 

Here is a bit more up to date version from another project, this returns any 
error message.

function SendEmail(msgFrom, msgTo, msgCC, msgBCC, msgSubject: String; msgBody: 
TStringList; Attachments: TStringList): String ;

var

  IdMessage: TIdMessage;

  SMTP: TIdSMTP;

  t: TDateTime ;

  i: Integer ;

begin

  Result := '' ;

  try

if ASettings.SMTPServer  '' then

begin

  SMTP := TidSMTP.Create(nil) ;

  IdMessage := TIdMessage.Create(SMTP);

  try

MsgTo := Trim(MsgTo) ;

if Length(MsgTo)  0 then

  if MsgTo[Length(MsgTo)] = ';' then

Delete(MsgTo, Length(MsgTo), 1) ;

MsgCC := Trim(MsgCC) ;

if Length(MsgCC)  0 then

  if MsgCC[Length(MsgCC)] = ';' then

Delete(MsgCC, Length(MsgCC), 1) ;

MsgBCC := Trim(MsgBCC) ;

if Length(MsgBCC)  0 then

  if MsgBCC[Length(MsgBCC)] = ';' then

Delete(MsgBCC, Length(MsgBCC), 1) ;

idMessage.Clear ;

idMessage.From.Address := msgFrom ;

if MsgTo  '' then

  idMessage.Recipients.Add.Address := msgTo ;

if MsgCC  '' then

  idMessage.CCList.Add.Address := msgCC ;

if MsgBCC  '' then

  idMessage.BccList.Add.Address := msgBCC ;

idMessage.Subject := msgSubject ;

with TIdText.Create(IdMessage.MessageParts, nil) do

begin

  Body.Assign(msgBody) ;

  ContentType := 'text/html';

end;

if Assigned(Attachments) then

  for i := 0 to pred(Attachments.Count) do

with TIdAttachmentFile.Create(idMessage.MessageParts, 
Attachments[i]) do

begin

  ContentID := inttoStr(1000+i) ;

  ContentType := 'image/jpeg' ;

  Filename := ExtractFileName(Attachments[i]) ;

end;

t := now ;

while (SMTP.Connected) and

  (now  t + 10 * (1/86400)) do // 10 Seconds

  sleep(10) ;

SMTP.Host := ASettings.SMTPServer ;

SMTP.Port := ASettings.SMTPPort ;

SMTP.Username := ASettings.Username ;

SMTP.Password := ASettings.Password ;

SMTP.Connect ;

try

  SMTP.Send(idMessage) ;

finally

  SMTP.Disconnect ;

end ;

  finally

SMTP.Free ;

  end;

end;

  except

on e: Exception do

begin

  Result := msgTo+': '+e.Message ;

  EmailFailed := True ;

end;

  end ;

end ;

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of John Bird
Sent: Thursday, 14 July 2011 6:06 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Email/SMTP code

 

Trying to debug this SMTP program, having tweaked the code a little – I am 
getting “Connection timed out” 

 

However I cannot debug, as on Windows 7 this program requires admin access.

 

I restarted the IDE (BDS.EXE) running as administrator but still get the error 
message

 

“Cannot create process”   (Debug)

 

or

 

“Access denied”  (Run without debugger).

 

Can run the program outside of the IDE by right clicking and selecting “Run as 
administrator” but there is no debugging then!

 

What have I missed?

 

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] Email/SMTP code

2011-07-14 Thread John Bird
Here is details of the “unable to create process” when I try to debug the SMTP 
test program on Windows 7, with the IDE running as administrator

in case anyone has a bright idea whats going on

[20885408]{dbkdebugide100.bpl} Debug.TDebugger.DBKError (Line 11445, 
Debug.pas + 3) + $23
[20852DB1]{dbkdebugide100.bpl} DbkHelper.CheckRetVal (Line 268, DbkHelper.pas 
+ 4) + $8
[20852D31]{dbkdebugide100.bpl} DbkHelper.ErrCode (Line 249, DbkHelper.pas + 
1) + $2
[20877C62]{dbkdebugide100.bpl} Debug.TDebugKernel.CreateProcess (Line 5070, 
Debug.pas + 14) + $2
[20883115]{dbkdebugide100.bpl} Debug.TDebugger.DoCreateProcess (Line 10403, 
Debug.pas + 29) + $36
[20883228]{dbkdebugide100.bpl} Debug.TDebugger.CreateProcess (Line 10429, 
Debug.pas + 6) + $2B
[20883D6D]{dbkdebugide100.bpl} Debug.TDebugger.Run (Line 10869, Debug.pas + 
50) + $2D
[208844FA]{dbkdebugide100.bpl} Debug.TDebugger.Run (Line 11120, Debug.pas + 
70) + $37
[2087F40A]{dbkdebugide100.bpl} Debug.TDebugger.Run (Line 9001, Debug.pas + 0) 
+ $2
[20A469E1]{coreide100.bpl} DebuggerMgr.TDebuggerMgr.Run (Line 1410, 
DebuggerMgr.pas + 4) + $F
[004164FF]{bds.exe } AppMain.TAppBuilder.RunRun (Line 2844, 
ui\AppMain.pas + 0) + $7
[2004018B]{rtl100.bpl  } Classes.TBasicAction.Execute (Line 11081, 
common\Classes.pas + 3) + $7
[20151359]{vcl100.bpl  } ActnList.TContainedAction.Execute (Line 388, 
ActnList.pas + 1) + $2C
[201520BC]{vcl100.bpl  } ActnList.TCustomAction.Execute (Line 1000, 
ActnList.pas + 7) + $8
[20040057]{rtl100.bpl  } Classes.TBasicActionLink.Execute (Line 11010, 
common\Classes.pas + 2) + $7
[2013CA15]{vcl100.bpl  } Controls.TControl.Click (Line 5227, Controls.pas + 
7) + $7
[2019BCF0]{vcl100.bpl  } ComCtrls.TToolButton.Click (Line 17003, ComCtrls.pas 
+ 0) + $0
[2013CEA7]{vcl100.bpl  } Controls.TControl.WMLButtonUp (Line 5365, 
Controls.pas + 6) + $3E
[2013C527]{vcl100.bpl  } Controls.TControl.WndProc (Line 5146, Controls.pas + 
83) + $6
[2013C1B4]{vcl100.bpl  } Controls.TControl.Perform (Line 5021, Controls.pas + 
5) + $C
[2013FEC6]{vcl100.bpl  } Controls.GetControlAtPos (Line 7095, Controls.pas + 
4) + $73
[2013FF8E]{vcl100.bpl  } Controls.TWinControl.ControlAtPos (Line 7118, 
Controls.pas + 13) + $E
[2013C1B4]{vcl100.bpl  } Controls.TControl.Perform (Line 5021, Controls.pas + 
5) + $C
[20140199]{vcl100.bpl  } Controls.TWinControl.IsControlMouseMsg (Line 7182, 
Controls.pas + 15) + $1F
[20140561]{vcl100.bpl  } Controls.TWinControl.WndProc (Line 7269, 
Controls.pas + 76) + $6
[2019DD33]{vcl100.bpl  } ComCtrls.TToolBar.UpdateButtonState (Line 18148, 
ComCtrls.pas + 5) + $1C
[2019DD76]{vcl100.bpl  } ComCtrls.TToolBar.UpdateButtonStates (Line 18158, 
ComCtrls.pas + 3) + $4
[201A06A9]{vcl100.bpl  } ComCtrls.TToolBar.WndProc (Line 19588, ComCtrls.pas 
+ 80) + $6
[2013FDD0]{vcl100.bpl  } Controls.TWinControl.MainWndProc (Line 7073, 
Controls.pas + 3) + $6
[20040E4C]{rtl100.bpl  } Classes.StdWndProc (Line 11583, common\Classes.pas + 
8) + $0
[20163691]{vcl100.bpl  } Forms.TApplication.StopHintTimer (Line 8673, 
Forms.pas + 3) + $6
[201625F0]{vcl100.bpl  } Forms.TApplication.ProcessMessage (Line 8105, 
Forms.pas + 23) + $1
[2016262A]{vcl100.bpl  } Forms.TApplication.HandleMessage (Line 8124, 
Forms.pas + 1) + $4
[2016291F]{vcl100.bpl  } Forms.TApplication.Run (Line 8223, Forms.pas + 20) + 
$3
[0042297A]{bds.exe } bds.bds (Line 195,  + 7) + $7

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

Re: [DUG] Email/SMTP code

2011-07-14 Thread John Bird
FYI - Removed a not needed SMTP component from the test project and restarted 
the PC – I think it was the latter, that somehow Windows 7 remembered something 
about the project/exe and still put UAC on it.   Then debugger worked without 
Run as Administrator.

John Bird
JBCL
Contact:
johnkb...@paradise.net.nz
jbc...@xtra.co.nz
027 4844528
http://www.jbcl.co.nz
http://jbclnz.googlepages.com



From: Leigh Wanstead 
Sent: Friday, July 15, 2011 11:37 AM
To: NZ Borland Developers Group - Delphi List 
Subject: Re: [DUG] Email/SMTP code

Why not get a Windows XP to debug? Shall not be that hard, right?


2011/7/14 John Bird johnkb...@paradise.net.nz

  Here is details of the “unable to create process” when I try to debug the 
SMTP test program on Windows 7, with the IDE running as administrator

  in case anyone has a bright idea whats going on

  [20885408]{dbkdebugide100.bpl} Debug.TDebugger.DBKError (Line 11445, 
Debug.pas + 3) + $23
  [20852DB1]{dbkdebugide100.bpl} DbkHelper.CheckRetVal (Line 268, 
DbkHelper.pas + 4) + $8
  [20852D31]{dbkdebugide100.bpl} DbkHelper.ErrCode (Line 249, DbkHelper.pas + 
1) + $2
  [20877C62]{dbkdebugide100.bpl} Debug.TDebugKernel.CreateProcess (Line 5070, 
Debug.pas + 14) + $2
  [20883115]{dbkdebugide100.bpl} Debug.TDebugger.DoCreateProcess (Line 10403, 
Debug.pas + 29) + $36
  [20883228]{dbkdebugide100.bpl} Debug.TDebugger.CreateProcess (Line 10429, 
Debug.pas + 6) + $2B
  [20883D6D]{dbkdebugide100.bpl} Debug.TDebugger.Run (Line 10869, Debug.pas + 
50) + $2D
  [208844FA]{dbkdebugide100.bpl} Debug.TDebugger.Run (Line 11120, Debug.pas + 
70) + $37
  [2087F40A]{dbkdebugide100.bpl} Debug.TDebugger.Run (Line 9001, Debug.pas + 
0) + $2
  [20A469E1]{coreide100.bpl} DebuggerMgr.TDebuggerMgr.Run (Line 1410, 
DebuggerMgr.pas + 4) + $F
  [004164FF]{bds.exe } AppMain.TAppBuilder.RunRun (Line 2844, 
ui\AppMain.pas + 0) + $7
  [2004018B]{rtl100.bpl  } Classes.TBasicAction.Execute (Line 11081, 
common\Classes.pas + 3) + $7
  [20151359]{vcl100.bpl  } ActnList.TContainedAction.Execute (Line 388, 
ActnList.pas + 1) + $2C
  [201520BC]{vcl100.bpl  } ActnList.TCustomAction.Execute (Line 1000, 
ActnList.pas + 7) + $8
  [20040057]{rtl100.bpl  } Classes.TBasicActionLink.Execute (Line 11010, 
common\Classes.pas + 2) + $7
  [2013CA15]{vcl100.bpl  } Controls.TControl.Click (Line 5227, Controls.pas + 
7) + $7
  [2019BCF0]{vcl100.bpl  } ComCtrls.TToolButton.Click (Line 17003, 
ComCtrls.pas + 0) + $0
  [2013CEA7]{vcl100.bpl  } Controls.TControl.WMLButtonUp (Line 5365, 
Controls.pas + 6) + $3E
  [2013C527]{vcl100.bpl  } Controls.TControl.WndProc (Line 5146, Controls.pas 
+ 83) + $6
  [2013C1B4]{vcl100.bpl  } Controls.TControl.Perform (Line 5021, Controls.pas 
+ 5) + $C
  [2013FEC6]{vcl100.bpl  } Controls.GetControlAtPos (Line 7095, Controls.pas 
+ 4) + $73
  [2013FF8E]{vcl100.bpl  } Controls.TWinControl.ControlAtPos (Line 7118, 
Controls.pas + 13) + $E
  [2013C1B4]{vcl100.bpl  } Controls.TControl.Perform (Line 5021, Controls.pas 
+ 5) + $C
  [20140199]{vcl100.bpl  } Controls.TWinControl.IsControlMouseMsg (Line 7182, 
Controls.pas + 15) + $1F
  [20140561]{vcl100.bpl  } Controls.TWinControl.WndProc (Line 7269, 
Controls.pas + 76) + $6
  [2019DD33]{vcl100.bpl  } ComCtrls.TToolBar.UpdateButtonState (Line 18148, 
ComCtrls.pas + 5) + $1C
  [2019DD76]{vcl100.bpl  } ComCtrls.TToolBar.UpdateButtonStates (Line 18158, 
ComCtrls.pas + 3) + $4
  [201A06A9]{vcl100.bpl  } ComCtrls.TToolBar.WndProc (Line 19588, 
ComCtrls.pas + 80) + $6
  [2013FDD0]{vcl100.bpl  } Controls.TWinControl.MainWndProc (Line 7073, 
Controls.pas + 3) + $6
  [20040E4C]{rtl100.bpl  } Classes.StdWndProc (Line 11583, common\Classes.pas 
+ 8) + $0
  [20163691]{vcl100.bpl  } Forms.TApplication.StopHintTimer (Line 8673, 
Forms.pas + 3) + $6
  [201625F0]{vcl100.bpl  } Forms.TApplication.ProcessMessage (Line 8105, 
Forms.pas + 23) + $1
  [2016262A]{vcl100.bpl  } Forms.TApplication.HandleMessage (Line 8124, 
Forms.pas + 1) + $4
  [2016291F]{vcl100.bpl  } Forms.TApplication.Run (Line 8223, Forms.pas + 20) 
+ $3
  [0042297A]{bds.exe } bds.bds (Line 195,  + 7) + $7

  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___
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

[DUG] Email/SMTP code

2011-07-11 Thread John Bird
Anyone got a recommendation for the best (free) code/samples to drive Indy10 
for sending an email with attachment

-Indy10.2.3
-Send attachment
-SMTP server and email addresses will be known

I have tried a couple (eg AtoZed SendMail example) but it seems to time out 
connecting to the SMTP 

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

Re: [DUG] Email/SMTP code

2011-07-11 Thread John Bird
Looks good.

Couple of quick questions:

Is this Indy10?   (Indy is notorious for changing properties/names etc between 
versions)

Is Asettings a TidSMTP component?   haven’t figured out yet...

Do you have a copy of the uses clause just in case – I think I have it sorted

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, IdBaseComponent, IdComponent,
  IdTCPConnection, IdTCPClient, IdExplicitTLSClientServerBase,
  IdMessageClient, IdSMTPBase, IdSMTP, IdMessage, IdAttachmentFile;

John

 

From: David O'Brien 
Sent: Tuesday, July 12, 2011 2:01 PM
To: NZ Borland Developers Group - Delphi List 
Subject: Re: [DUG] Email/SMTP code

Wrote this a while ago, but still works...

 

procedure SendEmail(msgFrom, msgTo, msgSubject: String; msgBody: TStringList; 
Attachments: TStringList) ;

var

  IdMessage: TIdMessage;

  SMTP: TIdSMTP;

  t: TDateTime ;

  i: Integer ;

begin

  try

if ASettings.SMTPServer  '' then

begin

  SMTP := TidSMTP.Create(nil) ;

  IdMessage := TIdMessage.Create(SMTP);

  try

idMessage.Clear ;

idMessage.From.Address := msgFrom ;

idMessage.Recipients.Add.Address := msgTo ;

idMessage.Subject := msgSubject ;

if pos('html', lowercase(msgBody.Text))  0 then

  idMessage.ContentType := 'text/html' ;

if msgBody  nil then

  IdMessage.Body.Assign(msgBody) ;

t := now ;

while (SMTP.Connected) and

  (now  t + 10 * (1/86400)) do // 10 Seconds

  sleep(10) ;

if Assigned(Attachments) then

  for i := 0 to pred(Attachments.Count) do

TIdAttachmentFile.Create(IdMessage.MessageParts, Attachments[i]) ;

SMTP.Host := ASettings.SMTPServer ;

SMTP.Port := ASettings.SMTPPort ;

SMTP.Username := ASettings.Username ;

SMTP.Password := ASettings.Password ;

SMTP.Connect ;

try

  SMTP.Send(idMessage) ;

finally

  SMTP.Disconnect ;

end ;

  finally

SMTP.Free ;

IdMessage.Free ;

  end;

end;

  except

EmailFailed := True ;

  end ;

end ;

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of John Bird
Sent: Tuesday, 12 July 2011 1:47 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] Email/SMTP code

 

Anyone got a recommendation for the best (free) code/samples to drive Indy10 
for sending an email with attachment

 

-Indy10.2.3

-Send attachment

-SMTP server and email addresses will be known

 

I have tried a couple (eg AtoZed SendMail example) but it seems to time out 
connecting to the SMTP 

 

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] Variable in String

2011-06-28 Thread John Bird
Jolyon I imagine you have an opinion on doing this your way rather than like 
this example below – I would be interested in hearing your reasoning.

A similar example – this is the sort of code I have been using

setlength(temp, 100); //has to be big enough first
setlength(temp, getEnvironmentVariable(PChar('USERNAME'), PChar(temp), 
length(temp)));


John


From: Jolyon Smith 
Sent: Monday, June 27, 2011 10:07 AM
To: 'NZ Borland Developers Group - Delphi List' 
Subject: Re: [DUG] Variable in String

Sorry Bob, I meant to include an example of your code tweaked to use “raw” a 
char array with the Windows API routine.  Here it is (this version displays 
results rather than storing in a variable, but you get the idea J ) :

 

var

  dir: array of Char;

  s: String;

begin

  s := ‘’;

 

  SetLength(dir, MAX_PATH + 1);

  if Succeeded(SHGetFolderPath(0, CSIDL_Program_Files, 0, 0, @dir[0])) then

s := PChar(dir);

 

  ShowMessageFmt(s + ' (%d chars)', [Length(s)]);

 

  // Outcome:  s has both the right length *and* is null terminated correctly

end;

 

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of Bob Pawley
Sent: Monday, 27 June 2011 08:58
To: 'NZ Borland Developers Group - Delphi List'
Subject: Re: [DUG] Variable in String

 

Hi Jolyon

 

I was wondering if my problem is a conflict between how I derive the value of 
the variable (PAnsiChar).

 

Here is the code for doing that.

 

SetLength(sDir, MAX_PATH);

ZeroMemory(@sDir[1], MAX_PATH);

if Succeeded(SHGetFolderPath(0, CSIDL_Program_Files, 0, 0, PAnsiChar(sDir))) 
then

FW_Path := sDir;

 

Bob

 

From: Jolyon Smith 

Sent: Wednesday, June 22, 2011 3:49 PM

To: 'NZ Borland Developers Group - Delphi List' 

Subject: Re: [DUG] Variable in String

 

Don’t quote FW_Path element of the program path – you need to quote the entire 
path AND program file name when/if any part of the path or the filename itself 
does – or may – contain spaces:

 

e.g.   “path a\sub a\sub b\prog.exe”

 

not   “path a”\sub\prog.exe

 

 

So in your case, this should do the trick:

 

   FW_Path := X;  

   DXF := openDialog1.FileName;

   ProgramName := ‘”’ + FW_Path + '\FWTools2.4.7\bin\ogr2ogr” -f PostgreSQL 
PG:host=192 user=postgres dbname=E5R password= '+ DXF +' 
-nln Import_Process';

   ShowMessage(ProgramName);

 

 

hth

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of Bob Pawley
Sent: Thursday, 23 June 2011 10:30
To: DUG
Subject: [DUG] Variable in String

 

Hi

 

I’m having trouble with using a variable in a string path.

 

When I use the variable FW_Path := ‘C:\Program Files (x86)’ with two single 
quotes, the following works well and ShowMessage(ProgramName); displayed the 
full path .

 

When I reference FW_Path to a variable X I get an error returned “Can Not 
run” The variable  X is returned as C:\Program Files (x86) without quotes. 

 

I attempted Quote String and got the following ‘C:\Program Files (x86) with one 
single quote.

 

Both cases return the same error - and in both cases ShowMessage(ProgramName); 
displayed none of the path after C:\Program Files (x86).

 

Help would be appreciated.

 

Bob

 

   FW_Path := QuoteStr(X);  

  DXF  := openDialog1.FileName;

  ProgramName :=FW_Path+'\FWTools2.4.7\bin\ogr2ogr -f PostgreSQL 
PG:host=192 user=postgres dbname=E5R password= '+ DXF +' 
-nln Import_Process';

   ShowMessage(ProgramName);




___
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] Web development

2011-06-06 Thread John Bird
http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks

good overview - covers

1.1 Perl
1.2 PHP
1.3 Java
1.4 Python
1.5 Ruby
1.6 CFML (ColdFusion)
1.7 ASP.NET
1.8 Other

So I guess these are the major players.

John

-Original Message- 
From: Sean Cross
Sent: Tuesday, June 07, 2011 9:35 AM
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Web development

I am surprised no-one has mentioned Python + a framework such as Django.

When I switched to web dev, Python/Django and C#/asp.net mvc were the 2 
finalists.  I went with C# simply due to the ease of getting developers.

Don't use Delphi, it's entirely the wrong tool.

Sean


___
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] FW: Web development

2011-06-06 Thread John Bird
That was the MS principle - EEE

ie, Embrace, Extend (in a non-standard way), Extinguish (the alternatives).
They tried and failed that in the Java world already with J++

http://en.wikipedia.org/wiki/Visual_J%2B%2B

which includes the interesting quotes from internal MS emails:

Retrieved 2009-03-15. A September 1997 E-mail message, sent by a 
Microsoft official identified as P. Sridharan, is quoted as saying: Let's 
move on and steal the Java language. That said, have we ever taken a look at 
how long it would take Microsoft to build a cross-platform Java that did 
work? Naturally, we would never do it, but it would give us some idea of how 
much time we have to work with in killing Sun's Java.

^ Microsoft A History of Anticompetitive Behavior and Consumer Harm. 
European Committee for Interoperable Systems. 2009-03-31. Retrieved 
2009-04-22. We should just quietly grow j++ share and assume that people 
will take more advantage of our classes without ever realizing they are 
building win32-only java apps.

However from what I have heard from friends, ASP and IE8/IE9 have made a 
decent job of reasserting standards, including using CSS, HTML5, XML and 
XSLT.Comments from others?


John

-Original Message- 
From: Rohit Gupta
Sent: Tuesday, June 07, 2011 10:22 AM
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] FW: Web development

Well thats where half my time goes, getting the things to work on all
browsers - especially the MS ones.  Then there are people still using IE7!!

On 7/06/2011 9:39 a.m., Jolyon Smith wrote:
 My problem isn't invalid HTML - it is perfectly valid HTML but which
 doesn't render the way you expect in browser X, Y Z or perm any N from M.

 Ditto Javascript which is perfectly valid but which doesn't work the way 
 you
 expect in browser X, Y, Z or perm any N from M.

 Or CSS which is perfectly valid but which doesn't work the way you expect 
 in
 browser X, Y, Z or perm any N from M.

 Or some combination of HTML, JavaScript or CSS which doesn't work in that
 particular combo in browser X, Y, Z or perm any N from M.


 I had thought that these issues might have been resolved at some point in
 the last 20 years, but sadly things really aren't much better today than
 they were then.  In some cases worse, because the tools techniques also
 assume that things have improved, when they haven't... lulling you into a
 false sense of security.


___
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] FW: Web development

2011-06-06 Thread John Bird
I am mystified why any government organisations would be stuck on IE6 given 
its the best door for any hacker wanting to intrude into a system.   Its how 
Google was penetrated 18 months ago - hackers found workstations that had to 
use IE6 for historical reasons (reasons that were not all that good)

I was astonished about 3 years ago to see an unnamed government department 
workstation using a pre-release version of Firefox, ie it was so old it was 
basically the old Netscape - with diagonal arrow buttons and all, probably 
something like v0.5 and from probably 2003.

Surely any government IT department should not be relying on such old 
unpatched software if even to cover their own backsides when the inevitable 
problem occurs - its not a budget issue if free secure browsers abound.

If they have to use IE6 for intranets, do they prevent IE6 from accessing 
the outside internet?   And why can they not use later browsers for 
Intranets?

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


Re: [DUG] FW: Web development

2011-06-03 Thread John Bird
I am an outside observer of Web development as I don't personally do it 
either, but interested to find the best practice tools to pick up, as its 
such a promising area for the future.   I guess like a lot of Delphi 
programmers, if we are going to pick up web development (and seems to be the 
mainstream for the future) we are naturally biased towards something as 
powerful, great IDE and well designed language as we have been blessed with 
in Delphi.

* Have heard  comments in the past that the best state of the Art IDE is 
some of the Java ones (ie better than Visual Studio or Delphi)

* Haven't seen anyone comment on Ruby yet

* Web development is certainly an area where the open source and free tools 
are often equal to or ahead of the commercial tools

* Open source tools starting with HTML editing like Kompozer are often well 
integrated with W3C standards (including validating HTML code).   The W3C 
site is an excellent starting reference for good standards.

* Waiting for comments from people like Gary B and others who have done very 
comprehensive PHP projects, for which there are very extensive frameworks 
out there.   They seem to be able to turn out large systems with ease and 
speed of development comparable to Delphi, including excellent controls, 
Ajax, web commerce and ordering modules, and of course as good integration 
with Firebird as Delphi has.

* I had the impression that the various extensions to Firefox (Firebug, 
Greasemonkey, Javascript viewers, error console etc) have generally been 
thought to be the best tools for web developers in browsers.  Don't know 
much as don't personally use these much, but being involved on the Firefox 
development forum I know they are redoing these tools constantly - the View 
HTML Source etc are getting makeovers at the moment.   Latest Firefox is a 
joy to use btw (V7.0a1 alpha nightly build - yes its 3 versions ahead). 
All the latest browsers (ie9, Firefox, Opera, Chrome) seem to be rewriting 
the state of the art constantly which is a great thing.

John


 Jolyon == Jolyon Smith jsm...@deltics.co.nz writes:

Jolyon Inspect Element is good for seeing what HTML you or your
Jolyon framework has spat out, but it doesn't help you spit out
Jolyon the right HTML in the first place.

I think you're probably using tools like:

  print phello/p;

to write your HTML :-)

But on the specifics of checking your HTML: check the W3C validator
service. Install Pendule if you're using chrome and such checks are
just a click away.

-- 
All the best,

Berend de Boer


  --
  Awesome Drupal hosting: https://www.xplainhosting.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] Validate data entry

2011-06-01 Thread John Bird
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


Re: [DUG] NZ Developer Day - invitation

2011-05-26 Thread John Bird
I am planning to be there 

John
From: Alister Christie 
Sent: Friday, May 27, 2011 3:26 PM
To: NZ Borland Developers Group - Delphi List 
Subject: Re: [DUG] NZ Developer Day - invitation

I'm registered and flights booked, is there any other out of town-ers attending?

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 wlEmoticon-smile[1].png___
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] File/Dir Open at My Computer

2011-05-23 Thread John Bird
Well it is what I was looking for but I probably won’t use it as it is 
incredibly ugly – as in it has Windows 3.1 look.   Is this really the most 
modern version of selecting a drive I can use on Windows 7?

John
From: Rohit Gupta 
Sent: Monday, May 23, 2011 2:37 PM
To: NZ Borland Developers Group - Delphi List 
Subject: Re: [DUG] File/Dir Open at My Computer

John,

the TDriveCombobox should do the trick.



On 20/05/2011 1:35 a.m., John Bird wrote: 
  I want to bring up a dialog to select a drive (Will be usually a removable 
USB drive).   Can I do this with any of the standard Delphi TOpenDialog or 
SelectDirectory etc?

  Ideally I want to bring up a dialog starting at My Computer...(D2007)

  [Aside - I know how to show My Computer by starting Windows Explorer:

  To start with my computer:

  explorer.exe /n,/e,/select, c:\

  To start with desktop:

  %SystemRoot%\explorer.exe /e,%USERPROFILE%\Desktop

  – it can show the drive but doesn’t return the drive letter to Delphi as it 
comes up as a separate process of course]

  John


  __ Information from ESET NOD32 Antivirus, version of virus signature 
database 6134 (20110519) __

  The message was checked by ESET NOD32 Antivirus.

  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 NOD32 Antivirus, version of virus signature 
database 6134 (20110519) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




-- 
Regards

Rohit Gupta
B.E. Elec., M.E., Mem IEEE, Mem IET
Technical Director
Computer Fanatics Ltd

Tel 4892280 
Fax 4892290 
Web www.cfl.co.nz


This email and any attachments contain information, which is confidential and 
may be subject to legal privilege and copyright. If you are not the intended 
recipient, you must not use, distribute or copy this email or attachments. If 
you have received this in error, please notify us immediately by return email 
and then delete this email and any attachments.



___
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] File/Dir Open at My Computer

2011-05-23 Thread John Bird
Have looked at the MegaDemo program and downloaded the whole JVCL V3.40 and 
looks promising -  and arrived at the same point I recall being at in the 
past - trying to figure out how to install it as installation information is 
scarce...   - do you have either info or a link to guide to install on 
D2007?



John

-Original Message- 
From: Pawel Rewak
Sent: Tuesday, May 24, 2011 11:02 AM
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] File/Dir Open at My Computer

Have a look at the JEDI VCL - TJvDriveCombo (in the Jv Lists, Combos,
Trees tab) does this much better and looks good too.


On Mon, May 23, 2011 at 6:36 PM, John Bird johnkb...@paradise.net.nz 
wrote:
 Well it is what I was looking for but I probably won’t use it as it is
 incredibly ugly – as in it has Windows 3.1 look.   Is this really the most
 modern version of selecting a drive I can use on Windows 7?

 John
 From: Rohit Gupta
 Sent: Monday, May 23, 2011 2:37 PM
 To: NZ Borland Developers Group - Delphi List
 Subject: Re: [DUG] File/Dir Open at My Computer

 John,

 the TDriveCombobox should do the trick.



 On 20/05/2011 1:35 a.m., John Bird wrote:

 I want to bring up a dialog to select a drive (Will be usually a removable
 USB drive).   Can I do this with any of the standard Delphi TOpenDialog or
 SelectDirectory etc?

 Ideally I want to bring up a dialog starting at My Computer...(D2007)

 [Aside - I know how to show My Computer by starting Windows Explorer:

 To start with my computer:

 explorer.exe /n,/e,/select, c:\

 To start with desktop:

 %SystemRoot%\explorer.exe /e,%USERPROFILE%\Desktop

 – it can show the drive but doesn’t return the drive letter to Delphi as 
 it
 comes up as a separate process of course]

 John

 __ Information from ESET NOD32 Antivirus, version of virus 
 signature
 database 6134 (20110519) __

 The message was checked by ESET NOD32 Antivirus.

 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 NOD32 Antivirus, version of virus 
 signature
 database 6134 (20110519) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com



 --
 Regards

 Rohit Gupta
 B.E. Elec., M.E., Mem IEEE, Mem IET
 Technical Director
 Computer Fanatics Ltd

 Tel 4892280
 Fax 4892290
 Web www.cfl.co.nz
 
 This email and any attachments contain information, which is confidential
 and may be subject to legal privilege and copyright. If you are not the
 intended recipient, you must not use, distribute or copy this email or
 attachments. If you have received this in error, please notify us
 immediately by return email and then delete this email and any 
 attachments.

 
 ___
 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




-- 
Regards,
Pawel Rewak
Practical Programs

___
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

[DUG] File/Dir Open at My Computer

2011-05-19 Thread John Bird
I want to bring up a dialog to select a drive (Will be usually a removable USB 
drive).   Can I do this with any of the standard Delphi TOpenDialog or 
SelectDirectory etc?

Ideally I want to bring up a dialog starting at My Computer...(D2007)

[Aside - I know how to show My Computer by starting Windows Explorer:

To start with my computer:

explorer.exe /n,/e,/select, c:\

To start with desktop:

%SystemRoot%\explorer.exe /e,%USERPROFILE%\Desktop

– it can show the drive but doesn’t return the drive letter to Delphi as it 
comes up as a separate process of course]

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

Re: [DUG] June 6th

2011-05-16 Thread John Bird
Monday 6th is Queens birthday holiday in case anyone has not twigged.   Is that 
likely to affect travel for anyone from out of town?  Or availability of anyone 
who might be on holidays otherwise?   I am from Chch so availability of cheap 
flights is important.

John


From: Cameron Hart 
Sent: Monday, May 16, 2011 10:04 PM
To: NZ Borland Developers Group - Delphi List 
Subject: Re: [DUG] June 6th

Is that intentional to be on Queens birthday to be outside of work hours?

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of Richard Vowles
Sent: Monday, 16 May 2011 9:49 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] June 6th

 

The Delphi day will be June 6th, thats what Embarcadero have booked. They have 
a list of topics and I'll ping Jolyon privately. I'll organise to leave the 
last hour of the time for people who want to come up with tips and tricks, so 
start preparing now!

Richard

-- 
---
Richard Vowles, Technical Advisor
Developers Inc Ltd
web. http://www.developers-inc.co.nz
mob. +64-275-467747 
twitter. developersinc







___
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 2007 Vista

2011-05-15 Thread John Bird
I have found a couple of minor oddities like this with one program starting 
another under Windows 7 – I also have a menu program that starts others, one of 
them an update program.  This update program does run but does not show over 
other windows – mainly because I get a UAC prompt about allowing it, which I 
do, and then the program runs OK but the main form does not maximise always, 
but can see it on the task bar.

Other things to check out are if the program stores data – eg in an ini file on 
the same path as the application.If this is under the “Program Files” 
folder you are very likely to get problems as this is a no-no place to write 
data and Windows will try to move such files elsewhere.   Check the Activate or 
FormShow event of the program to see if it is writing any data just in case.

Also my firewall (COMODO) has a habit of blocking a newly built program by 
saying its trying to install a global hook and asking me to OK that.   This 
blocks showing of the main form too.  After OKing it there is still a delay of 
several seconds until the form appears.   Subsequent runs of the same exe are 
OK.

Aside - UAC is quite smart – I have deduced that a UAC permission can inherit 
to a program started by the original process if it has been OK’d with a UAC 
prompt, because subsequent runs of the program started by another will not ask 
for UAC, as long as one of the previous programs that started it was granted 
that permission.   Restarting the programs concerned brings another UAC prompt. 
 (Lets not start a discussion here on the merits of UAC btw – although my 
opinion is anyone from the Unix/linux world is likely to approve of it).


John

From: Charlie Kerscher 
Sent: Sunday, May 15, 2011 11:17 PM
To: NZ Borland Developers Group - Delphi List 
Subject: Re: [DUG] Delphi 2007  Vista

  I think that I found the culprit - Google Chrome. When it is running the 
app doesn't appear outside or inside the IDE. When it isn't running then it 
appears. Can't believe I've spent 12 hours dealing with this because of 
Google/Vista ugh
  Charlie

  --- On Sun, 5/15/11, David Brennan dugda...@dbsolutions.co.nz wrote:


From: David Brennan dugda...@dbsolutions.co.nz
Subject: Re: [DUG] Delphi 2007  Vista
To: 'NZ Borland Developers Group - Delphi List' delphi@delphi.org.nz
Date: Sunday, May 15, 2011, 4:48 AM


If the form is off screen there is a way of getting it back. Focus the 
application then do the following:



Hit Alt-Space. That should bring up the windows menu (ie from the top 
left of the window) for the current window. You may not be able to see it 
though if the form is offscreen.



Press the down arrow once (this will move focus to the Move command). 
Hit enter (to select Move). Do Ctrl-Left (as in left arrow key, or in fact any 
of the arrow keys). This will move the window one pixel BUT more usefully it 
also locks the form into drag mode with the mouse cursor. Move your mouse now 
and the form should appear on screen following the mouse cursor.



Cheers,

David.



From: delphi-boun...@delphi.org.nz 
[mailto:delphi-boun...@delphi.org.nz] On Behalf Of David O'Brien
Sent: Sunday, 15 May 2011 1:27 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Delphi 2007  Vista



What code is used to launch the programs?



From: delphi-boun...@delphi.org.nz 
[mailto:delphi-boun...@delphi.org.nz] On Behalf Of Charlie Kerscher
Sent: Sunday, 15 May 2011 1:18 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Delphi 2007  Vista



  David, I did as you suggested and the program still doesn't 
appear. Oh, the settings are in afd.ini.

  Charlie

  --- On Sat, 5/14/11, David O'Brien 
wlmailhtml:/mc/compose?to=d...@iccs.co.nz wrote:


  From: David O'Brien wlmailhtml:/mc/compose?to=d...@iccs.co.nz
  Subject: Re: [DUG] Delphi 2007  Vista
  To: NZ Borland Developers Group - Delphi List 
wlmailhtml:/mc/compose?to=delphi@delphi.org.nz
  Date: Saturday, May 14, 2011, 8:50 PM

  Where does it store the positions? Registry or .ini file? Have a 
look where the forms left and top are... Set them to 0,0.



  From: delphi-boun...@delphi.org.nz 
[mailto:delphi-boun...@delphi.org.nz] On Behalf Of Charlie Kerscher
  Sent: Sunday, 15 May 2011 12:38 p.m.
  To: NZ Borland Developers Group - Delphi List
  Subject: Re: [DUG] Delphi 2007  Vista



Thanks David, the original application is Accounting for 
Delphi. It does, as best as I can determine, remember last screen 
size/position. 

I can not start the other programs (modules) although the 
task manager says they are running.

The curious thing, to me, is that when I start the 

[DUG] API to Windows explorer

2011-05-12 Thread John Bird
I am writing a program to copy one or more folder trees to a USB drive (an 
extra backup regime for some Canterbury firms who were not able to get at 
servers or finding their offsite backups were also inaccessible).

I have a nice component HAHFindFile to build the list of folders and files in a 
stringlist, and a routine using TFilestream to do the copy, but I was thinking 
its almost certainly going to be faster and more robust if there were an API to 
Windows Explorer to pass the source and destination folders to, and some 
parameters (eg copy only newer).

I read technical articles from Mark Russinovitch about how Vista and Windows 7 
optimise copying files over a network, varying the block sizes etc and using 
caching so I would expect an OS-level API to be much faster.

Does anyone know if such an API exists, and are there options to eg copy only 
later files.  I saw some hints in Google about a COM interface to Windows 
Explorer, but no details if it has options like I am interested in.

Aside – I heard of one firm that had a server and a Wifi router on a UPS that 
had their network guy park outside with a wifi laptop and copy stuff from the 
server before the UPS died.   Couldn’t go in because the the front of the 
building had fallen out into the street.   Thats a cool idea for an emergency 
backup after the event.

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

Re: [DUG] API to Windows explorer

2011-05-12 Thread John Bird
Good grief lighten up! From what I heard - using a WiFi connection from the 
street was not a plan for disaster recovery, it was good kiwi improvisation.

The point I was making was that in Christchurch in 2011, as happened in 
Greymouth around 1986 with floods,   I dealt with firms where the office was 
destroyed, and the supposedly safe offsite backups also was unavailable.

In Christchurch in an equally damaged and inaccessible network providers 
office, in Greymouth in a flooded bank vault.

Extra redundant backup options are a great idea.

John


Aside – I heard of one firm that had a server and a Wifi router on a UPS
 that had their network guy park outside with a wifi laptop and copy stuff
 from the server before the UPS died.   Couldn’t go in because the the
 front of the building had fallen out into the street.   Thats a cool idea
 for an emergency backup after the event.

 John

With respect, it's one of the silliest ideas I've heard in a long time
because:
a.) if your business continuity depends on that data being available then
you need to take backup's and DR seriously, and
b.) because endangering your staff like this shows you really don't get
it, and
c.) sitting outside a collapsed building will block access  needed by the
emergency services, and
d. etc

Cheers

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] Auckland mini-conference

2011-05-08 Thread John Bird
Well I think a good idea could be a short open session where long term 
developers share their tips on tools and procedures that maximise their 
productivity.   I have 2 or 3 small tips I would add to such a discussion...and 
would love to hear from others their developed tools and procedures!

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

[DUG] Closing a modal form from code in it

2011-05-07 Thread John Bird
I have a modal form that gets called to do some processing (involving Indy), 
and when it has finished if all is OK I am trying to get the end code after the 
Indy stuff to show status (which it does) and close the form (which it doesn’t).

The statement form2.close is being executed but is not closing the form.
What can stop a modal form being closed,  or any ideas what I need to do to get 
it to close by itself when its finished?

(The form is opened by form2.ShowModal
and the code is in a procedure executed from the OnActivate event  - the Show 
event also doesn’t work)

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

Re: [DUG] D2007 Upgrading Indy to V10.2.3

2011-04-18 Thread John Bird
Yes that gave me the hint.   The DCP files get placed in obscure places on XP 
and Windows 7 (and different on each) so in the end I did it the safe way and 
took the source folder to the second machine (the VM) and built all the BPL’s 
there in the target IDE.

I guess that meant that it knew where the DCPs etc ended up.

The other main trick is for each DPK that gets built to be careful to set the 
project options folders for the BPL and the DCU, as both sets are needed in the 
IDE.

John

Hi John,

You may need the DCP files as well: IndyCore, IndyProtocols, IndySystem. 
Probably later versions than the '100' indicated in your error msg.
They go in:
C:\Documents and Settings\All Users\Documents\RAD Studio\5.0\Dcp  (remove the 
old '100' ones)

HTH,
Steve



--
  From: John Bird [mailto:johnkb...@paradise.net.nz] 
  Sent: Monday, 18 April 2011 4:27 p.m.
  To: NZ Borland Developers Group - Delphi List; gary Benner
  Subject: Re: [DUG] D2007 Upgrading Indy to V10.2.3


  Help!

  As a test I upgraded one D2007 machine (non-critical) to Indy 10.2.3 and it 
all worked nicely.

  So I duplicated carefully what I did to the critical working D2007 (which is 
in a XP VM), and now the IDE won’t start.

  “The procedure entry point @Idsysvcl@initialisation$qqrv could not be located 
in the dynamic link library IndySystem100.bpl”

  The only copies of the InsySystem100.bpl in the program Files folder are the 
new ones that work on the other PC

  Are there any ways to either repair the IDE from config files, or set the IDE 
to start in a “safe mode” without Indy stuff loaded???

  As long as I can get the IDE started I reckon I can fix it...

  Note:
  (I do not have the original installation disks here for D2007).
  (I did not compile these in place here for the second IDE, I copied the BPL 
and DCU folders from the first test install in case that makes a 
difference...both are D2007).



  John Bird




___
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] D2007 Upgrading Indy to V10.2.3

2011-04-17 Thread John Bird
Help!

As a test I upgraded one D2007 machine (non-critical) to Indy 10.2.3 and it all 
worked nicely.

So I duplicated carefully what I did to the critical working D2007 (which is in 
a XP VM), and now the IDE won’t start.

“The procedure entry point @Idsysvcl@initialisation$qqrv could not be located 
in the dynamic link library IndySystem100.bpl”

The only copies of the InsySystem100.bpl in the program Files folder are the 
new ones that work on the other PC

Are there any ways to either repair the IDE from config files, or set the IDE 
to start in a “safe mode” without Indy stuff loaded???

As long as I can get the IDE started I reckon I can fix it...

Note:
(I do not have the original installation disks here for D2007).
(I did not compile these in place here for the second IDE, I copied the BPL and 
DCU folders from the first test install in case that makes a difference...both 
are D2007).



John Bird
___
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

[DUG] D2007 Upgrading Indy to V10.2.3

2011-04-16 Thread John Bird
I have been trying to upgrade D2007 to use Indy 10.2.3 rather than the default 
installed 10.1.5.

It looks to be a minefield, as the web site instructions do not make it clear 
how to do D2007 in particular as it was a binary compatible clone of D2006.   
The Indy BPL files are all called Indy100.bpl etc rather than 
Indy110.bpl.

Also it has Indy DCU files installed in various places.

Does anyone have references or experience in upgrading Indy to share, as I have 
never upgraded a part of the IDE in place before and it is likely I am going to 
stuff it up.

I kept folders of the old files it said to uninstall and delete, but I doubt I 
would ever get them back in the IDE correctly.

If the IDE gets messed up:

I presume I can copy the entire “Program Files\Codegear\RAD Studio\5.0” folder 
from external backup,
– does this type of operation (uninstalling/ installing BPLs etc)  make 
registry changes which also would have to be wound back?

Or will I have to reinstall the entire IDE including hotfixes?

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

Re: [DUG] Mapped drives

2011-04-03 Thread John Bird
When you map the drive tick the optiion to “Restore mapping on logon”.   That 
way if a user loses the mapping you can just tell them to log out and logon 
again to fix it.   As long as the network connection is there when the PC 
starts that normally works fine.   If it doesn’t can be because a password is 
required to connect to the network drive and for some reason its not being 
remembered behind the scenes, or the network connection is not available at 
login.

John

From: Rohit Gupta 
Sent: Monday, April 04, 2011 9:13 AM
To: NZ Borland Developers Group - Delphi List 
Subject: Re: [DUG] Mapped drives

I think it just takes a while.  Have you tried making the share/map persistent 
on the the workstation.

On 3/04/2011 4:53 p.m., Marshland Engineering wrote: 
  I'm mapping my data to a P: drive across a windows XP network. Whenever I 
start one of my networked PC's and I open my app for the first time, I get a 
drive error.

  If I open windows explorer and view the drives before I open the Delphi app, 
the app finds the data. It is almost like Delphi does not wake up the XP 
mapping when the program is first run. Any suggestions ?

  Thanks Wallace.







  __ Information from ESET NOD32 Antivirus, version of virus signature 
database 6010 (20110402) __

  The message was checked by ESET NOD32 Antivirus.

  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 NOD32 Antivirus, version of virus signature 
database 6010 (20110402) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




-- 
Regards

Rohit Gupta
B.E. Elec., M.E., Mem IEEE, Mem IET
Technical Director
Computer Fanatics Ltd

Tel 4892280 
Fax 4892290 
Web www.cfl.co.nz


This email and any attachments contain information, which is confidential and 
may be subject to legal privilege and copyright. If you are not the intended 
recipient, you must not use, distribute or copy this email or attachments. If 
you have received this in error, please notify us immediately by return email 
and then delete this email and any attachments.



___
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] Move mouse to ListItem

2011-03-08 Thread John Bird


I found a link on the list here where you could download the Delphi 2009 
help files as .CHM  which I did and added to the tools menu.   Fast loading 
and useful - worthy addition to the D2007 help.   I also have the D7 help in 
the tools menu too.   Maybe someone has the link, I will try to find it 
later - at present I am trying to collar an engineer to look at a retaining 
wall to tell me if it is about to collapse onto the house  or not...

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


Re: [DUG] Christchurch Members

2011-02-25 Thread John Bird
Message bodyWe were at home, sitting at the dining room table talking to the 
EQC inspectors. When the quake hit four of us ran for the front door.
Terrifying violent rumble and shake!
We OK, House OK, everything inside trashed and on the floor. No power, no 
phone, no water, slept in car last night.
Lots of damage in Lyttelton, Sumner, Mt Pleasant.
Everything in cupboards is on the floors mainly smashed.
Piano jumped 3-4 feet across floor.
Aftershocks - Deep rumbling or shaking every minute or so, extremely unnerving 
as it is a very solid, very fast strong rumble, reverberates right though the 
rock hills that Mt Pleasant is built on - very uncanny when standing outside 
listening to it. I would say its exhilarating but most everyone I know 
disagrees vehemently.

Other – Saga’s laptop fell from the table onto the floor, and seems to have 
survived, however the network port seems to be broken as the ethernet cord 
dragged it off the table so it might need to be replaced

Nothing was left in the fridge or freezer either, and toaster was hanging by 
its cord
We have redecorated the kitchen!

John Bird
___
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] Object was open

2011-02-21 Thread John Bird
[DUG] Rhino MocksThis may not be the problem, but I have the impression its 
generally cleaner to make sure a dataset is closed before altering either the 
query or parameters or other linkages to data providers etc.  You may wish to 
make sure there is an optional close action as in:

if  ClientDataSet1.active then ClientDataSet1.close; == maybe add this
ADOQueryEdit.SQL.Text:=’x’;
DataSetProvider1.Dataset:=ADOQueryEdit;
ClientDataSet1.Providername:=DataSetProvider1;
ClientDataSet1.FetchParams;
ClientDataSet1.Open;

(not all of those steps may be needed, but the Fetchparams is needed it the 
parameters in the SQL change as well).  I am guessing the problem is the 
dataset is open when you try to alter the linkages such as trying to connect a 
different query.

John
From: Edward Huang 
Sent: Monday, February 21, 2011 8:54 PM
To: 'NZ Borland Developers Group - Delphi List' 
Subject: [DUG] Object was open

Hi,

I'm having a strange error recently.  We have a program that has been running 
on a Win2003 server for a long time, and suddenly from last week it comes up 
'Object was open' errors.

Typically, the program uses 2 TADOQuery, one will select/Edit/Post, another one 
with an 'Insert into xxx' query, both pointing to a same SQL Server 2005 table. 
 The pattern appears on many places.

Disregard the nicety of the logic, it has been done that way for over 5 years, 
first on Win 2000 server with SQL Server 2000, and later on Win 2003 server 
with SQL Server 2005, and was all fine, until about a week ago.

I have tried Google, but couldn't really find any useful link to my situation, 
although there are lots of link to the same error.  I'm suspecting some kind of 
OS patch or such which changed behaviour of ADO or MDAC or SQL Server.

Anyone has a suggestion to my situation?  I'm not keen on changing all the code 
to use different logic, as it would require fair amount of coding and testing.

Thanks,

Edward



___
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] Windows 7 Network Oddity

2011-02-16 Thread John Bird
How do you expand the path to UNC?

The reason I am surprised in a way that MS have done this is that using mapped 
drives added a layer of abstraction from the server – if a server had F: mapped 
to \\SERVER01\DATA  then the server could be replaced, the mapping moved to 
\\SERVER02\DATA  on the workstation in Windows Explorer, and the existing 
shortcuts and saved setups needed no change – in practice this is very 
convenient because it gave a very easy way to upgrade a server.  Also the 
network upgraders only needed to know to edit the drive mappings in Explorer, 
now they might need to go into software packages and alter settings for each.

I can cater for this in my settings, but it means that any time a server is 
replaced the settings will have to be edited, and the shortcuts will also will 
probably have to be edited, as usually the server name changes.

I already have to cater for this for network printers, eg a printer might move 
from being called HPLaserjet and changed from being mapped to 
\\SERVER01\HPLASER  changed to \\SERVER02\HPLASER  so in a sense its just more 
of the same (printers never had a mapping anyway).

John
 
I havent noticed it as I have always expanded the path to unc and beyond so 
that no matter what form they give me for the path,  it always evaluates to the 
same string.

Another thing that may effect you is that on 64 bit server using TS - constant 
crashes are being attributed to this issue.  And the workaround has been 
reported by other companies such as seagate - not to uses shared drives.  The 
error given is C006.


On 12/02/2011 12:20 a.m., John Bird wrote: 
?I have software used on networks that commonly uses its shared folder 
server as a mapped drive,  eg   M:\MyFolder with M: mapped to 
\\Server1\MySoftware\
If a program runs from there, started as M:\MyFolder\MyProgram.exe  , there 
is a difference between XP and Windows 7:

XP   Application.exename   returnsM:\MyFolder\MyProgram.exe

Windows 7   Application.exename   returns 
\\Server1\MySoftware\MyFolder\MyProgram.exe

ie Windows 7 expands the mapped drive to its real UNC name rather than 
returning the mapped drive name, even though the program was run from a 
shortcut using the mapped drive name.

Anyone know if this is a setting or preference that can be altered?   Or do 
I have to live with either being returned depending on Windows version?

Others may wish to check if this has ramifications for them!

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

__ Information from ESET NOD32 Antivirus, version of virus signature 
database 5863 (20110210) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



-- 
Regards

Rohit Gupta
B.E. Elec., M.E., Mem IEEE, Mem IET
Technical Director
Computer Fanatics Ltd

Tel 4892280 
Fax 4892290 
Web www.cfl.co.nz


This email and any attachments contain information, which is confidential and 
may be subject to legal privilege and copyright. If you are not the intended 
recipient, you must not use, distribute or copy this email or attachments. If 
you have received this in error, please notify us immediately by return email 
and then delete this email and any attachments.



___
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

[DUG] Windows 7 Network Oddity

2011-02-11 Thread John Bird
?I have software used on networks that commonly uses its shared folder 
server as a mapped drive,  eg   M:\MyFolder with M: mapped to 
\\Server1\MySoftware\
If a program runs from there, started as M:\MyFolder\MyProgram.exe  , there 
is a difference between XP and Windows 7:

XP   Application.exename   returnsM:\MyFolder\MyProgram.exe

Windows 7   Application.exename   returns 
\\Server1\MySoftware\MyFolder\MyProgram.exe

ie Windows 7 expands the mapped drive to its real UNC name rather than 
returning the mapped drive name, even though the program was run from a 
shortcut using the mapped drive name.

Anyone know if this is a setting or preference that can be altered?   Or do 
I have to live with either being returned depending on Windows version?

Others may wish to check if this has ramifications for them!

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


[DUG] Debug Windows 7 UAC

2011-02-08 Thread John Bird
?Trying to debug a problem in a program that requires elevation - (it copies 
exe files from an update to a working folder).

I cannot run hence debug it in the IDE,  are there any ways to debug such a 
program?  I want to step through it to see where the access violation is.

Windows 7/D2007

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


Re: [DUG] Debug Windows 7 UAC

2011-02-08 Thread John Bird
?Jeremy's suggestion worked fine.

Start Delphi by right click icon and select Run as Administrator  hey 
presto debugging works.
I should have thought of that, but I didn't so thanks.

John

-Original Message- 
From: David O'Brien
Sent: Wednesday, February 09, 2011 2:16 PM
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Debug Windows 7 UAC

Just as a silly thought, why not run the proggy external to the IDE and
attach to the process? Haven't tried this for a long, long time, but it
may work...

-Original Message-
From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz]
On Behalf Of John Bird
Sent: Wednesday, 9 February 2011 12:24 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] Debug Windows 7 UAC

?Trying to debug a problem in a program that requires elevation - (it
copies exe files from an update to a working folder).

I cannot run hence debug it in the IDE,  are there any ways to debug
such a program?  I want to step through it to see where the access
violation is.

Windows 7/D2007

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 


___
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 Starter Edition

2011-01-31 Thread John Bird
For those on D7 or earlier, its worth pointing out that a professional version 
of D7 also would not contain pretty much any of the things left out of the 
Starter edition – so it is still a pretty good deal in my humble opinion.

ie those wanting a cheap upgrade from D5/D6/D7 can get this Starter with the 
newer IDE and still get most everything they already have plus many new 
features.

John

..
I wouldn’t call it “crippled”, but it is deliberately limited in comparison 
to Professional/Enterprise/Architect.  I suppose you might call it crippled 
in the same way that you might call a 1.8 Mondeo “crippled” in comparison to 
a 2.5V6 model.  Or you might just call it “suited to a different 
purpose/market”. J

Here’s a quick summary of what’s missing (according to the feature matrix), 
categorised according to my own personal perspective/opinion:

 

Good Exclusions:

 

-  DBExpress

-  Data Snap

-  UML Modelling

-  Code Formatting

-  Code Templates

-  Code Completion for HTML

-  Source Control (SVN) Integration

-  i18n/L10N tools

-  DUnit Integration

-  AQ Time / FinalBuilder /CodeSite trialware integrations

-  Azure/EC2 integrations

-  RAVE Reports

-  SOAP  / BizSnap

-  IntraWeb

-  WebSnap

-  ER/Studio

 

Odd choices:

 

-  AutoUpdating IDE (does this mean Starter Edition is not intended to 
be updated?)

-  Command line tools (TDump, resource compiler etc)

-  Class Explorer (!?!)

-  Resource Manager (not ever knowingly used it myself tho, so this may 
be a good choice)

-  Symbol Insight (!?!)

-  Code Folding (!?!)

-  TODO lists (!!?!)

 

Really, really BAD choices:

 

-  Numerous debugger limitations, including:

o   reduced multi-thread tools, no freeze/thaw thread for example

o   reduced breakpoint controls (no data aware triggers)

o   No Evaluator (!!?! I really REALLY hope this doesn’t mean the Ctrl-F7 
evaluator – that would be DUMB DUMB DUMB)

o   No expandable local variables (but you DO get expandable watches – go 
figure)

 

-  COM limitations, including such mind bending exclusions as :

o   No Type Library Editor

o   No COM Object Wizard

o   No support for automation object event handling

o   No ability to generate component wrappers for imported COM servers !!?!?!!

 




___
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] Variabels stored

2011-01-20 Thread John Bird
There is another way as well, you can declare simple global variables – 
depending where you declare it determines it’s scope - how visible it it is.

In this example string2 can be seen by any unit that uses this one, just as 
Form11 (the particular instance of TForm11, and is also a global variable) is 
visible.

String3 can be seen by all procedures in this unit, but not by anywhere else.   
 If you have lots of simple variables to store and they don’t need to be 
inherited etc this is the simplest way to do it.

You can take this further:
If I have lots of constants to declare, or variables to store I create a unit 
which is code only (no classes) eg called storeunit and declare all the 
constants and variables I want there, any form or unit that wants access to all 
these variables just has to add storeunit to its uses clause.   This 
centralises all such declarations in one place away from a form and is very 
tidy.   I will often put simple global functions and procedures in here too, as 
they also become globally available, eg various standard ways for formatting 
dates and strings.   Also this unit can be uses in different projects as well.  
 For this just go to File/New/Unit   and the IDE gives you a new blank unit 
already to add stuff to – a simpler unit with no form or class stuff.

Here string4 string5 integer1 integer2 integer3 can all be seen from anywhere 
that uses Storeunit

It depends on whether you like using global variables or not.   Also its a good 
idea to use a clear naming convention for such variables.

There are other tricks you can do too -  you can alter compiler settings to 
allow assignable constants for a procedure, then any values assigned here will 
be preserved between calls to the procedure.   But that seems to be confusing 
to me, as it really becomes a variable and not a constant.   I saw that used in 
and example where the program wanted a counter of the number of times the 
procedure was called, and the counter constant in the procedure was assigned a 
new value each time the procedure was called, its quite a tidy way to do that 
sort of thing.  In this case the scope (visibility) of the variable is totally 
limited to the one procedure.


type
  TForm11 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
  private
{ Private declarations }
  public
{ Public declarations }
MyString : string;
  end;

var
  Form11: TForm11;
  string2: string;

implementation

uses storeunit;

{$R *.dfm}

var
string3: string;


procedure TForm11.Button1Click(Sender: TObject);
begin
  MyString := 'Hello, world!';
  string2:=’Hello world2’;
  string5:=’Hello world5’;
end;



unit Storeunit;

interface

var
string4:string;
string5:string;
integer1:integer;
integer2:integer;
integer3:integer;

implementation

end.

John
From: Marshland Engineering 
Sent: Thursday, January 20, 2011 3:45 PM
To: delphi@delphi.org.nz 
Subject: [DUG] Variabels stored

Is there a way to store variables so I can use them from one procedure to 
another?  

I have been currently storing them in hidden edit.text boxes on the form but 
there must be a better way. 

Cheers 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] Variables stored

2011-01-20 Thread John Bird
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 don't know about the compiler setting 
stuff) I would strongly recommend anybody starting out with programming / 
delphi avoids using global variables.  Its a nasty habit to get into :)  

Also the compiler setting you talk about sounds dangerous as someone who didn't 
know about it could become highly confused looking at the code or trying to 
compile it on a fresh install of Delphi !

Also note I changed the typo spelling of the subject because it was annoying me 
:)

Cheers
Rob

On 21/01/2011 9:04 a.m., John Bird wrote: 

There is another way as well, you can declare simple global variables – 
depending where you declare it determines it’s scope - how visible it it is.

 

In this example string2 can be seen by any unit that uses this one, just as 
Form11 (the particular instance of TForm11, and is also a global variable) is 
visible.

 

String3 can be seen by all procedures in this unit, but not by anywhere else.   
 If you have lots of simple variables to store and they don’t need to be 
inherited etc this is the simplest way to do it.

 

You can take this further:

If I have lots of constants to declare, or variables to store I create a unit 
which is code only (no classes) eg called storeunit and declare all the 
constants and variables I want there, any form or unit that wants access to all 
these variables just has to add storeunit to its uses clause.   This 
centralises all such declarations in one place away from a form and is very 
tidy.   I will often put simple global functions and procedures in here too, as 
they also become globally available, eg various standard ways for formatting 
dates and strings.   Also this unit can be uses in different projects as well.  
 For this just go to File/New/Unit   and the IDE gives you a new blank unit 
already to add stuff to – a simpler unit with no form or class stuff.

 

Here string4 string5 integer1 integer2 integer3 can all be seen from anywhere 
that uses Storeunit

 

It depends on whether you like using global variables or not.   Also its a good 
idea to use a clear naming convention for such variables.

 

There are other tricks you can do too -  you can alter compiler settings to 
allow assignable constants for a procedure, then any values assigned here will 
be preserved between calls to the procedure

Re: [DUG] How to replace a file currently in use (Windows)

2011-01-19 Thread John Bird
?That's the reason in my system the updater program is the only one run from 
the updates folder - as that guarantees it runs the latest version 
downloaded.

I also include in it any once-off  housekeeping that needs to be done from 
time to time - creating folders, quick system checks etc.

John

-Original Message- 
From: Paul Heinz
Sent: Wednesday, January 19, 2011 4:09 PM
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] How to replace a file currently in use (Windows)

We love LaunchGuard but then you run into the issue of needing to make
the _guarder_ app itself updatable when you add new facilities to it.
It's designed to look in the app directory of anything it's guarding for
a later copy of itself and take the necessary steps.

___
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] How to replace a file currently in use (Windows)

2011-01-18 Thread John Bird
I do it slightly differently – I have a dedicated loader program which can 
update a number of files and programs in one go.   It runs as the 
startup/splash screen for the main app menu.

Updated programs are in an update folder,
working programs are in a (local) folder

It does:
-Reads a list of files to check
-copies any newer files from the update folder to the working folder
-because it only copies newer files it is fast.
-checks the dates and times of all files afterwards, and retries a second way 
if any discrepancies.   Logs progress and errors.  Warns if any not latest.
-runs the main menu program and quits.

-Main menu also periodically checks same list for pending updates and turns the 
“get updates” button bright yellow.
-If “Get updates” clicked it runs the updater program and quits.

Main smart is to check date and time file stamps are within 10 seconds to be 
the same.   Different file systems have different time granularities (FAT32 I 
think is around 2 seconds and NTFS is milliseconds I think) so if you copy from 
one to another the dates and times will likely be slightly different if update 
and working folders are on different filesystems.

(Also the updater program is the only one run from the updates folder – all 
others from working folder)

This sort of scheme is used by Firefox too – it runs a program updater.exe and 
quits, updater.exe  does the updates   (usually a number of files are updated), 
and then runs firefox again.

function xfFilesChanged(file1: string; file2: string): integer;
//check 2 files modification date
//returns 0=both files same, 1=file1 later, 2=file2 later
//if within 10secs counted as same
//note if one file does not exist, returns other as later
var
  fileage1, fileage2: integer;
  dtdate1, dtdate2, dt10secs: TDateTime;
begin
  result := 0;
  fileage1 := FileAge(file1);
  fileage2 := FileAge(file2);
  if (fileage1  0) and (fileage2  0) then
  begin
result := 2;
exit;
  end;
  if (fileage2  0) and (fileage1  0) then
  begin
result := 1;
exit;
  end;
  if (fileage1  0) or (fileage2  0) then exit; //maybe both don't exist
  dtdate1 := FileDatetoDateTime(fileage1);
  dtdate2 := FileDatetoDateTime(fileage2);
  if dtdate1 = dtdate2 then
  begin
result := 0;
exit;
  end;
  //now if not same, check if within 10 secs
  //in case of different filesystems
  dt10secs := encodetime(0, 0, 10, 0);
  if (dtdate2  (dtdate1 - dt10secs))
and (dtdate2  (dtdate1 + dt10secs)) then
  begin
result := 0;
exit;
  end;
  //still different
  if dtdate1  dtdate2 then result := 1
  else result := 2;
end;


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

[DUG] Is this a hardware fault or IDE bug?

2010-12-20 Thread John Bird
D2007 IDE – I have noticed a consistent problem – when the PC gets hot, the 
cursor will unexpectedly jump to wherever the mouse pointer/insert pointer is, 
and typing happens there.   As you can imagine its a good way to wreck 
perfectly good code!.

I am assuming its a fault in the hardware as it only seems to happen when it 
gets hot.   But I have only seen it in D2007, not other software so I am 
wondering.

So – has anyone else has ever noticed any such problem with D2007?

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

Re: [DUG] Delphi talking to C#

2010-12-13 Thread John Bird
?As others said, I reckon best way depends on what type of comms is going 
on.

If its a large amount of structured data a file can make sense.

If response times and two way communication is important then you need 
something event driven, such as socket or TCP.

The filewatcher you are using is this   Delphi .net or are you using 
something that is pure Delphi? (I am curious because I want to do the same 
sort of comms between languages, and not just Windows or .Net)

John

Bob

Look into IPC (interprocess communication) methodologies such as as mail
boxes and pipes. Also, of course, there is always sockets.

Paul Lowman

___
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] Problem redeeming Delphi XE BOGO free product

2010-12-13 Thread John Bird
?Yes I find I have to run more than one browser to get every web site 
working.

I take it to the extreme admittedly - I have Firefox V4 beta 8 pre-release 
(nightly build), Chrome, Chrome V10 beta (Canary build), Opera v10, IE9 
beta.

My internet banking was not working with Firefox V4 for a while - now is, 
Air New Zealand complains about any browser it doesn't recognise.   MS small 
business server remote connection only works with IE (as it runs an ActiveX 
RDC).   Some web sites redirect to the mobile version of a page for any 
browser they don't recognise  (bad website design).

In general though the beta builds are all very impressive, better, more 
reliable and faster than the standard releases.

Favourites are Firefox V4  (wait until you see how fast it starts up - under 
10 secs to page loaded - and the Panorama tab view).  Chrome Canary build is 
refreshing too (its very yellow!).   As far as pure speed goes, its a fight 
between Canary and Opera, but Firefox is very close behind.   Firefox uses 
least memory because of not having a separate process for every tab - for 
instance it does handle 200+ tabs using same memory as most other browsers 
with 10-20 tabs.

[Slightly off-topic]

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


Re: [DUG] Problem redeeming Delphi XE BOGO free product

2010-12-13 Thread John Bird
?[Browsers contd]

10 seconds to page loaded is impressive when there are 269 tabs open in 20 
groups, current group has 20+ tabs so all of those are pretty much loaded 
too - so yes that is fast.   1 or 2 tabs is a lot faster again.

lots of tabs is useful if the browser handles it effortlessly, rather than 
bookmarking and closing them I just leave them open.Particularly useful 
for tabs I don't want to bookmark or keep long-term, and will only refer to 
for a day or so.  Think of it as an alternative to bookmarks and opening 
bookmarks.

Firefox Panorama allows one to organise open tabs into different groups, and 
drag and drop them from one group to another.  The browser is pretty much 
only dealing with the one current group of tabs at once (others are a 
keystroke or two away).   Its like the multiple desktops available in linux, 
or MacOS.

This is Off-topic - but relevant to Delphi in that these are new paradigms 
about how to handle more objects than fit in a menu or dropdown list.  The 
Vista/Windows 7 way is to make a terrific search box.  The Delphi XE IDE 
(IDE insight) and Windows Live Mail filtering does the same idea.   The MS 
Office way is to introduce the ribbon menus to find options more easily.

In Delphi applications the most usual approach is to filter a large dataset 
in a grid.

The Firefox Panorama is quite a new paradigm - organise groups visually on 
screen yourself by spatial placement - the user chooses the size  and 
placement.  Way more intuitive than folders.   Its an outstanding design 
IMHO.  There are some issues with it, (mainly speed but largely cured with 
hardware/graphics acceleration) but its as new an idea as the Ribbon in 
Office, or multi-touch.   But worth checking out as such a design is likely 
to be used and copied in lots of other software in future.

John

Is 10 secs supposed to be impressive ?

Chrome+ (note: NOT Google Chrome) 1.5.0 - start and load my iGoogle home
page is  4 secs on my system (and that includes all widgets - TradeMe,
Stuff, BBC F1 News, Stack Overflow, Delphi Feeds) having completed their
initial update).



 handle 200+ tabs using same memory as most other browsers
 with 10-20 tabs.

Whoop-de-doo...

Show me a *USER* that can [productively] handle 10-20 tabs and I'd be
surprised.  :)

200+ tabs... useful for feature list bragging rights, but beyond that... ?

Thats a bit like saying who would ever need more than 10 files in a folder 
so why cater for it?

http://www.google.co.nz/search?hl=enbiw=1600bih=776defl=enq=define:ludditesa=Xei=BeQGTc3NFNTNnAetj8nlDQved=0CBUQkAE

___
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] Problem redeeming Delphi XE BOGO free product

2010-12-13 Thread John Bird
?Nope - I mean it organises your currently loaded tabs into different 
groups, and can show them in multiple ways including thumbnails.   I do mean 
tabs into groups.

Saved behind the scenes by the same SQLite engine (Session store)  which 
saves bookmarks and history.

John

From: Jolyon Smith
Sent: Tuesday, December 14, 2010 4:59 PM
To: 'NZ Borland Developers Group - Delphi List'
Subject: Re: [DUG] Problem redeeming Delphi XE BOGO free product

OK, looks like you (and perhaps FireFox) say tabs where I say thumb-nailed
bookmark ;)

A tab to me is a page actively loaded from a web site.



 Think of it as an alternative to bookmarks and opening
 bookmarks.

From what I (briefly) have seen of Panorama, it's not a revolutionary new
paradigm shift at all, it's just a better way to present and organise...
bookmarks.

200+ bookmarks... yep, I can see organising those can be improved and
useful.

But that's not quite the same as 200+ actual web pages open in active
browser tabs which is what I envisaged when you used the term tab in that
context.

And still, that being the case, opening 200+ thumbnails isn't the same as
connecting to 200+ actual web sites.  Panorama is just Chrome's Most
visited page gallery taken to the next level.


 The MS Office way is to introduce the ribbon menus to find options more
easily.

ime the ribbons do the exact opposite!!  They put options in obscure places
AND disenfranchise the user - if you don't like where MS decide to put an
option, tough - get used to it.

ymmv  :)


 In Delphi applications the most usual approach is to filter
 a large dataset in a grid.

You are conflating a LOT of different and unrelated things here.

Grouping and visualising bookmarked web sites is unlikely to have much in
common with the need to filter data sets in an database application.


 The Firefox Panorama is quite a new paradigm - organise groups visually on
 screen yourself by spatial placement - the user chooses the size  and
 placement.

Actually, this is a very OLD idea.

Windows 3.x Program Manager springs immediately to mind as representative of
precisely the same new paradigm.


 Way more intuitive than folders.

How so?  Windows Explorer allows you to customise the size and placement of
folders and even their appearance.

Or put another way...

Windows Explorer Desktop employs a familiar paradigm - organise groups
visually on  screen yourself by spatial placement - the user chooses the
size and placement.

Sound familiar ?

;)

___
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


[DUG] Web Sockets security hole

2010-12-12 Thread John Bird
Here is a reference I picked up on the Firefox list about a a security hole in 
Web Sockets –  and affects Java, Flash and HTML5.  Research done by Adam Barth 
of Google.

http://www.ietf.org/mail-archive/web/hybi/current/msg04744.html
http://www.adambarth.com/experimental/websocket.pdf
https://bugzilla.mozilla.org/show_bug.cgi?id=616733

As I am not an Indy etc expert I was wondering if anyone wanted to comment if 
there is any implication for Delphi?

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

Re: [DUG] Web Sockets security hole

2010-12-12 Thread John Bird
As I understand, a Web Socket connecting via a proxy can be fooled in the case 
of many proxies to connect to a different site altogether due to a weakness in 
the UPGRADE protocol which can be exploited by poisoning the DNS cache.   The 
CONNECT protocol (not yet implemented) seems to be OK, and wss (Secure sockets 
may be ok).   It looks like a hole in security for the way many or most proxies 
are implemented that affects Web Sockets going via them.

I am still unsure how major this is and the implications, but as far as Opera 
and Firefox V4 are concerned they have turned off this protocol in HTML5 until 
it can be made secure.

It looks like a relative of the DNS poisoning cache security hole that had 
major releases of patches by a wide range of suppliers done urgently about a 
year ago to fix a basic DNS flaw also involving poisoning the DNS cache to 
point browsers and HTTP traffic to the wrong IP address.

My main questions were: is there much Delphi stuff out there using Web Sockets? 
and might this vulnerability with proxies something such people might need to 
take a look at (even if the proxy were not a Delphi product)?

(I use diddly squat Indy stuff myself so all of this is at a distance from me – 
just wanted to pass it on)

John
From: Jolyon Smith 
Sent: Monday, December 13, 2010 11:20 AM
To: 'NZ Borland Developers Group - Delphi List' 
Subject: Re: [DUG] Web Sockets security hole

I may be wrong but a quick read of the top link suggests to me that the issues 
lies specifically in the implementation of various proxies.

 

If that’s the case, any implications for Delphi would be for people 
implementing proxies using Indy, but NOT for clients or servers themselves.

 

 

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of John Bird
Sent: Monday, 13 December 2010 11:08
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] Web Sockets security hole

 

Here is a reference I picked up on the Firefox list about a a security hole in 
Web Sockets –  and affects Java, Flash and HTML5.  Research done by Adam Barth 
of Google.

 

http://www.ietf.org/mail-archive/web/hybi/current/msg04744.html

http://www.adambarth.com/experimental/websocket.pdf

https://bugzilla.mozilla.org/show_bug.cgi?id=616733

 

As I am not an Indy etc expert I was wondering if anyone wanted to comment if 
there is any implication for Delphi?

 

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] Help Detecting Windows Version

2010-12-12 Thread John Bird
?http://stackoverflow.com/questions/601089/detect-whether-current-windows-version-is-32-bit-or-64-bit

easiest way depends on whether Windows 7 or Server 2008, or older. 
Simplest and most general over windows versions looks to be 
ProgramFiles(x86) environment variable which is only set on 64 bit versions.
There are more specific ways added for Windows 7/Vista/Server 2008.

John

Hi, has anyone got a function they can share that will detect all
current versions of Windows out there?
F.i. My old routine cant detect Windows Server 2008 64 bit
Tried googling but can only find outdated code like mine.




___
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] Help Detecting Windows Version

2010-12-12 Thread John Bird
?That environment variable was mentioned as a way for eg Windows XP 64 bit, 
as from what someone said like the iswow call might not apply for XP 64bit?

John

 ProgramFiles(x86) environment variable which is only set
 on 64 bit versions

Only set **automatically by the OS**- there's presumably nothing stopping
someone from setting such an environment variable for their own purposes
should they choose so to do.

Why would they?  Who knows.  But they *could*.  Perhaps if they wanted to
fool an app that used a crude 64-bitness detection algorithm into doing
something it otherwise wouldn't...  ;)


-Original Message-
From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On
Behalf Of John Bird
Sent: Monday, 13 December 2010 13:47
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Help Detecting Windows Version

?http://stackoverflow.com/questions/601089/detect-whether-current-windows-ve
rsion-is-32-bit-or-64-bit

easiest way depends on whether Windows 7 or Server 2008, or older.
Simplest and most general over windows versions looks to be
There are more specific ways added for Windows 7/Vista/Server 2008.

John

Hi, has anyone got a function they can share that will detect all
current versions of Windows out there?
F.i. My old routine cant detect Windows Server 2008 64 bit
Tried googling but can only find outdated code like mine.




___
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] Toolsets (was Re: Company closing)

2010-11-30 Thread John Bird
I sort of disagree - A common VCL is the ideal solution.

What makes Delphi a success on Windows is that it is Pascal and also close 
enough to the Windows controls that it produces what looks like native Windows 
applications, using the best of Windows XP/Vista/7 appearances.

If they do a Mac version I reckon to be cool and admired has to be the same – 
it has to be close to the Cocoa interface and make native Mac applications.   
Each VCL control has to to give most or all of the latest mac control 
equivalents.

That way there will be some differences – some properties of controls and 
events on Windows will not have an exact matching mac equivalentprobably 
the best is to just the property or event map to the matching equivalent on mac 
if its close, otherwise ignored.  That way code can be moved back and forth, 
and some parts – eg some events will not work – so the programmers can attack 
them one at a time to insert the mac equivalent...

cases like that you have almost no alternative but to have ifdef’d code, but 
hopefully manageably small cases.

This is better than having a bland lowest common demominator VCL.

There are some examples out there of cross platform applications and frameworks 
– these are quite a long way ahead of Delphi as far as cross platform, so 
unless Delphi can do it in a more elegant way than its been done already it may 
cater for Delphi apps but won’t pick up programmers from other languages.   I 
think the main other successes out there are Webkit (whatever is used as core 
of Chrome and Safari)   QT which I think is underneath Opera, XULRunner which 
is behind Firefox and Thunderbird.   Apple have made cross platform versions of 
iTunes as well, and MS has mac versions of MSOffice – so these also must have 
some strategy for managing code across different OS’s.   Java too – although in 
that case its mainly the JVM that is tailored to each OS?   I would be most 
interested to hear more of how they all do it compared to what Delphi could do 
better.

I am also involved in the Firefox community and one of the main debates there 
is how much the code and UI should be same across all and how much it should 
blend in with the OS themes and styling – the next version of Firefox (V4) for 
instance will get quite different appearances (more than now for instance) on 
XP, Windows 7, mac and linux to better fit in with each OS styling.

John



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___
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

[DUG] Test

2010-11-29 Thread John Bird
Test – sent two messages some hours earlier and neither appeared yet

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

[DUG] Fw: Icon creation

2010-11-29 Thread John Bird
?
?I just decided to order that Icon Workshop software - note it seems to have
dropped another $5 in price - its now USD$34 or $NZD$49.20

John


-Original Message- 
From: Jeremy North
Sent: Wednesday, November 24, 2010 10:45 AM
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Icon creation

As people know, I always recommend IconWorkshop for icons and think it
is the ants pants. Tried Gimp (no thanks), IcoFx is ok for a free
product.

Anyway, it is on special at the moment, almost half off. It is a
lifetime license as well.

It is an offer via SWREG so you can't just go to the website (unless
the discount is given in the checkout screen).

Link from email:
http://dr.bluehornet.com/ct/3992300:4569202619:m:1:294663869:22ADE41AE5315E436E0B22FC0E8007EF

Becomes:
https://usd.swreg.org/cgi-bin/s.cgi?s=47156p=471561v=0d=0q=1rc=45K2D464EWa=swreg_Q4_2010linkid=IWP_2



* No I don't work for them - just like the product.



On Wed, Nov 10, 2010 at 7:52 AM, Alister Christie
alis...@salespartner.co.nz wrote:
 GiMP is pretty awesome, however not overly suited to icon creation.  I
 also use it for all my button images.  Generally I use a really old
 version of Corel Draw (7 I think) for creating a vectored image, then
 copy and paste it into GiMP to sort out the transparancy and shadows and
 stuff.

 What do other people do for button images?
 Draw their own? get pre-built packs? have an in-house graphic artist?

 Alister Christie
 Computers for People
 Ph: 04 471 1849 Fax: 04 471 1266
 http://www.salespartner.co.nz
 PO Box 13085
 Johnsonville
 Wellington


 On 10/11/2010 9:26 a.m., Nick Fauchelle wrote:
 After seeing Alister's video a few years ago, I have been using gimp for
 my icons!

 (Thanks Alister!)

 On Tue, 2010-11-09 at 18:11 +1300, Alister Christie wrote:
 I made this video a few years ago
 http://codegearguru.com/index.php?option=com_contenttask=viewid=12Itemid=27
 making icons with GiMP.

 However there are some quite good free standalone Icon editors.
 Alister Christie
 Computers for People
 Ph: 04 471 1849 Fax: 04 471 1266
 http://www.salespartner.co.nz
 PO Box 13085
 Johnsonville
 Wellington

 On 9/11/2010 5:32 p.m., John Bird wrote:
 I have never read up on best practices/sizes etc for creating
 program icons and BMP files for buttons/images etc.   Anyone got any
 good references to read up further??

 q1 – I have figured how to create a BMP with transparent background
 for bit buttons etc so the image is not square.  How do I create
 same for program ICO files?   All my program icons in the task bar
 are square as a result.

 q2 – Where does everyone else store their image files?  Really they
 should be considered part of the project.   Only the IDE does not
 store what the original filename was, so to find the image again
 (for a bitbutton/program icon etc) I have to know what it was and
 where.   I haven’t made up mind between storing them in the
 project source folder or a separate images folder...

 Any Embarcadero programmers out there reading this – how about the
 IDE stores the names of the files when it loads them, so it can be
 found again.

 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
 ___
 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


[DUG] Fw: DelphiDroid

2010-11-29 Thread John Bird
...@delphi.org.nz] On 
Behalf Of Alister Christie
Sent: Tuesday, 30 November 2010 17:10
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] DelphiDroid

 

From what I heard it will be native - although all I've heard are rumors - 
certainly no statement of intent.




Alister ChristieComputers for PeoplePh: 04 471 1849 Fax: 04 471 
1266http://www.salespartner.co.nzPO Box 13085JohnsonvilleWellington 
On 29/11/2010 4:19 p.m., Jolyon Smith wrote: 

Is that Android 1.5? 1.6? 2.1? 2.2?  Or will it be 3.0?

 

Apart from that, isn’t a “target” for a compiler a bit more than just an 
OS/platform/framework ... ?

 

If Delphi is to “target” Android then it must target the CPU architectures that 
Android itself runs on (with iPhone the distinction is blurred since only one 
phone hardware platform runs the OS – iPhone the OS is iPhone the hardware, to 
intents and purposes).

 

Android might be running on (currently) ARM-Cortex A7, A8, or A9  (as far as I 
can tell – I am not an Android owner or otherwise particularly interested in 
Android, so this is based on a few mins with my learned friend, Mr Google J)

 

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of Alister Christie
Sent: Tuesday, 30 November 2010 14:11
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] DelphiDroid

 

My understanding is that both Android and iPhone are being actively 
experimented with as targets for the compiler.  We'll probably hear more once 
we have OS/X, Win64 and Linux support, which I suspect that it would be at last 
2 years away




Alister ChristieComputers for PeoplePh: 04 471 1849 Fax: 04 471 
1266http://www.salespartner.co.nzPO Box 13085JohnsonvilleWellington 
On 29/11/2010 1:40 p.m., David Brennan wrote: 

I think Jolyon is right.

 

The difference between a proof of concept (which is basically what the guy has 
now) and a robust tool which handles the majority of Delphi features and 
libraries is enormous. Several orders of magnitude sounds about right to me 
(meaning 100-1000 times more difficult, or even more).

 

I agree with the general principle though that being able to build for Android 
(and/or iPhone and others) would be great. However I think the only way it 
could really be done in a decent way is by Embarcadero continuing to extend the 
back end compiler to support more and more target platforms. They have made a 
few references in recent times which suggest they hope to do this but only time 
will tell.

 

Cheers,

David.

 

 

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of Jeremy Coulter
Sent: Monday, 29 November 2010 1:23 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Company closing

 

you should download it and make it do more then :-)

jeremy

On Mon, Nov 29, 2010 at 1:12 PM, Jolyon Smith jsm...@deltics.co.nz wrote:

Is it a compiler?  Technically I mean - I'd call it a translator.  :)

I wonder how far it can go though, beyond the simple examples I mean.

Translating a push button and a call to ShowMessage() is one thing.  Being
able to translate a complex application with all the libraries that Android
must support strikes me as a number of orders of magnitude more complex.




-Original Message-
From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On

Behalf Of Alister Christie
Sent: Monday, 29 November 2010 12:39
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Company closing

Interestingly the compiler is written in C#

Alister Christie
Computers for People
Ph: 04 471 1849 Fax: 04 471 1266
http://www.salespartner.co.nz
PO Box 13085
Johnsonville
Wellington


On 29/11/2010 12:08 p.m., John Bird wrote:

?http://lenniedevilliers.blogspot.com/2010/09/delphi-for-android-sneak-previ
ew.html

 Just checked out the DelphiDroid - not sure what state its at but simple
 examples are at least working - see a sneak peek video at the above
address.
 Says been tested with Delphi 6.0, 7.0, 2005, 2006 and 2010.

 This is exactly the sort of tools we need - why does Embarcadero not jump
 onto this asap???


 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

___
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] Company closing

2010-11-28 Thread John Bird
?http://lenniedevilliers.blogspot.com/2010/09/delphi-for-android-sneak-preview.html

Just checked out the DelphiDroid - not sure what state its at but simple 
examples are at least working - see a sneak peek video at the above address. 
Says been tested with Delphi 6.0, 7.0, 2005, 2006 and 2010.

This is exactly the sort of tools we need - why does Embarcadero not jump 
onto this asap???


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


Re: [DUG] Icon creation

2010-11-28 Thread John Bird
?I just decided to order that Icon Workshop software - note it seems to have 
dropped another $5 in price - its now USD$34 or $NZD$49.20

John


-Original Message- 
From: Jeremy North
Sent: Wednesday, November 24, 2010 10:45 AM
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Icon creation

As people know, I always recommend IconWorkshop for icons and think it
is the ants pants. Tried Gimp (no thanks), IcoFx is ok for a free
product.

Anyway, it is on special at the moment, almost half off. It is a
lifetime license as well.

It is an offer via SWREG so you can't just go to the website (unless
the discount is given in the checkout screen).

Link from email:
http://dr.bluehornet.com/ct/3992300:4569202619:m:1:294663869:22ADE41AE5315E436E0B22FC0E8007EF

Becomes: 
https://usd.swreg.org/cgi-bin/s.cgi?s=47156p=471561v=0d=0q=1rc=45K2D464EWa=swreg_Q4_2010linkid=IWP_2



* No I don't work for them - just like the product.



On Wed, Nov 10, 2010 at 7:52 AM, Alister Christie
alis...@salespartner.co.nz wrote:
 GiMP is pretty awesome, however not overly suited to icon creation.  I
 also use it for all my button images.  Generally I use a really old
 version of Corel Draw (7 I think) for creating a vectored image, then
 copy and paste it into GiMP to sort out the transparancy and shadows and
 stuff.

 What do other people do for button images?
 Draw their own? get pre-built packs? have an in-house graphic artist?

 Alister Christie
 Computers for People
 Ph: 04 471 1849 Fax: 04 471 1266
 http://www.salespartner.co.nz
 PO Box 13085
 Johnsonville
 Wellington


 On 10/11/2010 9:26 a.m., Nick Fauchelle wrote:
 After seeing Alister's video a few years ago, I have been using gimp for
 my icons!

 (Thanks Alister!)

 On Tue, 2010-11-09 at 18:11 +1300, Alister Christie wrote:
 I made this video a few years ago
 http://codegearguru.com/index.php?option=com_contenttask=viewid=12Itemid=27
 making icons with GiMP.

 However there are some quite good free standalone Icon editors.
 Alister Christie
 Computers for People
 Ph: 04 471 1849 Fax: 04 471 1266
 http://www.salespartner.co.nz
 PO Box 13085
 Johnsonville
 Wellington

 On 9/11/2010 5:32 p.m., John Bird wrote:
 I have never read up on best practices/sizes etc for creating
 program icons and BMP files for buttons/images etc.   Anyone got any
 good references to read up further??

 q1 – I have figured how to create a BMP with transparent background
 for bit buttons etc so the image is not square.  How do I create
 same for program ICO files?   All my program icons in the task bar
 are square as a result.

 q2 – Where does everyone else store their image files?  Really they
 should be considered part of the project.   Only the IDE does not
 store what the original filename was, so to find the image again
 (for a bitbutton/program icon etc) I have to know what it was and
 where.   I haven’t made up mind between storing them in the
 project source folder or a separate images folder...

 Any Embarcadero programmers out there reading this – how about the
 IDE stores the names of the files when it loads them, so it can be
 found again.

 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
 ___
 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] DelphiDroid

2010-11-28 Thread John Bird
 of intent.




Alister ChristieComputers for PeoplePh: 04 471 1849 Fax: 04 471 
1266http://www.salespartner.co.nzPO Box 13085JohnsonvilleWellington 
On 29/11/2010 4:19 p.m., Jolyon Smith wrote: 

Is that Android 1.5? 1.6? 2.1? 2.2?  Or will it be 3.0?

 

Apart from that, isn’t a “target” for a compiler a bit more than just an 
OS/platform/framework ... ?

 

If Delphi is to “target” Android then it must target the CPU architectures that 
Android itself runs on (with iPhone the distinction is blurred since only one 
phone hardware platform runs the OS – iPhone the OS is iPhone the hardware, to 
intents and purposes).

 

Android might be running on (currently) ARM-Cortex A7, A8, or A9  (as far as I 
can tell – I am not an Android owner or otherwise particularly interested in 
Android, so this is based on a few mins with my learned friend, Mr Google J)

 

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of Alister Christie
Sent: Tuesday, 30 November 2010 14:11
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] DelphiDroid

 

My understanding is that both Android and iPhone are being actively 
experimented with as targets for the compiler.  We'll probably hear more once 
we have OS/X, Win64 and Linux support, which I suspect that it would be at last 
2 years away




Alister ChristieComputers for PeoplePh: 04 471 1849 Fax: 04 471 
1266http://www.salespartner.co.nzPO Box 13085JohnsonvilleWellington 
On 29/11/2010 1:40 p.m., David Brennan wrote: 

I think Jolyon is right.

 

The difference between a proof of concept (which is basically what the guy has 
now) and a robust tool which handles the majority of Delphi features and 
libraries is enormous. Several orders of magnitude sounds about right to me 
(meaning 100-1000 times more difficult, or even more).

 

I agree with the general principle though that being able to build for Android 
(and/or iPhone and others) would be great. However I think the only way it 
could really be done in a decent way is by Embarcadero continuing to extend the 
back end compiler to support more and more target platforms. They have made a 
few references in recent times which suggest they hope to do this but only time 
will tell.

 

Cheers,

David.

 

 

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of Jeremy Coulter
Sent: Monday, 29 November 2010 1:23 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Company closing

 

you should download it and make it do more then :-)

jeremy

On Mon, Nov 29, 2010 at 1:12 PM, Jolyon Smith jsm...@deltics.co.nz wrote:

Is it a compiler?  Technically I mean - I'd call it a translator.  :)

I wonder how far it can go though, beyond the simple examples I mean.

Translating a push button and a call to ShowMessage() is one thing.  Being
able to translate a complex application with all the libraries that Android
must support strikes me as a number of orders of magnitude more complex.




-Original Message-
From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On

Behalf Of Alister Christie
Sent: Monday, 29 November 2010 12:39
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Company closing

Interestingly the compiler is written in C#

Alister Christie
Computers for People
Ph: 04 471 1849 Fax: 04 471 1266
http://www.salespartner.co.nz
PO Box 13085
Johnsonville
Wellington


On 29/11/2010 12:08 p.m., John Bird wrote:

?http://lenniedevilliers.blogspot.com/2010/09/delphi-for-android-sneak-previ
ew.html

 Just checked out the DelphiDroid - not sure what state its at but simple
 examples are at least working - see a sneak peek video at the above
address.
 Says been tested with Delphi 6.0, 7.0, 2005, 2006 and 2010.

 This is exactly the sort of tools we need - why does Embarcadero not jump
 onto this asap???


 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

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

Re: [DUG] Company closing

2010-11-26 Thread John Bird
?IT work is expected to pick up over the next few months.  Just checked out 
the latest language surveys at

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

Top ones are still Java, C, C++, PHP, C#, Python.   Delphi at number 12. 
Java at 18% currently score more than 3x C# at 5.7%.  Delphi is 1.6%, Pascal 
.7%.

I think if I were to learn another language to expand toolsets it would be 
Java/PHP/Python.   Or C#?

Or whatever is best to develop iPhone (Objective C) and Android with - 
Android is Dalvik (Java variant)

John


Hi All,

I know I haven't been much of a participant in this mailing list, but I
thought I would start saying goodbyes...

My employer (Forum 8 NZ Ltd) is being closed down by our parent company
in Japan.

Anybody looking for experienced developers in Christchurch?

Cheers,
Alistair.


___
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-23 Thread John Bird
Iterating over a string is for the purpose of doing something with each 
individual character..whether it is a ‘A’   or a 'A' with a ^ (caret) on 
top of it.   When I said the number of bytes in a character varies I was not 
meaning the number of bytes in a Char - I was meaning the total number of 
bytes in a one resulting character or letter might vary.   For instance the 
word fiancee  (with an acute on the last e) has 7 characters, the last of 
which might be 2 code units

When I iterate over a string I ideally want to get one character in the word 
each time:

could I build a string like this?

setlength(String1,7);
string1[1] := 'f';
string1[2] := 'i';
string1[3] := 'a';
string1[4] := 'n';
string1[5] := 'c';
string1[6] := 'e';
string1[7] := 'e';//I would want the full e acute here

hence I want to be able to go

for i :=1 to length(string1) do
begin
thisChar:=string1[i];//get each character one at a time
listbox1.items.add('i=' + inttostr(i)+'  character at position i 
= ' +ThisChar;
end

I would be expecting to see 7 characters, 7 lines in the list box, and 
length=7,  with the last being e acute.
Now everything Jolyon  are saying and Cary also implies that this is not 
going to work.   This looks to be a real nuisance!

Now I think the e acute could be one unicode character (as there is likely 
to be a representation using one character, one code point and one code 
unit) or as one character, two code units, 2*2 bytes - a surrogate pair - 
where eg one supplies the e and one the acute.   So it looks like what I see 
might vary according to how the e acute is encoded in the string?

As I read further this gets murkier, as some of the things Cary Jensen says 
are not the same as what you say even if you say it emphatically!

This is why I am thinking we have to understand clearly Unicode, and the 
Windows implementation of it.and I don't really yet.

Here is what Cary Jensen says about a similar example with 7 characters, one 
of which is a surrogate pair:


Although there are 7 characters in the printed string, the UnicodeString 
contains 8 code
units, as returned by the Length function. Inspection of the 6th and 7th 
elements of the
UnicodeString reveal the high and low surrogate values, each of which are 
code units.
And, though the size of the UnicodeString is 16 bytes, ElementToCharLen 
accurately
returns that there were a total of 7 code points in the string.
While these answers suffice for surrogate pairs, unfortunately, things are 
not exactly the
same when it comes to composite characters. Specifically, when a 
UnicodeString contains
at least one composite character, that composite character may occupy two or 
more code
units, though only one actual character will appear in the displayed string. 
Furthermore,
ElementToCharLen is designed specifically to handle surrogate pairs, and not 
composite
characters.
Actually, composite characters introduce an issue of string normalization, 
which is not
currently handled by Delphi's RTL (runtime library). When I asked Seppy 
Bloom about this,
he replied that Microsoft has recently added normalization APIs (application 
programming
interfaces) to some of the latest versions of Windows, ® including Windows® 
Vista,
Windows® Server 2008, and Windows® 7.

Seppy was also kind enough to offer a code sample of how you might count the 
number of
characters in a UnicodeString that includes at least one composite 
character. I am
including this code here for your benefit, but I must offer these cautions. 
First, this code
has not been thoroughly tested, and has not been certified. If you use it, 
you do so at your
own risk. Second, be aware that this code will not work on pre-Windows XP 
installations,
and will only work with Windows XP if you have installed the Microsoft 
Internationalized
Domain Names (IDN) Mitigation APIs 1.1.

http://www.embarcadero.com/images/dm/technical-papers/delphi-unicode-migration.pdf

Elsewhere he implies that Delphi can handle normalised strings for 
comparisons if one is careful, as in

var
s1, s2: String;
begin
ListBox1.Items.Clear;
s1 := 'Hell'#$006F + #$0308' W'#$006F + #$0308'rld';//make using 
surrogate pairs
s2 := 'Hellö Wörld';
ListBox1.Items.Add(s1);
ListBox1.Items.Add(s2);
ListBox1.Items.Add(BoolToStr(s1 = s2, True));
ListBox1.Items.Add(BoolToStr(AnsiCompareStr(s1, s2) = 0, True));
The contents of ListBox1 are shown in the following figure.

Hellö Wörld
Hellö Wörld
False
True

Now I am not sure if the above example will show properly in email - because 
email text is generally limited to the ASCII characters and lists like this 
usually also restrict to text and not HTML emails.   So as a related 
exercise I am curious whether the above example prints OK on the 
list..the words  hello and world should have umlaut  (..) over each o in 
case it doesn't arrive like that on the list.

John

As I understand it iterating over a string with Chars 

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

2010-11-23 Thread John Bird
?I read in one of the references that UTF-32 was a more common standard on 
Unix systems - which means I guess they have chosen the simplest format at 
the trade off of using more space?

I think linux/Windows/MacOS use UTF-16 more commonly...

Anyway for the time being, as long as the data in strings is unicode, but is 
still Latin 8859 (ie ASCII characters) I can without worrying too much 
iterate over a string one character at a time...using length.

That was the main thing I wanted to know

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


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

2010-11-22 Thread John Bird
Thanks for the references, so I can answer most of the questions now. 
Here is what I understand so far, if anyone has anything to add this will be 
useful!

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.

Q2 – With XE do the .pas and .dfm files become unicode text and hence cannot
be read by earlier Delphi, eg D2007 any more?

Answer - Is a project option from what I have read?, yes not portable if 
unicode.

Q3 – I do a lot of reading ascii data files, and writing back.   Using
mainly TFilestream and stringlists.   Does this in general mean I will need
to use file variables declared as Ansichar and AnsiString instead of Char
and String?
(I would prefer to use the standard VCL where possible)

If I have variables
as1:Ansistring;
s2:string;

Q4 – if I do s2:=as1  does this convert ansistrings to unicode?

Answer - yes, there are performance issues to watch out for if conversion 
happens a lot.

Q5 – if I do as1:=s2 does this convert a unicode string to ansistring?

(otherwise how do I do this?)

Answer - yes, there are performance issues to watch out for if conversion 
happens a lot.

Q6 – I understand any code like

char1:=string1[i];
if char1 in [‘a’..’z’] then
begin
message:=string[i]+’ - character is lowercase’;
end

will break, as ansi characters are ordinal (less than 256 or 512)
and set comparisons ['a'..'z']  or ['a','b','c']can be used, this set
code cannot be used for unicode characters.   What is the replacement?

Answer - There is CharInSet call and numerous extra housekeeping functions 
added in TCharacter.

Q7 – do literals like  #13#10 still mean carriage return and linefeed?  #9
means tab?
if I have code like (logline string1 string2 are string)

logline:=FormatDateTime(‘dd-mmm- hh:nn:ss’,now) + string1 +
#13#10+#9 + string2;
ShowMessage(logline);
Button1.hint:=logline;
writeln(f,logline);

these work D5-D2007   - ie a 2 line messagebox text, 2 line hint,
and 2 lines written to a log file.
is this still going to work?

do carriage returns/tabs/other control characters have to be defined
differently, eg as constants?

Answer - not figured out yet - anyone else know?

Q8 – stringlist1.loadfromfile(‘Test1.txt’);
what happens if this file is ascii text being read into a stringlist
which is unicode strings.

Answer - Default is Ascii text for loadfromfile and savetofile, use 
overloaded routines for Unicode

Q9 -   stringlist1.savetofile(‘Test1.txt’)
 presumably this is no longer ascii text.   How do I save and read a
stringlist to/from a file if it is to be Ansi text?

Q10 – If there are complexities in Q8 and Q9 is there a TAnsiStringlist
type (for ansistrings) as well as a unicode TStringlist type?
(I use stringlists a lot)

Answer - unicodestring lists can save to ascii or unicode files, so 
TAnsiStringlist not needed.

Q11 – do inifiles become unicode too?

Answer - looks like no?  Not clear?  Anyone else know?

Q12 – does Windows Notepad open unicode text files correctly?   or can it
only be used on Ansi text files?

Anyone know this?

Q13 - It looks like most programmers editors read and write ascii and
unicode encoding.the one I use seems to distinguish between UTF-8 and
unicode as well – what is the difference?

Anyone know this?

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] Upgrading to XE - Unicode strings questions

2010-11-22 Thread John Bird
My main remaining question is the best way to handle code that up to now 
looked like:

for i:=1 to length(string1) do
begin
DoSomethingWithOneChar(string1[i]);
end;

If I got the gist correctly, string1[i] is one unicode character, but 
length(string1) is the number of codepoints in the string and not the number 
of characters.  This is gonna be confusing!

Other comments:

Comment 1 - I saw quite a few commentators say that they in general approved 
of the way that the unicode had been implemented - everything that was ansi 
string before is now unicode consistently throughout the whole language and 
IDE, and in the main the only code that needs altering is where Delphi is 
communicating outside the standard language:   ie

-DLL calls
-SavetoFile and LoadFromFile and other file access - even here smart 
defaults have been put in to retain expected behaviour.
-Sending strings to COM/TCP etc you might need to convert to get the kind 
expected
-Database fields - usually handled by making sure the right encoding is 
sent.

Comment 2 - The worst inconveniences are for those who have already tried to 
do some unicode type processing using WideChar, and the functions that were 
used for these.Undoing these changes is usually the best way to cater 
for unicode.Also some of the routines introduced then have horribly 
confusing names,  like AnsiPos   which is for searching widechars and is 
still what should be used for searching.It seems to me that some 
identical routines should be introduced - eg called UnicodePos(.) 
just so that those who are new to Unicode can use at least a consistently 
named set of tools.I would probably make routines named like this which 
I use just to be clear.

Comment 3 - I see a few people arguing that there should have been a 
compiler switch to allow compiling to ansistring  or unicode string 
depending on the compiler switch, to ease converting people to D2009/XE. 
There are merits either way on this - in the long term if everyone is going 
to have to live in a unicode world then its probably better to bite the 
bullet and be made to convert code as eventually you cannot escape it.   In 
such a case a simpler compiler and VCL is a big advantage. This is sort 
of related to being able to cross compile to 64 bit, iPhone, Android - 
whatever way makes it easy to have these forward looking options.The 
quite stark reality is that in 5 years it looks like much but not all 
commercial software will be running on Windows,  its likely to be a mix of 
Web/iPhone/Android/GoogleOS/MacOS   so the forwards portability of compiling 
Delphi for different environments is way more important than whether it 
should be able to do Strings as  AnsiString.

Comment 4 - Has anyone at Embarcadero considered 2 ways to make cross 
platform?option A is to go for a native compiler for different OS's - 
best if can be done.   option B is the Java route - compile to intermediate 
code for a Delphi Virtual Machine which can run interpreted with a runtime 
on many OS's.   Could be called the Delphi Virtual VCL Machine.   The reason 
why this might be a good way to go is that Delphi was originally designed as 
a teaching language - ie formally very strongly typed and formally well 
structured language- it could be about the best candidate around for 
generalised compiling and a simple cross platform runtime. Also with 
Java now owned by Oracle there is questions over if it has such a bright 
future and there is room for another similar approach.   DotNet is a similar 
idea too, but will only ever really be Windows.   A Delphi Virtual Machine 
might not matter too much if its slower if its portable.

[But I digress - The last point is way off topic for Unicode however]

Comment and question 5 - What is the status of Free Pascal/Lazarus  wrt to 
unicode?Does Delphi XE code port or not to Free Pascal?Its an issue 
to consider as well.


___
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 John Bird
?As I understand it iterating over a string with Chars does get around the 
problem of surrogate pairs, as any character you are currently on might be 
either 1,2 or more bytes if it contains surrogate pairs, but just one unicode 
character.   So if one is after iterating over the characters in the string 
your code should be perfect.

My question is if you are not using   for C in String1 do and want to use   
for i:=1 to length(string1) do

what do  you use instead of length to get the number of characters in the 
string in general?  length is not the number of characters, its the umber of 
code-points (including surrogate pairs counted separately)  if I understand 
correctly.

Separate issue - I understand that if one wants to iterate over the bytes of a 
string then one uses byte rather than char, and then one does have to 
investigate each byte to see if it is part of a surrogate pair.  There look to 
be routines for this – however I am guessing most won’t be needing to do this. 
Fortunately!


Also – I think  getting what we used to call the ASCII value of a character, or 
creating a character still works the same-  in fact for english alphabet the 
codes are the same I understand?  Can someone confirm.   (ie the character 
might use 2 bytes if encoded as unicode string, but the value stored for ‘A’ is 
still 41 hex or 65 decimal.   Which means I think that one can do


code1,code2:integer;
char1:ansichar;
char2:char;

char1:=’A’;
char2:=’A’;//unicode char 2 bytes
code1:=ord(char1);
code2:=ord(char2);

in this case I think code1=code2 ??  anyone confirm this.   Of course once one 
goes away from English/latin 8859 characters this is no longer going to be true.



John
 
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

[DUG] Upgrading to XE - Unicode strings questions

2010-11-17 Thread John Bird
Planning upgrading from D2007 to XE, but want to read up on issues I will 
need to consider first to do with strings becoming Unicode by default.   I 
recall the release of D2009 came with good white papers explaining 
ramifications, however I haven’t seen these as I haven’t upgraded.   Asked 
for such also at the XE event but have not been sent anything yet.

I have a lot of code which I want to plan to be able to recompile easily, 
and would like to plan this migration.   I would prefer to put anything 
contentious or varying into a library unit, a ‘wrapper’ so that I don’t have 
to deal with these version differences in the main code...

Anyone can answer any of these quick questions please post here or email 
me – thanks!

Q1 - Anyone got some good references to read up on ansistring to unicode 
issues ?  Comprehensive please!

Q2 – With XE do the .pas and .dfm files become unicode text and hence cannot 
be read by earlier Delphi, eg D2007 any more?

Q3 – I do a lot of reading ascii data files, and writing back.   Using 
mainly TFilestream and stringlists.   Does this in general mean I will need 
to use file variables declared as Ansichar and AnsiString instead of Char 
and String?
(I would prefer to use the standard VCL where possible)

If I have variables
as1:Ansistring;
s2:string;

Q4 – if I do s2:=as1  does this convert ansistrings to unicode?

Q5 – if I do as1:=s2 does this convert a unicode string to ansstring?

(otherwise how do I do this?)

Q6 – I understand any code like

char1:=string1[i];
if char1 in [‘a’..’z’] then
begin
message:=string[i]+’ - character is lowercase’;
end

will break, as ansi characters are ordinal (less than 256 or 512) 
and set comparisons ['a'..'z']  or ['a','b','c']can be used, this set 
code cannot be used for unicode characters.   What is the replacement?


Q7 – do literals like  #13#10 still mean carriage return and linefeed?  #9 
means tab?
if I have code like (logline string1 string2 are string)

logline:=FormatDateTime(‘dd-mmm- hh:nn:ss’,now) + string1 + 
#13#10+#9 + string2;
ShowMessage(logline);
Button1.hint:=logline;
writeln(f,logline);

these work D5-D2007   - ie a 2 line messagebox text, 2 line hint, 
and 2 lines written to a log file.
is this still going to work?

do carriage returns/tabs/other control characters have to be defined 
differently, eg as constants?

Q8 – stringlist1.loadfromfile(‘Test1.txt’);
what happens if this file is ascii text being read into a stringlist 
which is unicode strings.

Q9 -   stringlist1.savetofile(‘Test1.txt’)
 presumably this is no longer ascii text.   How do I save and read a 
stringlist to/from a file if it is to be Ansi text?

Q10 – If there are complexities in Q8 and Q9 is there a TAnsiStringlist 
type (for ansistrings) as well as a unicode TStringlist type?
(I use stringlists a lot)

Q11 – do inifiles become unicode too?

Q12 – does Windows Notepad open unicode text files correctly?   or can it 
only be used on Ansi text files?

Q13 - It looks like most programmers editors read and write ascii and 
unicode encoding.the one I use seems to distinguish between UTF-8 and 
unicode as well – what is the difference?

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

Re: [DUG] Delphi XE update 1 fails

2010-11-15 Thread John Bird
?Cannot see how this is Embarcaderos fault.

I have seen Mail Marshall refuse an attachment with a .ZIP extension.   I 
then sent the ZIP file with a .DAT extension which also got blocked.   I had 
assumed a .DAT was the most general and innocuous and least blocked 
extension until then (as it generally has no programs associated with it) 
The firm in the end got a network technician to bring the update on a USB 
drive.   Of course that cost them money.

These firewalls/spam filters etc are nuts when they provide the owner with 
no way to let through an update they actually do want to get.

John

Behalf Of David Moorhouse (DUG)
Sent: Tuesday, 16 November 2010 12:11 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] Delphi XE update 1 fails

Hi

We're trying to install this update from behind a corporate firewall, and
our web sanitiser (Web Marshall) cannot open the downloaded 7zip files for
checking.  So no update happening here.

When is EMB going to come up with something that works for a change ?


___
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 John Bird
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 
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

[DUG] Icon creation

2010-11-08 Thread John Bird
I have never read up on best practices/sizes etc for creating program icons 
and BMP files for buttons/images etc.   Anyone got any good references to read 
up further??

q1 – I have figured how to create a BMP with transparent background for bit 
buttons etc so the image is not square.  How do I create same for program ICO 
files?   All my program icons in the task bar are square as a result.

q2 – Where does everyone else store their image files?  Really they should be 
considered part of the project.   Only the IDE does not store what the original 
filename was, so to find the image again (for a bitbutton/program icon etc) I 
have to know what it was and where.   I haven’t made up mind between 
storing them in the project source folder or a separate images folder...

Any Embarcadero programmers out there reading this – how about the IDE stores 
the names of the files when it loads them, so it can be found again.

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

[DUG] Duplicate post

2010-11-08 Thread John Bird
Forgive the duplicate post.   This time not my fault – someone at Telstra is 
no doubt sweating and swearing and cursing trying to get their email systems 
going again including Paradise, so looks like they are sending some messages 
twice.

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

Re: [DUG] Solid State Drives

2010-11-06 Thread John Bird
?Sort of similar config, except 32bit Windows 7 with 4GB Ram, and a VMware 
XP with D2007 and 1GB allocated.

I find the performance of the VMWare virtual PC the worst aspect of it - the 
XP virtual machine is really prone to triggering intense disk writes - which 
looks like Windows XP starting swapping in the virtual PC, and resuming and 
suspending the virtual PC gives about 3 minutes of solid disk activity that 
kills the PC until finished.   It almost looks like the virtual hard disk 
file is getting rewritten, and this triggers some kind of issue in the 
Windows 7 - the Windows 7 Resource Monitor shows the disk writes look to be 
to do with the VM hard disk file and the Windows 7 system volume 
information.

Anyone have any tips how this can be tuned better?

Most of the time its not Windows 7 running out of memory, as I keep an eye 
on this.

Also have to say that both the VM and Windows 7 have D2007 installed and the 
performance of D2007 under Windows 7 native is much better - eg in the VM 
there is often a delay on hitting  F9 before any compilation starts 
happening.   Should I be allocating more than 1GB, even though most of the 
time D2007 does not seem to use more than 200-300MB memory ?

John


for the last 2 years I've been using Vista 64 bit Quad Core with 8GB
Ram, and Normal reasonably fast HDD's
I run Delphi inside a VMware machine running XP 32bit, with 1.5GB ram 
allocated.

doing a full build of my main app is 953000 lines or so and takes
80seconds or so..


Just got a new machine with windows 7, running the Same virtual
machine. but the Win 7 is using only solid state drives. 100GB and
220GB

Doing a full build is only 11 seconds..

Worth the money? Very much so.. Time savings over a day is quite large
with the overall improvements


-- 
Kyley Harris
Harris Software
+64-21-671-821
___
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] Barcamp possibly?

2010-10-27 Thread John Bird
Would be very interested.

Was talking to Gary B (who runs the list) – he also has been thinking of 
setting up a library where people can contribute code for benefit of others, 
and pick up others tricks.I for instance do all my printing with Rave by 
displaying the stuff on the screen in labels/memos/grids etc and then have a 
generic print button that prints the form.Works so well I have never 
written any special printed reports...would be happy to contribute such an idea 
for example.

John


I think that its a good idea. Esp. If its in diff locations. Then everyone gets 
a chance to be involved esp. Those of us who could get away with doing it 
locally rather than asking to get funding to go out of town which would never 
happen.
 

Jeremy

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of Richard Vowles
Sent: Wednesday, 27 October 2010 19:41
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] Barcamp possibly?

 

I was thinking before this roadshow that a sort of Delphi barcamp might be a 
better bet - I tried organising a Delphi user group a few years back but it 
never worked mores the pity. It doesn't work for most tech groups I find as 
people don't get much value out of it (esp. if its an hour long) and evenings 
are hard for people. 

 

I'm wondering if a full Saturday with multiple rooms and people coming along 
and talking about stuff they are doing, solutions they've found, all that kind 
of stuff would work better? It seems to work in most of the other communities I 
am involved in, would people be interested in that? There are some very clever 
people on this list and I know a few of you are really very good at sharing as 
well as good for networking. 

 

If it worked, we could schedule it every 6-8 months or so (bounce between 
Auckland  Christchurch). We could also make it start later (say 10 or 10:30am) 
to allow people from other cities to come in for the day.

 

Just a thought

 

Richard

-- 
---
Richard Vowles, Technical Advisor
Developers Inc Ltd
web. http://www.developers-inc.co.nz
ph. +64-9-3600231, mob. +64-275-467747, fax. +64-9-3600384
skype. rvowles, LinkedIn, Twitter






___
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] Barcamp possibly?

2010-10-27 Thread John Bird
?I don't think it would be hard to find topics -

For instance off the top of my head:

-it would be interesting to see the sort of programs others are doing
-Their favourite tips and tricks
-some IDE/OO/language education and explanations
-debugging techniques
-tools that others use and how they set up the IDE
-CVS tools
-how people structure putting the not so obvious files used in projects, 
such as documentation and image files...

eg Here is a bet! - I would bet good money (*) no one here knows and uses 
all the tricks in this video which is only about 2 minutes long:

http://www.stevetrefethen.com/files/codecompletion.html

This was for D2006.  If you are still on D7 watch it to see more reasons you 
just might want to upgrade...

John

(* contact me if you use all these.  I will give you your 2 cents worth)

Re Barcamps

Great idea - I'd be a starter and would offer our college as
a possible venjue, we have multiple computer rooms for
instance...

Laurie Bisman..

Laurie..
___
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 Specials

2010-10-21 Thread John Bird


John
From: Jolyon Smith 
Sent: Friday, October 22, 2010 8:53 AM
To: 'NZ Borland Developers Group - Delphi List' 
Subject: Re: [DUG] Delphi Specials

Ø  Aw nuts you are just being a stirrer.

 

Why is pointing out facts considered stirring?



 

I think the best answer to that is the one Josh Kronfeld gave to Paul Henry

:o:p 

:o:p 

Ø  “No-one ever built a statue of a critic”

 

Yet without critics, some people often wouldn’t have been motivated to produce 
the works that lead to statues of them being built.



I am also a classical musician, and I can tell you as far as I know there is 
not a single case in history where any composer was guided, inspired or helped 
by a critic.   In most cases they rather had their lives made difficult by 
them.  And in many cases they had to polite to them because their influence 
through newspapers etc was so powerful even though the critics were often 
really despised as being stupid, malicious and neanderthal in their thinking 
and opinions.   But they couldn’t say so. 







___
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 Specials

2010-10-21 Thread John Bird
I agree, something with real limitations but real usefulness.   A Turbo 
version would be great.

Possible ideas would be

1 – Executables only run on the PC with the Turbo licence.   otherwise full 
version but cheap

2 – Executables have a built in expiry date of 1 year from when compiled. 
otherwise full version but cheap

3 – Executables run only for 1 hour after started, or only 1 hour per day. 
otherwise full version but cheap

4 – Executables have a splash screen or title bar logo that cannot be removed 
saying “Turbo non commercial version”

5 – Will not compile units with more than 1000 lines of code or projects with 
more than 20 units.   Should prevent any commercial projects

6 – Turbo version for students as E did – cannot install any components. 
otherwise full version but cheap7

7 – (My favourite).   Full Delphi version, totally free, and you pay say $2 or 
$5/hr to use it, and you can’t get out of the charges – eg you have to buy 
credit like on a prepaid phone.

8 – They offer some combination of these schemes and you have some choice over 
which ones apply to you.  And you cannot turn all of them off and get around 
the restrictions.

I reckon any of these are not too hard to do, and people wanting a cheap 
version could do any hobby projects with them.   If the restrictions are real 
and cannot be got around then make it a $40 version again for old times sake 
(Turbo Pascal type price)  (except for option 7).

How about these ideas Embarcadero?

John

Yeah. Both you and Wallace are talking about a non or semi commercial 
situation. I think for someone in business the pricing isn’t too bad but they 
don’t cover the non commercial market well at all. I don’t think they know how 
to provide a version that is useful enough for people to use it yet locked down 
enough that it doesn’t cannabilise their commercial sales. Their competitors 
that provide free versions either don’t need the full revenue stream (eg 
Microsoft) or aren’t commercial projects (eg Eclipse). Doesn’t mean they 
shouldn’t find a solution, in fact it is probably critical. Just means there 
may not be an easy solution.
 

 

 



___
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 Specials

2010-10-21 Thread John Bird
?Maybe a related topic - How to make it easy to upgrade.


The main reasons I hear from others for not upgrading are  (with my 
experience in brackets):

1 - locked into 3rd party components with no new versions or expensive new 
versions
[I luckily have steered clear of addon components, except for a couple of 
simple ones with source that have no issues across versions.
As a result typical time from install to adding components to compiling my 
real packages was last time 40 minutes.   Cost was zero]


2 - Using printing (Quick reports etc) that has been replaced  by Rave
[I was well advised to upgrade before I coded any printing, as the earlier 
delphi versions of printing were crap, whereas Rave alone was worth the 
cost.   Tend to agree - Rave reports have made printing easy.]

3 - Cost of upgrading
[Workable.  Bit the bullet and did it]


4 - Time to install a new and get used to a new IDE
[40 minutes]


I reckon for most people 1 2 and 4 are probably more important than 3.

I reckon it might be worth while having a discussion about whether its 
better to avoid 3rd party components altogether and use just VCL to make it 
really easy to upgrade.

I tend to get a lot out of standard VCL, particularly with stringgrids and 
DBGrids doing much of what the fancy commercial ones doing with some clever 
programming.   And standard VCL with XP Manifest or Vista and Windows 7 Aero 
themes look really really nice.   Eg the standard Datetime picker on Windows 
7 is a stunner!   Anyone seen it?   it scrolls and zooms and slides really 
nicely.  Free with Delphi (* note - Windows 7 required as separate 
purchase!)

John


Ian D

I've watched the ongoing discussions re upgrading and costs ..

I still use Delphi 5, and it supports the two products I have out there
reasonably well.

I say reasonably well, in that I'd love to move on to using SQL
databases instead of Paradox, and to use the later features that improve
my productivity in the conversion. To connect to remote databases means
a significant cost, in not only upgrading, but also moving from
professional to a more expensive product.

I have owned D2007 now for some 2 years, and struggle with the
investment of time, on my own, to convert the 3rd party tools and report
writer, in that it won't be paid for directly, neither the time or the
cost of the new product. So. I'm not using it yet.



___
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 Specials

2010-10-20 Thread John Bird
Well thats nuts.

As a user of both Delphi 5 and D2007, you would have to be nuts to want to work 
in D5 if you spend any time programming.   It works, and quite well, but D2007 
and later are so much nicer, and faster to do stuff.If you value your time 
and are programming for anything returning money then its worth it.   Pro 
upgrades are only around 600-700 at the moment anyway. pro includes pretty much 
all that was in Enterprise back in D5 days

I actually reckon Embarcadero could well put a say a 10 year expiry on the IDE. 
  Lots of commercial software is much more brutal than that – for instance 
Window 2000 XP (pre SP2)  are now out of support, no security updates and as we 
well know it really cannot be trusted without them.

Or some kind of Turbo version.   Or a free trial.   Or maybe Embarcadero could 
do a low use version – ie you pay $2 or $5 per hour that you use it.  Otherwise 
a free download.   Now there’s a good idea!

Languages like Delphi are a sort of cooperative venture.   Either you pay with 
your money for occasional and rare updates or it dies.

Otherwise get a free IDE like Eclipse, but these are also cooperative 
enterprises - make sure you give a good amount of time in enhancing them and 
improving them, otherwise you are likewise riding off the work of lots of 
others.

Like everything else, it comes down to the simple equation of what works best 
for the dollars – “bangs for the bucks”.  I reckon the bang for the bucks with 
Delphi has always been pretty good, especially after you can keep using it for 
over 10 years.   Over 10 years I estimate I have purchased probably 8 versions 
of Windows.  And I only have 1 pc at once...

John

From: Edward Koryagin 
Sent: Thursday, October 21, 2010 3:42 PM
To: NZ Borland Developers Group - Delphi List 
Subject: Re: [DUG] Delphi Specials


  Wonderful questions.
  Edward Koryagin

  --- On Thu, 21/10/10, Marshland Engineering marshl...@marshland.co.nz 
wrote:


From: Marshland Engineering marshl...@marshland.co.nz
Subject: [DUG] Delphi Specials
To: delphi@delphi.org.nz
Received: Thursday, 21 October, 2010, 3:03 PM


I keep seeing all these specials, but for the 2-3 programs I write a 
year, Delphi 4 does the trick. 

It looks like  Embarcadero keeps itself going with existing customers 
(which over time will diminish) with upgrades.

Now if I was starting out from fresh, would I spend  $3499 when there 
is a wealth of free programs out there?

TurboCAD and Alibre for example both have an entry level packages of 
less than $100 to get you started.  

Is there something like this happening in the future for Delphi? 

Cheers Wallace




-Inline Attachment Follows-


___
NZ Borland Developers Group - Delphi mailing list
Post: wlmailhtml:/mc/compose?to=del...@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to 
wlmailhtml:/mc/compose?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

[DUG] Finding system settings

2010-10-20 Thread John Bird
I would like to find some system settings - 

eg volume ID of a drive (which might be a network drive), and time zone.   Any 
suggestions?

Related  - I recall seeing a unit somewhere years ago that showed a lot of 
windows settings (eg Windir) I am not sure what it was and where, anyone know 
of something good like that they recommend?

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

Re: [DUG] Delphi Specials

2010-10-20 Thread John Bird
Aw nuts you are just being a stirrer.

I actually use D5 and D2007 both a lot for work.  So thats my experience – I 
greatly prefer D2007.

For me a pro upgrade is $600-700 so thats also true.

The point about Windows updates are:

MS updates Windows still (mind you only XP SP3 onwards now) not because they 
want to or like to but because the security holes are so big they would look 
really really bad if they didn’t.

What I am saying is do not punish Borland and Embarcadero for making a product 
that was reliable and well usable for 10+ years.   Reward them by spending a 
small amount of money to keep them in business. And into the bargain enjoy a 
much better version of Delphi.

Another reason for having the latest is to make use of the XP and Aero theme 
support.   In my mind, with that you hardly need 3rd party components because 
the standard VCL looks so good.

I am grumpy about buying 8 versions of Windows mainly because I couldn’t move 
the licences from PC to PC and until windows 7 the OS was pretty crap anyhow.  
I have however moved Delphi from PC to PC and been grateful to be able to.

I still have my D5 installation, only once I upgraded I never opened it again 
to compile anything.  Not once – the new version worked straight away and I 
just jumped into it.In my case I jumped from D5 to D2006 with not the 
slightest hassle.

To answer the original question, without customers the eventual future is that 
it will rather than die it once E gets insufficient revenue from it they will 
hopefully open source it.   Then good people like Jeremy N and others will 
spend time fixing the bugs for free, and people like you will still keep 
complaining about unfixed bugs.   Hopefully by that stage you will start 
helping with the coding.

I come back to my original point – either you spend some time helping to fix 
the bugs or you pay for versions where others have done it for you.   In the 
end someone does need to get rewarded either with money or at least some thanks 
and recognition.

Sibelius once said in response to a critic who called his music old fashioned

“No-one ever built a statue of a critic”

John

From: Jolyon Smith 
Sent: Thursday, October 21, 2010 5:07 PM
To: 'NZ Borland Developers Group - Delphi List' 
Subject: Re: [DUG] Delphi Specials

Ø  Well thats nuts.

 

Which neatly described what followed, rather than what was being replied to 
;)

 

 

 you would have to be nuts to want to work in D5 if you spend any time 
 programming.

 

I suggest that is not for you to say on behalf of others.  You are free to have 
that view for yourself, but if a version of software works well enough for 
someone, suggesting that they should pay a not insignificant amount of money 
and incur the productivity penalty of having to familiarise with a 
significantly different version of the product is presumptive at best and 
nonsense at worst.

 

 

Ø  Pro upgrades are only around 600-700 at the moment anyway

 

Nope.  The poster is deemed unclean and not worthy of upgrade pricing anymore.  
New user license required.

 

I believe this is what Embarcadero are currently calling their “Bog Off” 
promotion – Oh no, wait, that’s “BOGOF - Buy One Get One Free”, not “you 
haven’t kept upgrading so you can BOG OFF and use Visual Studio instead for all 
we care”.

 

 

 pro includes pretty much all that was in Enterprise back in D5 days

 

Well, you still can’t connect to remote servers using the proprietary DB API.  
Doesn’t stop you using ADO of course, which makes the restriction even more 
ridiculous imho.

 

And let’s think about this for a minute... you are suggesting that a version of 
the software which contains a bunch of stuff that wasn’t considered necessary 
for a particular user back when they bought their licenses and suggesting that 
getting those undesired/unnecessary features is a good reason to pay through 
the nose to get current now?

 

 

 for instance Window 2000 XP (pre SP2)  are now out of support

 

EXCUSE ME?

 

Every version of Delphi goes “out of support”, in those terms, as soon as the 
next version is released.  Windows 2000/XP don’t stop working when their 
support period ends either, just like Delphi (assuming there is still someone 
servicing product activation requests, for the more recent versions), but you 
DO still keep getting updates and fixes for MS products, LONG after their 
replacement products have been introduced.

 

Compare and contrast THAT with Delphi.

 

 

Just my 0,02 




___
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: 

Re: [DUG] Just in case you missed it

2010-10-17 Thread John Bird
Is there a mailing list to get offers like this?  I hadn’t heard of this or 
the XE event until it came up here on the Delphi list.

Please add me to any such lists.

John

From: Richard Vowles 
Sent: Monday, October 18, 2010 12:33 PM
To: NZ Borland Developers Group - Delphi List 
Subject: [DUG] Just in case you missed it

If you have a Pro version, Embarcadero have a special offer on - 20% off until 
the end of the year if you are on a 2010 version of C++ Pro, Dlephi Pro or RAD 
Studio Pro 

The info is here: http://www.embarcadero.com/radoffer

Call Danielle on 0508 DEVINC or email her on off...@developers-inc.co.nz to get 
the special offer - you get a different set of keys which checks to see if your 
previously registered account has got a valid 2010 license, so make sure you're 
going to register under the same account name :-)

For everyone else, our $NZ100 off until the 22nd (this friday) still stands - 
across all versions.

Richard

-- 
---
Richard Vowles, Technical Advisor
Developers Inc Ltd
web. http://www.developers-inc.co.nz
ph. +64-9-3600231, mob. +64-275-467747, fax. +64-9-3600384
skype. rvowles, LinkedIn, Twitter






___
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] Just in case you missed it

2010-10-17 Thread John Bird
How much longer is upgrade from D2007 likely to be counted as an upgrade – any 
ideas or hints?

John
 
Hi Paul,

Everyone who doesn't have a 2010 version of the product (Delphi/C++/RAD 
Studio), if you are on 2009, 2007 or 2006 upgrade-wise or earlier (who have to 
purchase new now). 


On 18 October 2010 13:40, Paul A Norman paul.a.nor...@gmail.com wrote:

  For everyone else

  For everyone else?


-- 
---
Richard Vowles, Technical Advisor
Developers Inc Ltd
web. http://www.developers-inc.co.nz
ph. +64-9-3600231, mob. +64-275-467747, fax. +64-9-3600384
skype. rvowles, LinkedIn, Twitter






___
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

[DUG] Rave printing

2010-10-12 Thread John Bird
?I have a generalised routine for printing forms using Rave reports D2007.

I struck an interesting problem printing contents of a DBGrid showing 
columns from a MSSQL database - I think its because the fields are null or a 
type (eg binary) that ClientDataSets cannot display.   Printing that column 
gives an access violation.  I want to have it print nothing of course for a 
column with invalid or null or blank  data, haven't yet figured out how to 
skip them.

Here is the essential code that prints the columns of the grid, (I have 
already set tab positions scaled to widths of the columns).
- I think this particular column (column 4 in this case) has nulls.

[here lcds is a TClientDataSet, lDBGrid is a TDBGrid,  ThisField is aTField]

  for rowptr := 1 to comprowmax do
  begin
lcds.RecNo:=rowptr;   //have to move around dataset
for colptr := 0 to compcolmax do
begin
  ltext:='';
  //column may not have a field associated...
  if lDBGrid.Columns[colptr].Fieldname  '' then
  begin
ThisField:=lDBGrid.Columns[colptr].Field;
if not ThisField.IsNull then 
lText:=lDBGrid.Fields[colptr].asString;==access violation
  end;
  printtab(ltext);
end;
println('');
end;

Any ideas how to bullet proof this?

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


Re: [DUG] You're gonna get an invite tonight!

2010-10-05 Thread John Bird
Yeah – what invite?  I am waiting too.

John

Hi Richard

I'm still waiting for my invite - you can send it to my work address if that's 
easier.

davi...@pegasus.org.nz

Cheers

David

On 30/09/10 16:14, Richard Vowles wrote: 
  Hi guys, 

  If all goes to plan, you should get some email from us tonight inviting you 
to the NZ launch (Auckland and Christchurch) of RAD XE. Malcolm is coming over 
and he really is the man for being able to take up your issues and answering 
any questions. I'm the supporting act, and I'm looking forward to seeing 
everyone again. 

  If you don't have it by tomorrow, please send me an email and I'll forward it 
on.

  Richard

  -- 
  ---
  Richard Vowles, Technical Advisor
  Developers Inc Ltd
  web. http://www.developers-inc.co.nz
  ph. +64-9-3600231, mob. +64-275-467747, fax. +64-9-3600384
  skype. rvowles, LinkedIn, Twitter




___
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] Rad Studio XE Enterprise

2010-09-27 Thread John Bird
Ha - does it still do that?

(D2007 here)

The instant compiler does not always find stuff.  Such as TEdit for 
instance. As long as normal compile works I can live with it

John

Anyone actually using XE yet?

We're using 2009 and still some buggy things in the IDE which would make
me consider jumping to 2010 alone, if they were fixed eg; randomly
unable to find 'controls' or some other core unit which then adds red
lines to half the unit, annoying!




___
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


[DUG] integer or int64

2010-09-20 Thread John Bird
Quite a few built in Delphi functions accept either integer or int64 as an 
argument, I checked into inttostr for instance, in that case its asm code.

I have quite a few standard number processing routines, and up to now have 
done one version for integer, and another for int64.

Is it feasible to have an argument/parameter to a function that can be 
either (like Delphi does)?

is it possible to test whether such an argument is either integer or int64?

Related - Does anyone know if an int128 is on the cards down the track?  (I 
have some functions that use numbers nearly up to int64 limit - 17 of the 18 
digits decimal length)



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


Re: [DUG] integer or int64

2010-09-20 Thread John Bird
I have a calculator program, beyond certain size numbers it resorts to real 
numbers, when sometimes I want exact integers.

eg 17! (17Factorial)  is the highest I can get exactly (17*16*15  etc.), 18! 
turns to a real number and I don't know if I am losing digits.

Another example of large numbers is time converted to milliseconds:

Thisint64:=strtoint(formatDateTime('mmddhhnnsszzz',now));(I 
don't do arithmetic on that but it is 17 digits)

My main guess about int128 is that if it were there it could give real 
numbers to a higher number of precision digits (only 15-16 with current 
real).

would be cool to store numbers like 
pi=3.141592653589793238462643383279502884197169399375105820974944 if my 
memory serves me correctly.  Delphi cannot provide such accuracy.

Reason I asked is I heard that after Windows 7 one of the supposed versions 
of Windows being considered was a 128 bit version.  Also 64bit Delphi on the 
horizon suggests that larger integers might be coming.

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


Re: [DUG] Pasting components from code

2010-09-17 Thread John Bird
Thanks, I had sort of figured it out, but I didn't know the reason.

John

 So before the initial private (or any other) visiblity directive.



___
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


[DUG] Pasting components from code

2010-09-16 Thread John Bird
I have a source generation program to speed creating of sets of labels and 
edit boxes on a form -  which gives output like examples below.

I paste the code that goes in the DFM onto the form, and it creates all the 
components - a neat Delphi trick for those who might not know.

My problem is that the OnEnter and OnExit events seem to disappear from 
these components and I have to add them back manually, even though the code 
was already in the unit when the paste was done.  My detective work so far 
seems to show that it depends on where the forward (first) declaration of 
the event code is placed whether it is recognised or not - seems it has to 
be above the {private} and {public} sections for the form

What are the rules for where such event code has to be declared? - I am 
vague on this.   I have heard others use generated code too, I am wondering 
if they have tips or pitfalls like this to avoid.

(Aside - Personally I favour source generation like this a lot.   It is cool 
to do, ends up as fast as hand written code, and most importantly saves time 
and introduces standard code structure that is easy to understand.)
(Further aside -  this is code generated by the program for a new part of 
itself.   Its cool when a program can write its own code).

example of output from the code generation

// Forward declaration
procedure edtSOURCEINPUTEnter(Sender: TObject);
procedure edtSOURCEINPUTExit(Sender: TObject);


//Implementation ---  edit enter and exit events for editing this 
record 
procedure Tform1.edtSOURCEINPUTEnter(Sender: TObject);
begin
(some code here)
end;

procedure Tform1.edtSOURCEINPUTExit(Sender: TObject);
begin
(some code here)
end;

And:

//Paste onto form

  object lblSrcInpPath: TLabel
Left = 300
Top = 51
Width = 142
Height = 13
Caption = 'Path'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
  end
  object edtSrcInpPath: TEdit
Left = 420
Top = 48
Width = 121
Height = 21
Font.Charset = DEFAULT_CHARSET
Font.Color = clNavy
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 1
Text = ''
Enabled = True
OnEnter = edtSOURCEINPUTEnter
OnExit = edtSOURCEINPUTExit
  end
  object lblSrcInpFileIn: TLabel
Left = 300
Top = 75
Width = 142
Height = 13
Caption = 'Filename without path'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
  end
  object edtSrcInpFileIn: TEdit
Left = 420
Top = 72
Width = 121
Height = 21
Font.Charset = DEFAULT_CHARSET
Font.Color = clNavy
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 2
Text = ''
Enabled = True
OnEnter = edtSOURCEINPUTEnter
OnExit = edtSOURCEINPUTExit
  end

etc


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


Re: [DUG] Pasting components from code

2010-09-16 Thread John Bird
The correct spot being?  (that was my question! - there looks to be rules I 
did not know about. )

Form inheritance - not applicable so much in this case, as the set of labels 
and edit boxes vary totally from case to case.   I just got tired of the 
repetitive task of creating large sets of these one by one and aligning 
them - this program also does alignment.  Also I might want to drop this 
onto an existing form.

Label font  different from edit font - these are taken from a template, so 
that is one of the options - color and style also can differ.

John

 Why not form inheritence?

 Are you declaring the events in the correct spot for the form?

 BTW, you really want your Label font to be different to the Edit font?
 


___
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

2010-09-08 Thread John Bird
Thats a cute program!

Only correction needed is spelling - (Magnitude).   The icon is spookily 
appropriate - did you make it yourself or do you have access to a site with 
earthquake icons?

John

 
From: Jeremy Coulter 
Sent: Wednesday, September 08, 2010 6:50 PM
To: 'NZ Borland Developers Group - Delphi List' 
Subject: Re: [DUG] Delphi


HI guys. Here is the URL.   
http://www.telsoft.net.nz/downloads/quake/QuakeCheck.zip

 

There might be the odd bug. I was really only doing it for my own amusement, 
but nothing too obvious has shown up.

If you have Google Earth installed, it will also generate a KML file so you can 
see the location of all the quakes etc.

 

Have fun J

 

Jeremy

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of Pawel Rewak
Sent: Wednesday, 8 September 2010 17:22
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Delphi

 

Hi Jeremy,

Yes, I am interested :)

Take care,

Pawel





On Wed, Sep 8, 2010 at 2:36 PM, Jeremy Coulter jscoul...@gmail.com wrote:

If anyone is interested, I will post a link to the URL on the list a bit later 
when I have added a couple more features J

 

Jeremy

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of Alistair Ward
Sent: Wednesday, 8 September 2010 16:50
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Delphi

 

Whereabouts around ChCh is everybody based?

 

I'm sitting in an office on Sir Gil Simpson Drive (off Sir William Pickering 
Drive in the Tech Park).

 

Alistair .

 

PS I'm guessing about a 4 for the 4.45pm shake :-)

 


___
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




-- 
Regards,
Pawel Rewak
Practical Programs






___
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

2010-09-08 Thread John Bird
Out of curiosity what is the page control you are using and the chart 
component?   I like both

John

HI guys. Here is the URL.   
http://www.telsoft.net.nz/downloads/quake/QuakeCheck.zip
 

There might be the odd bug. I was really only doing it for my own amusement, 
but nothing too obvious has shown up.

If you have Google Earth installed, it will also generate a KML file so you can 
see the location of all the quakes etc.

 

Have fun J

 

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

Re: [DUG] Delphi

2010-09-07 Thread John Bird
Smaller but closer

The 3pm one was within 5k of Chch.  18 today by GNS count

http://www.geonet.org.nz/earthquake/quakes/recent_quakes.html

This is a list of the latest thirty New Zealand earthquakes.

  a.. 
a.. 
b.. Reference Number: 3368648 
c.. NZST: Wed, Sep 8 2010 4:42 pm 
d.. Magnitude: 3.4 
e.. Depth: 8 km 
f.. Details: 10 km south-west of Christchurch
My house is in  Mt Pleasant, but  have been in Ak the last week.   Decidedly 
mixed feelings about not being there.  House was OK last report, but thats some 
30 aftershocks ago!

John Bird
JBCL
Contact:
johnkb...@paradise.net.nz
jbc...@xtra.co.nz
027 4844528
http://jbclnz.googlepages.com



From: Alistair Ward 
Sent: Wednesday, September 08, 2010 4:49 PM
To: NZ Borland Developers Group - Delphi List 
Subject: Re: [DUG] Delphi


Whereabouts around ChCh is everybody based?

I'm sitting in an office on Sir Gil Simpson Drive (off Sir William Pickering 
Drive in the Tech Park).

Alistair .

PS I'm guessing about a 4 for the 4.45pm shake :-)






___
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] SetWindowPos HWND_TOPMOST

2010-08-23 Thread John Bird
Not just Delphi - its an ancient Windows problem AFAIK.   Even in Windows 7 I 
have seen a control panel applets puts a modal dialog behind the window - often 
the best solution is Windows+D  (show desktop) and go thru all windows with 
alt+Tab and usually the hidden modal dialog is found.   Usually.

John

 
HI have seen this even happen in D2007 ! so I am not sure if it has been sorted 
in later Delphi versions. I have seen other Windows apps. Not written in Delphi 
Exhibit the same thing, so is it a Delphi thing, or a Windows thing?? P.s this 
happens on XP, Vista and Win7 that I have noticed.

 

Jeremy

 

From: delphi-boun...@delphi.org.nz [mailto:delphi-boun...@delphi.org.nz] On 
Behalf Of Ross Levis
Sent: Friday, 20 August 2010 22:04
To: 'NZ Borland Developers Group - Delphi List'
Subject: [DUG] SetWindowPos HWND_TOPMOST

 

I have a window in my app which needs to be set to stay on top of all others.  
In D7, if a modal dialog is activated from this window such as a TOpenFile, it 
appears underneath the window.  I believe later versions of Delphi resolve this 
problem.

 

I got around the issue by using SetWindowPos with HWND_NOTOPMOST just before 
the dialog is activated, and set it back again afterwards.

 

This works well generally, but a few users have complained of the entire app 
hanging either before the dialog appears or after it closes.  I've noticed this 
maybe twice over the last few years using XP.

 

Is this an XP bug or Delphi getting confused?

 

Perhaps I should try a Application.ProcessMessages after the SetWindowsPos.

 

Ross.






___
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] Sending notification between programs

2010-08-18 Thread John Bird
The property
FILE_NOTIFY_CHANGE_LAST_WRITE

looks like a possibility, as if structured data has just been written to a 
file this event should be triggered.   The only gotcha seems to be that the 
better the caching is the less likely the event will fire - according to the 
help.  Tricky.

John


 John,

 Hi.  What you want to use is WinAPI: FindFirstChangeNotification,
 FindNextChangeNotification and FindCloseChangeNotification in program B.
 Essentially, A writes to a file, and renames it.  This causes the handle
 returned by FindFirstChangeNotification to be signaled.  You can test for
 this using a loop and WaitForSingleObject / WaitForMulitipleObjects.  You
 can even specify a timeout in the WaitXXX calls so that B wakes
 periodically, even if there are nothing signaled.  When the WaitXXX 
 function
 returns, you can check for the existence of the file.

 Regards,
 Dennis.

 --
 From: John Bird johnkb...@paradise.net.nz
 Sent: Wednesday, August 18, 2010 4:43 PM
 To: NZ Borland Developers Group - Delphi List delphi@delphi.org.nz
 Subject: [DUG]  Sending notification between programs

 Which way would you favour to do the following ?

 I have two Delphi programs (A and B) that I will pass data from A to B - 
 I
 will probably use  a file to put the data in because its quite 
 structured.
 B will sleep on a timer loop until this something is triggered.

 What I want to do is send a simple notification from program A to B that
 there is something to do - i.e. trigger an event in B to wake and do
 something to process this.

 There are various ways I could communicate this notification

 1 - Has to add minimal overhead of size and processing to programs A and 
 B
 2 - A can tolerate B not responding immediately without freezing but
 preferably will know

 The ways I have considered to be candidates are

 a - Windows messaging
 b - TCP/IP Indy   (which could send the data too.  (adds complexity of
 needs to be done in a thread to not affect the main program A)
 c - make program B a DLL
 d - Roll my own - make a timer in B which polls for for some condition 
 and
 otherwise continues to sleep
 e - something else.

 Kindly share your favoured options how you might do this.

 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 


___
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] Sending notification between programs

2010-08-18 Thread John Bird
I had thought of something just like this, having something in the data being 
what B looks for and acts on, otherwise sleeps.   However this makes it disk 
based, and B has to poll.  I was hoping something simple in memory could wake 
up B rather than referring to the filesystem.

The main disadvantage of using one of the approaches mentioned is that there is 
two things that have to work right for the communication, two things could 
break.

Slight aside:

You know there is one really cunning way to get A to signal to B that I have 
used in the past that involves sending nothing at all:

B in a timer monitors the foreground window title bar of A

P:array[0..256] of Char;

  GetWindowText(GetForeGroundWindow,p,256);
  ATNowNewTitle := p;

then searches for certain text in it, if its there its a signal to do 
something.This assumes A has focus which worked fine in my case.I used 
it to automatically suspend an automated time logging whenever the reporting 
program for said logging was in focus, as it was likely to be searching the 
same data file.It was spooky how well that worked!  (Every time the report 
program lost focus or closed the time logging resumed.)



John

From: Graham Marsden 
Sent: Wednesday, August 18, 2010 7:54 PM
To: delphi@delphi.org.nz 
Subject: [DUG] Sending notification between programs


Keep it simple .


.. will pass data from A to B - I will probably use a file to put the data 
in because its quite structured.
B will sleep on a timer loop until this something is triggered.


Why not use the exis the very existance of the data transfer file as the 
trigger.


Program A creates the file(s) with the data and then goes on with whatever else 
it needs to do. Perhaps even creating another data file or appending to an 
existing one.


Program B sleeps on a timer, wakes up, checks for the existance of a/the data 
file(s). If one/some exist then process, if not then sleep another cycle.


I have use this method to pass both fax and email files and other messages to a 
server. Naming conventions, folder locations etc can all be used to do any 
segregation of users/purposes as required.


Using this method A and B don't even have to be on the same machine.


Hope this helps.


Graham Marsden







___
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

[DUG] Sending notification between programs

2010-08-17 Thread John Bird
Which way would you favour to do the following ?

I have two Delphi programs (A and B) that I will pass data from A to B - I will 
probably use  a file to put the data in because its quite structured.   B will 
sleep on a timer loop until this something is triggered.

What I want to do is send a simple notification from program A to B that there 
is something to do - i.e. trigger an event in B to wake and do something to 
process this.

There are various ways I could communicate this notification

1 - Has to add minimal overhead of size and processing to programs A and B
2 - A can tolerate B not responding immediately without freezing but preferably 
will know

The ways I have considered to be candidates are

a - Windows messaging
b - TCP/IP Indy   (which could send the data too.  (adds complexity of needs to 
be done in a thread to not affect the main program A)
c - make program B a DLL
d - Roll my own - make a timer in B which polls for for some condition and 
otherwise continues to sleep
e - something else.

Kindly share your favoured options how you might do this.

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

Re: [DUG] MSSQL ID field binary(8)

2010-08-16 Thread John Bird
I think I have to agree with your words[5] and words[6] .   Where -  
words:array[0..xxx] of string;

John

I work on systems where some idiot used a decimal(9,0) as a PK and mixed it 
with other tables with integers, I think with any PK the main thing is use the 
same otherwise you force the server to use hash joins (v slow) and secondly use 
the smallest key you can (I'm currently using a bigint derived from the server 
time) I really can see no reason for using anything larger than a bigint for a 
surrogate,  you can use a generator (like I do) or identity for a client 
high/low, if you are going to cluster the pk you want it to be sequential

MSSql 2008 offers a 'sequential guid' but that is 16 bytes versus 8 for a bigint

Neven

  Dealing with index/ID field that is set as binary - here is the solution that 
worked in case any one else comes across same

  Note for MSSQL using such a field in a JOIN SQL statement would be perfectly 
fine as normal, as MSSQL has a native binary type.   Delphi ADO however does 
not, so this is the hoops I had to jump through when its two different datasets 
and I needed to get the value in order to open the other with SQL or as a 
parameter

  example - using a Company_ID from Comp table to open Contacts that belong to 
that Company...

  Comments from friends who know MSSQL - their opinion is that an ID/index 
field that is binary is unusual practice - restricts what kind to indexes can 
be made for instance.  Anyone here have opinion on this?   have others come 
across ID/Index that is Binary often?

  Step 1:

ADOQueryComp.SQL.Text:='select *, Cast(Company_ID as VARCHAR(10)) as 
ACompID, CAST(Company_ID as INT) as DCOMPID from Company '+
  'where Company_Name like '+likestr;

  Note - Casting binary to string/Varchar does not work, but to integer does.   
Go figure!


  Step 2:

iCompanyID:=cdsComp.FieldbyName('DCompID').asinteger;

ADOQueryContact.SQL.Text:='select * from Contact '+
  'where Company_ID = CAST('+inttostr(iCompanyID)+' AS BINARY(8))';

  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___
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] MSSQL ID field binary(8)

2010-08-05 Thread John Bird
MessageDealing with index/ID field that is set as binary - here is the solution 
that worked in case any one else comes across same

Note for MSSQL using such a field in a JOIN SQL statement would be perfectly 
fine as normal, as MSSQL has a native binary type.   Delphi ADO however does 
not, so this is the hoops I had to jump through when its two different datasets 
and I needed to get the value in order to open the other with SQL or as a 
parameter

example - using a Company_ID from Comp table to open Contacts that belong to 
that Company...

Comments from friends who know MSSQL - their opinion is that an ID/index field 
that is binary is unusual practice - restricts what kind to indexes can be made 
for instance.  Anyone here have opinion on this?   have others come across 
ID/Index that is Binary often?

Step 1:

  ADOQueryComp.SQL.Text:='select *, Cast(Company_ID as VARCHAR(10)) as ACompID, 
CAST(Company_ID as INT) as DCOMPID from Company '+
'where Company_Name like '+likestr;

Note - Casting binary to string/Varchar does not work, but to integer does.   
Go figure!


Step 2:

  iCompanyID:=cdsComp.FieldbyName('DCompID').asinteger;

  ADOQueryContact.SQL.Text:='select * from Contact '+
'where Company_ID = CAST('+inttostr(iCompanyID)+' AS BINARY(8))';

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

[DUG] MSSQL ID field binary(8)

2010-08-01 Thread John Bird
Dealing with a MSSQL database where the ID field is defined as Binary ( 8 ) and 
using D2007 / ADO.  I can open the table and read in data, but  I cannot figure 
out:

1 - how to get the ID value out of this field - when displayed a grid shows 
this column as (BYTES), if I try to get the value as a variant then as a string 
I get an empty string

TheCompanyID_I_Want:=TABLE1.FieldByName('COMPANY_ID').asXDataType;

ie what datatype XDataType do I need to use to get the value ??

The best light I could shed on it with Google was a hint that this type might 
arrive as an array of Bytes - in which case how to process that?


2 - All I want to do with this value is to put in into a subsequent SQL 
statement on another table to do a further select of all records with this 
ID

qryTable2.SQL.Text :=  'SELECT * FROM TABLE2 WHERE COMPANY_ID = 
'+XDataTypeToString(TheCompanyID_I_Want);


Sorry for asking what is probably a dumb question, but its late at night and I 
am stuck.  And as Einstein said He who asks a question is a fool for a moment 
- he who doesn't ask a question is a fool forever


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

[DUG] Another Desktop Clock giveaway

2010-07-28 Thread John Bird
A Windows 7 Clock look-alike this time - a bit smaller, fainter and more 
refined than the last one.  For screenshots, scroll to the bottom of this page:

http://sites.google.com/site/jbclnz2/abouttime

Email me if you would like a copy - standalone exe of 480K.   Written using 
D2007/Windows 7.

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

Re: [DUG] faster TreeView

2010-07-26 Thread John Bird
Any good reference tutorials on using this?  I looked at it some years ago and 
was quite baffled where to start.  Speaking as someone used to driving the 
drawcell events on standard stringgrids I would like to explore the stuff it 
can do.

John

Is that not also the one that Embarcadero use too in the Delphi IDe now??  I am 
sure I read/heard that.

Jeremy


On Sat, Jul 24, 2010 at 7:42 AM, Dennis Chuah dennis_cs_ch...@hotmail.com 
wrote:


  Hi.  Check out Virtual Treeview http://www.soft-gems.net/.  Very fast and
  very flexible.  The programming paradigm is different, so there is a leaning
  curve.  But once you get over that, you will find that it is the best
  treeview / grid component ever.

  Regards,
  Dennis.

  --
  From: Rogério Martins rogmart...@gmail.com
  Sent: Saturday, July 24, 2010 12:42 AM

  To: NZ Borland Developers Group - Delphi List delphi@delphi.org.nz

  Subject: [DUG] faster TreeView


   Hi all !
   Does any one know a TreeView component faster than the original borland
   TTreeView when adding, deleting nodes (many at once) and changing its text
   ?
  
   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

  ___
  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] 96DPI and 120DPI

2010-07-21 Thread John Bird
Well as I understand using 120DPI is for the same reason - making app windows 
larger and easier to read on the screen - or at least the text larger.  I have 
users with oldest to newest screens - from about 800x600 up to 1920x1024 so I 
have to do something like this for the form to be fairly consistent 

Mainly I want to figure out how to set my ScaleBy routine so its not thrown by 
120DPI - how does it affect windows controls and their sizing - anyone there 
can shed clear light on this?

Specifically  are the screen.height  screen.width figures still accurate, and 
does  Screen.PixelsPerInch, and form1.pixelsPerInch  
return the correct values?   Mainly I want to figure out there is a different 
relationship in grids between grid.width  grid.defaultrowheight  and 
grid.font.size - or maybe its as simple as doing the Form.ScaleBy before rather 
than after doing the grid adjustments...



The main problem is I don't have a 120DPI screen to test on.   If I am testing 
on a laptop is it feasible to set to 120DPI or will it mess up too much other 
general windows stuff?



Also - does your stuff handle 144DPI?  I saw references that that setting is 
also appearing - looks to be an option in Windows 7.

 

John
 
I've never used ScaleBy so cannot really help.  I don't see that being useful 
in many cases.  Operators often use large monitors with high resolutions so 
they can fit more app windows on the screen at the same time.  Forcing the app 
to take up more space doesn't make sense to me.

 

Ross.
___
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

  1   2   3   4   >