Recent

Author Topic: How to format a format?  (Read 723 times)

Nicole

  • Hero Member
  • *****
  • Posts: 734
How to format a format?
« on: January 21, 2023, 09:36:51 pm »
There is a format which reads

Code: Pascal  [Select][+][-]
  1.  AHint := Format('mySeriesName "%s": x = %.2f, y = %.2f', [
  2.       ser.Title,
  3.       ser.XValue[ATool.Index],
  4.       ser.YValue[ATool.Index]
  5.     ]);  

What I want:
Display the x-axes as date by "DateTioStr(x--axes-value)"

How to put it?

wp

  • Hero Member
  • *****
  • Posts: 10633
Re: How to format a format?
« Reply #1 on: January 21, 2023, 10:00:00 pm »
Code: Pascal  [Select][+][-]
  1.  AHint := Format('mySeriesName "%s": x = %s, y = %.2f', [
  2.       ser.Title,
  3.       DateToStr(ser.XValue[ATool.Index]),
  4.       ser.YValue[ATool.Index]
  5.     ]);

[EDIT]
Replace ATool.Index by ATool.PointIndex: ATool.Index is the index of the tool in the ChartToolset collection, but you need here the index of the data point
« Last Edit: January 24, 2023, 11:08:49 pm by wp »

Nicole

  • Hero Member
  • *****
  • Posts: 734
Re: How to format a format?
« Reply #2 on: January 24, 2023, 07:01:52 pm »
Thank you for the answer, but -
this drops an exception.

KodeZwerg

  • Hero Member
  • *****
  • Posts: 1177
  • Fifty shades of code.
    • Delphi & FreePascal
Re: How to format a format?
« Reply #3 on: January 24, 2023, 07:25:20 pm »
Thank you for the answer, but -
this drops an exception.
How about you show what "ser.XValue" is and how you build it. My glass sphere tells me that there might be a problem...
« Last Edit: Tomorrow at 31:76:97 by KodeZwerg »

Thaddy

  • Hero Member
  • *****
  • Posts: 12899
Re: How to format a format?
« Reply #4 on: January 24, 2023, 09:14:13 pm »
WHAT exception?  >:D >:D

That would be very useful....
Who is responsable for that!! The caller or the callee.. Out! ya'll, NOW. In UTC time, please, so maybe Yesterday or tomorrow.

Nicole

  • Hero Member
  • *****
  • Posts: 734
Re: How to format a format?
« Reply #5 on: January 25, 2023, 07:46:32 pm »
.... is this glass sphere for sale?
It seems very helpful.

Yes, this seems the "real" trouble value.
In the meanwhile I dig why and I dig and I dig, and I digged to the roots and this was not deep enough.
Something with the database-values behind. Very strange what I saw and no idea why   :'(


Thaddy

  • Hero Member
  • *****
  • Posts: 12899
Re: How to format a format?
« Reply #6 on: January 25, 2023, 07:55:25 pm »
Thank you for the answer, but -
this drops an exception.
THAT exception! WHAT exception? The compiler tells you so.
Give us what the compiler tells you or what happens at runtime.
Who is responsable for that!! The caller or the callee.. Out! ya'll, NOW. In UTC time, please, so maybe Yesterday or tomorrow.

wp

  • Hero Member
  • *****
  • Posts: 10633
Re: How to format a format?
« Reply #7 on: January 25, 2023, 08:03:31 pm »
Put a breakpoint on the first line of the instruction that I gave above. Run the program. When the program stops at the breakpoint, move the mouse over the identifier "ser". Is it nil? If it is add a check "if ser = nil then exit" at the top of the procedure which contains this code. The same with "ATool".

KodeZwerg

  • Hero Member
  • *****
  • Posts: 1177
  • Fifty shades of code.
    • Delphi & FreePascal
Re: How to format a format?
« Reply #8 on: January 25, 2023, 08:06:46 pm »
Thank you for the answer, but -
this drops an exception.
THAT exception! WHAT exception? The compiler tells you so.
Give us what the compiler tells you or what happens at runtime.
There is a lot of information missing.
Very strange what I saw and no idea why   :'(
I also tried to look extra deep in my glass sphere, it is so strange that I absolute see nothing than fog, so what did you saw?? Why I can't see it?? My guess is, because you not tell  ::)
« Last Edit: Tomorrow at 31:76:97 by KodeZwerg »

Nicole

  • Hero Member
  • *****
  • Posts: 734
Re: How to format a format?
« Reply #9 on: January 25, 2023, 09:51:41 pm »
There is so much fog, that I have no idea, how to put the question.
I only can say by sure, what Microsoft that often says, "There has occurred an error."  >:D 
The exception I read, will not help. It seems only due to a problem behind.

Thank you for all replies!
I keep you informed if I find out at least even enough for a sense-making exception.


Thaddy

  • Hero Member
  • *****
  • Posts: 12899
Re: How to format a format?
« Reply #10 on: January 25, 2023, 09:54:23 pm »
Nicole, this becomes irritating:
An exception has a message. WHICH MESSAGE?
Shouting intended.

Then we can help you. Not only KodeZwerg and me.... <sigh>

You are leaving out the most vital information and do not even give us an example that should compile, but would not.

That is plain silly if you want real help.
« Last Edit: January 25, 2023, 09:59:09 pm by Thaddy »
Who is responsable for that!! The caller or the callee.. Out! ya'll, NOW. In UTC time, please, so maybe Yesterday or tomorrow.

 

TinyPortal © 2005-2018