pascal

Get a files last updated time using pascal (innosetup)

谁说胖子不能爱 提交于 2019-12-02 07:19:27
In the uninstall portion of an innosetup script, I'd like to add a check to see if a specific file's last update datetime occured within the last 10 mins. Does anyone know the innosetup compatable pascal code for this? Treb You can use the Windows API function GetFileAttributesEx to get the last modification date. Putting this in your [CODE] section should work: const GetFileExInfoStandard = $0; type FILETIME = record LowDateTime: DWORD; HighDateTime: DWORD; end; WIN32_FILE_ATTRIBUTE_DATA = record FileAttributes: DWORD; CreationTime: FILETIME; LastAccessTime: FILETIME; LastWriteTime: FILETIME;

Pascal - How to pass variable number of parameters to a subprogram ? (variadic function)

折月煮酒 提交于 2019-12-02 05:40:25
问题 I recently had to face this problem, which is, how can I pass 1, 2, 3, 9, 38919, 0 or any random number of arguments to a function or a procedure in Pascal ? I want to make a subprogram that accepts as many parameters as I want to pass it, like writeln. writeln('Hello, ', name, '.'); writeln('You were born on ', birthDate, ', and you are ', age, ' years old.'); I searched the web for some guide or whatever, but the only related threads I found were these ones, which helped me understanding my

Any cool function to replace readln from pascal in ansi c?

99封情书 提交于 2019-12-02 04:20:52
The readln reads until the end of line (enter pressed) with spaces and everything, I would like something like that but for ansi c (not c++ and need to be for linux and windows) I know that I can make a function that reads every char until the enter pressed but If there is anything cooler it would be great =D Thanks! You can use scanf with a scanset conversion something like this: char buffer[256]; scanf("%255[^\n]", buffer); another possibility is to use fgets : char buffer[256]; fgets(buffer, sizeof(buffer), stdin); On Linux (and other POSIX-ish systems) you should probably also have a

What are WinTypes, WinProcs and SW_NORMAL?

隐身守侯 提交于 2019-12-02 03:47:45
In the program below, whare are WinTypes , WinProcs and what is the purpose of SW_NORMAL ? program ex; uses Wincrt,WinTypes, WinProcs; var ch:string; procedure exe (che:string); begin writeln('ecrire ch'); readln(che); if ch ='oui' then begin WinExec('cmd /k "C:\TPW\exercice\project\site.html"', SW_NORMAL); end; end; begin exe(ch); end. The code is in Turbo Pascal 1.5. Wintypes and winprocs are translated Windows 3.x headers that come with windows versions of Turbo Pascal and Delphi 1. In later Delphi versions these are aliased to the more "modern" (as in after 1995) win32 Windows unit. SW

How to show/use the user selected app path {app} in InputDirPage in Inno Setup?

纵然是瞬间 提交于 2019-12-02 01:21:31
I'm creating an Installer using Inno Setup. I have to take two paths from user. One for program executables and another for libs. The default app folder is {pf}/companyname/applicationname In the InitializeWizard I have created second page which takes the lib folder from the user. Is there any way to change the default lib folder to the user selected folder {app} ? I have tried WizardDirValue . It just gives the default {app} value and NOT the path which user selected in first page. [code] procedure InitializeWizard(); begin page2:= CreateInputDirPage(wpProgress, 'Select Library Location',

What is the implementation of sets used in pascal?

我与影子孤独终老i 提交于 2019-12-01 23:29:38
问题 I want to know the actual implementation of the set type in pascal, provided by the language. Specially, I would like to know the one used in the freepascal runtime library, but I'm interested in any pascal implementation. I care about the run-time complexity of it. The best implementations of Disjoint-set data structure are in O(log*n), and I wish to know if pascal implementation has this one. The doc for the fpc rtl is found here: ftp://ftp.freepascal.org/pub/fpc/docs-pdf/rtl.pdf , but it's

What is the implementation of sets used in pascal?

别说谁变了你拦得住时间么 提交于 2019-12-01 21:38:32
I want to know the actual implementation of the set type in pascal, provided by the language. Specially, I would like to know the one used in the freepascal runtime library, but I'm interested in any pascal implementation. I care about the run-time complexity of it. The best implementations of Disjoint-set data structure are in O(log*n) , and I wish to know if pascal implementation has this one. The doc for the fpc rtl is found here: ftp://ftp.freepascal.org/pub/fpc/docs-pdf/rtl.pdf , but it's too large (>1700 pages) for looking for this without knowing if it's even there. The freepascal wiki

How to use a Pascal variable in Inno Setup?

為{幸葍}努か 提交于 2019-12-01 21:13:47
问题 [Files] Source: "C:\MyProg.exe"; DestDir: "{app}"; BeforeInstall: GetHome(); Flags: ignoreversion [INI] Filename: "{myVarFromPascal}\.MyProg\settings.ini"; Section: "Settings"; Key: "sound"; String: "1"; Flags: createkeyifdoesntexist [Code] procedure GetHome(); var myPascalVar: String; begin RegQueryStringValue(HKEY_CURRENT_USER, 'Volatile Environment','USERPROFILE', myPascalVar); MsgBox('Value is "' + myPascalVar + '"', mbInformation, MB_OK); end; These are my three example sections in INNO

Try and Catch In Pascal

陌路散爱 提交于 2019-12-01 20:11:35
I'm using Dev-Pas 1.9.2 and am trying to make sure the program doesn't crash when a symbol or a letter value is entered. I've googled and googled and can't find any resoruce on how to achieve this. Any help is greatly appreciated. Thanks! Here is the code I'm trying to manage the input: Function GetMenuChoice : Integer; Var OptionChosen : Integer; Begin Write('Please enter your choice: '); Readln(OptionChosen); If (OptionChosen < 1) Or ((OptionChosen > 4) And (OptionChosen <> 9)) Then Begin Writeln; Writeln('That was not one of the allowed options. Please try again: '); End; GetMenuChoice :=

How to use a Pascal variable in Inno Setup?

牧云@^-^@ 提交于 2019-12-01 18:30:53
[Files] Source: "C:\MyProg.exe"; DestDir: "{app}"; BeforeInstall: GetHome(); Flags: ignoreversion [INI] Filename: "{myVarFromPascal}\.MyProg\settings.ini"; Section: "Settings"; Key: "sound"; String: "1"; Flags: createkeyifdoesntexist [Code] procedure GetHome(); var myPascalVar: String; begin RegQueryStringValue(HKEY_CURRENT_USER, 'Volatile Environment','USERPROFILE', myPascalVar); MsgBox('Value is "' + myPascalVar + '"', mbInformation, MB_OK); end; These are my three example sections in INNO Setup. I want to use myPascalVar in the INI Section. How can I do it? You will need to change your