* * *

Author Topic: help me fast plz  (Read 1730 times)

Stivano

  • Newbie
  • Posts: 4
help me fast plz
« on: January 07, 2018, 10:42:40 am »
im searching for source code of hourglass work with time in pascal plz
« Last Edit: January 08, 2018, 12:17:12 am by Stivano »

howardpc

  • Hero Member
  • *****
  • Posts: 2698
Re: help me fastb plz
« Reply #1 on: January 07, 2018, 11:02:15 am »
Are you looking for some adaptation of this sort of thing?
Code: Pascal  [Select]
  1. uses
  2.   Forms, Controls, sysutils;
  3.  
  4. procedure ShowHourglassCursor(aMSPeriod: Cardinal);
  5. var
  6.   oldCursor: TCursor;
  7. begin
  8.   oldCursor:=Screen.Cursor;
  9.   Screen.Cursor:=crHourGlass;
  10.   Sleep(aMSPeriod);
  11.   Screen.Cursor:=oldCursor;
  12. end;
   

Thaddy

  • Hero Member
  • *****
  • Posts: 6377
Re: help me fastb plz
« Reply #2 on: January 07, 2018, 11:42:58 am »
Are you looking for some adaptation of this sort of thing?

Well since it is a resource do not forget to protect it in real applications:
Code: Pascal  [Select]
  1. uses
  2.   Forms, Controls, sysutils;
  3.  
  4. procedure ShowHourglassCursor(aMSPeriod: Cardinal);
  5. var
  6.   oldCursor: TCursor;
  7. begin
  8.   oldCursor:=Screen.Cursor;
  9.   try
  10.     Screen.Cursor:=crHourGlass;
  11.     Sleep(aMSPeriod);  // do some work
  12.   finally
  13.     Screen.Cursor:=oldCursor;
  14.   end;
  15. end;

The reason is that e.g. exit is called or an exception is raised and handled during code execution you will end up with a permanent hourglass if you do not protect it with try finally;
« Last Edit: January 07, 2018, 11:48:31 am by Thaddy »
I am enjoining wine, not whine....

Stivano

  • Newbie
  • Posts: 4
Re: help me fastb plz
« Reply #3 on: January 08, 2018, 12:13:20 am »
thnx guys but this not what i mean
i give exeemple in c++ and me need hhim in language pascal
work with the time
thats not the finall result because half of the pper triangle and over time the lines of the upper triangle decrease and after an hour te triangle becomes at the bootom
im sorry about my english because used google traduction
and thx guys for your times
uses
  Forms, Controls, sysutils;
 
procedure ShowHourglassCursor(aMSPeriod: Cardinal);
var
  oldCursor: TCursor;
begin
  oldCursor:=Screen.Cursor;
  try
    Screen.Cursor:=crHourGlass;
    Sleep(aMSPeriod);  // do some work
  finally
    Screen.Cursor:=oldCursor;
  end;
end;

valdir.marcos

  • Sr. Member
  • ****
  • Posts: 397
Re: help me fast plz
« Reply #4 on: January 08, 2018, 05:04:44 am »
@Stivano
Est-ce un devoir scolaire?
Quel âge avez-vous?

Stivano

  • Newbie
  • Posts: 4
Re: help me fast plz
« Reply #5 on: January 08, 2018, 07:14:51 pm »
ui marcos un petit projet
 21 ans

valdir.marcos

  • Sr. Member
  • ****
  • Posts: 397
Re: help me fast plz
« Reply #6 on: January 08, 2018, 08:15:28 pm »
Montrez votre code source en C ++ que je vais vous aider à convertir dans Lazarus (Free Pascal).
Je ne suis peut-être pas aussi rapide que nécessaire, mais je vais essayer de vous aider dans les jours qui suivent.

Stivano

  • Newbie
  • Posts: 4
Re: help me fast plz
« Reply #7 on: January 09, 2018, 11:04:41 pm »
mrc bcp marcos

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus