Using the latest AX version.
I'm using the import method loadfromfile() and want to check if the loading went without problems. Looking via the debugger it shows that this method always returns NIL no matter if the was loaded successfully, wasn't found, was corrupt etc..
Shouldn't there be a return value like a Boolean or a pointer (like normal filehandling) to check this.
TIA,
Jack
return value loadfromfile()
Re: return value loadfromfile()
Hi Jack,
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=911
http://bugs.teechart.net/show_bug.cgi?id=912
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=911
http://bugs.teechart.net/show_bug.cgi?id=912
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: return value loadfromfile()
Hi Yeray,
I posted this request some time ago.
In the tracker I see that at first:
Status CONFIRMED RESOLVED
but some time later:
Resolution --- WONTFIX
Does this means it won't get changed (AX2015 gives no returnvalue)? Why?
TIA,
Jack
I posted this request some time ago.
In the tracker I see that at first:
Status CONFIRMED RESOLVED
but some time later:
Resolution --- WONTFIX
Does this means it won't get changed (AX2015 gives no returnvalue)? Why?
TIA,
Jack
Re: return value loadfromfile()
Hello Jack,
First of all note TeeChart ActiveX is a wrapper from TeeChart VCL so some issues in the ActiveX version depend on the VCL version.
That's why I created both a VCL and an ActiveX ticket, B911 and B912 on 2014-09-08 with a "Blocks"/"Depends on" relation between them.
David closed B911 on 2014-09-12 setting "Status" field to "Resolved" and "Resolution" field to "Won't Fix", both fields at the same time. He also wrote a comment explaining the reason:
Of course don't hesitate to let us know if you find it's not accurate enough or if it doesn't fit your needs.
At the same time, not later.Jack007 wrote:I posted this request some time ago.
In the tracker I see that at first:
Status CONFIRMED RESOLVED
but some time later:
Resolution --- WONTFIX
First of all note TeeChart ActiveX is a wrapper from TeeChart VCL so some issues in the ActiveX version depend on the VCL version.
That's why I created both a VCL and an ActiveX ticket, B911 and B912 on 2014-09-08 with a "Blocks"/"Depends on" relation between them.
David closed B911 on 2014-09-12 setting "Status" field to "Resolved" and "Resolution" field to "Won't Fix", both fields at the same time. He also wrote a comment explaining the reason:
david wrote:Returning a Boolean will not indicate the exact cause.
Correct behaviour is to raise an exception, being the exception class and properties the info about the problem.
See for example Classes.pas TStrings LoadFromFile:
OurTTeeSeriesSourceFile.LoadFromFile, TImportChart.LoadFromFile and TeeStore.pas unit LoadChartFromFile, all use the RTL default TFileStream classes.Code: Select all
procedure TStrings.LoadFromFile(const FileName: string); var Stream: TStream; begin Stream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite); try LoadFromStream(Stream); finally Stream.Free; end; end;
A custom function can always "eat" the exception and return a boolean, if desired:
However, this is not recommended. Exceptions must surface-up to callers.Code: Select all
uses TeeStore; function Load(const AChart:TCustomChart; const AFile:String):Boolean; begin try LoadChartFromFile(AChart,AFile); result:=True; except on Exception do begin // EAT result:=False; end; end; end; procedure TForm1.FormCreate(Sender: TObject); begin if Load(Chart1,'test.tee') then Caption:='OK' else Caption:='BAD'; end;
I'm afraid yes. And the reason is the one David explained there and I copied above.Jack007 wrote:Does this means it won't get changed (AX2015 gives no returnvalue)? Why?
Of course don't hesitate to let us know if you find it's not accurate enough or if it doesn't fit your needs.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |