Jump to content

David Heffernan

Members
  • Content Count

    3709
  • Joined

  • Last visited

  • Days Won

    185

Posts posted by David Heffernan


  1. You are concentrating on the time zone, but that's not your issue at all. When you get time from somewhere, you will be able to convert to UTC because you will know the time zone associated with the time. Your problem seems to be that you want to use an authorative time source. You should do research on that rather than worrying about time zone conversion. 

    • Like 1

  2. 2 minutes ago, Ian Branch said:

    Hi Wagner,

    Thank you for your suggestion.

    My read of "TTimeZone.Local.ToUniversalTime" in the Delphi docs is that it derives the UTC from your Local.

    This is no good if the time on your local PC is incorrect.

    This isn't what I am after,  I am after the actual UTC date/time.

     

    Regards,

    Ian

     

    What source do you want to use for the time, given that you've ruled out the local computer? 


  3. Use a list view. Part of problem solving is exploring the problem space and finding the best solution, given the pros and cons of all possible options. Deciding on the solution first and then trying to force it to work is not the way to solve problems. 

    • Like 1

  4. 2 hours ago, aehimself said:

    which is picking up ALL window messages, not just the one specified

    It's not going to be sent many messages. 

     

    Can you reproduce the behaviour in a cut down program?


  5. 10 hours ago, RTollison said:

    anything about the button is not available to me. the button click (not delphi) basically says call dll that will popup on the screen and allow user to select a date from a calendar.

    so my dll is only thing i have available to change. the original dev just created the popup calendar to be in center of the main screen which was ok since multi-screens weren't widely available.

    but then i got tasked with updating it and at the time the best i could do was the center of the active window. now i was asked IF i could change it and i said i would see what i could do. And so far it is not looking good.

    The setup is pretty opaque for us here. These are the sort of details that matter. Without them it's just guesswork. 


  6. 1 hour ago, Henry Olive said:

    But below code WORKS

    Num := Ord(Str[1]) - Ord('A') + 1; 

    You should check that Length(Str)=1.

     

    1 hour ago, Henry Olive said:

    Num := Ord([Low(Str)]) - Ord('A') + 1;

    This fails of course, it doesn't compile. But it's not the code that was suggested. You should take more care when copying code.


  7. 1 hour ago, Henry Olive said:

    Thank you Vandrovnik, eivind

     

    From an Excel Sheet i get column name ( for example F ) then i need

    to convert F to an integer number ( which is 6 )  so that i can import

    some datas from excel to my dataset.

     

    Str:=Edit1.Text; // Which is D
    Num := Ord(PChar(Str)) - Ord('A')+1;
    Edit2.Text := IntToStr(Num);
    I'm getting 37266172   instead of  4

     

    Wbat if there are more than 26 columns? 

×