pascal

unpack data files before starting inno setup

本小妞迷上赌 提交于 2019-12-24 09:48:18
问题 I am working on an application which uses a very large size of data files. My client wants to zip those data files separately from the setup exe then the installer should unzip them before starting the installation. Is that possible by inno? I don't have much experience in Pascal so any help will be much appreciated. 回答1: No built in Pascal scripting support for uncompression Although Inno Setup internally has many uncompress routines to support the various ways it can compress the files

Reading String from a text file into Array in Pascal

可紊 提交于 2019-12-24 07:38:45
问题 With this program, I am trying to read a file and randomly print it to console. I am wondering If I have to use arrays for that. For example, I could assign my strings into an array, and randomly print from my array. But, I'm not sure how to approach to that. Also another problem is that, my current program does not read the first line from my file. I have a text file text.txt that contains 1. ABC 2. ABC ... 6. ABC And below is my code. type arr = record end; var x: text; s: string; SpacePos:

Does Pascal support passing parameters to functions?

北城以北 提交于 2019-12-24 05:08:05
问题 I'm new to Pascal and I am trying to write a simple program, but an having trouble passing values between functions. This is a small piece of what I have: program numberConverter; const maxValue = 4999; minValue = 1; var num: integer; function convertNumeral(number: integer):string; var j: integer; begin if ((number < minValue) OR (number > maxValue)) then begin writeln(number); writeln('The number you enter must be between 1 and 4999. Please try again:'); read(j); convertNumeral :=

二分图最大权匹配模板(pascal)

耗尽温柔 提交于 2019-12-24 02:50:34
用uoj80的题面了: 从前一个和谐的班级,有 n l nl 个是男生,有 n r nr 个是女生。编号分别为 1 , … , n l 1,…,nl 和 1 , … , n r 1,…,nr。 有若干个这样的条件:第 v v 个男生和第 u u 个女生愿意结为配偶,且结为配偶后幸福程度为 w w。 请问这个班级里幸福程度之和最大是多少? 输入格式 第一行三个正整数, n l , n r , m nl,nr,m。 接下来 m m 行,每行三个整数 v , u , w v,u,w 表示第 v v 个男生和第 u u 个女生愿意结为配偶,且幸福程度为 w w。保证 1 ≤ v ≤ n l 1≤v≤nl, 1 ≤ u ≤ n r 1≤u≤nr,保证同一对 v , u v,u 不会出现两次。 输出格式 第一行一个整数,表示幸福程度之和的最大值。 接下来一行 n l nl 个整数,描述一组最优方案。第 v v 个整数表示 v v 号男生的配偶的编号。如果 v v 号男生没配偶请输出 0 0。 样例一 input 2 2 3 1 1 100 1 2 1 2 1 1 output 100 1 0 限制与约定 1≤nl,nr≤400, 1≤m≤160000, 1 ≤ w ≤ 10 9 。 时间限制 : 1 s 1s 空间限制 : 256 MB

二分图最大匹配模板(pascal)

蹲街弑〆低调 提交于 2019-12-24 02:50:19
uoj#78. 二分图最大匹配 从前一个和谐的班级,有 n l nl 个是男生,有 n r nr 个是女生。编号分别为 1 , … , n l 1,…,nl 和 1 , … , n r 1,…,nr。 有若干个这样的条件:第 v v 个男生和第 u u 个女生愿意结为配偶。 请问这个班级里最多产生多少对配偶? 输入格式 第一行三个正整数, n l , n r , m nl,nr,m。 接下来 m m 行,每行两个整数 v , u v,u 表示第 v v 个男生和第 u u 个女生愿意结为配偶。保证 1 ≤ v ≤ n l 1≤v≤nl, 1 ≤ u ≤ n r 1≤u≤nr,保证同一个条件不会出现两次。 输出格式 第一行一个整数,表示最多产生多少对配偶。 接下来一行 n l nl 个整数,描述一组最优方案。第 v v 个整数表示 v v 号男生的配偶的编号。如果 v v 号男生没配偶请输出 0 0。 样例一 input 2 2 3 1 1 1 2 2 1 output 2 2 1 explanation 1 1 号男生跟 2 2 号女生幸福地生活在了一起~ 2 2 号男生跟 1 1 号女生幸福地生活在了一起~ 样例二 input 2 2 2 1 1 2 1 output 1 1 0 explanation 班上一个女神一个女汉子,两个男生都去追女神。一种最优方案是: 1 1

Is it possible to filter/require installation path to be ASCII in InnoSetup?

霸气de小男生 提交于 2019-12-24 02:07:34
问题 So I wonder if it is possible to allow user to enter only ASCII as installation path? (warn him and make input path again) (problem is application we install is old and can not work with Cyrillic paths so we need to restrict user on installation stage) 回答1: To restrict the user input for the application directory for the Basic Latin character set you may use the following code. The code only checks if any char of the selected directory name doesn't exceed the Basic Latin character set range.

Delphi load XML

随声附和 提交于 2019-12-24 00:26:36
问题 I've been googling for a while,but i could'nt find the right example. I have local XML with with Node And I have a form in my project: Edit1 | Submit I want the when user hits Submit childNode to be created in my XML file for categories. Like: <categories> <cat1>Name of Cat(Edit1.Text)</cat1> </categories> EDIT: I have Project1.XML file in my .exe directory (/Win32/Debug/Project1.XML): <Kategorijos> </Kategorijos> In my Form there is an input field (Edit1) and a button (Button1) On button

delphi指针

元气小坏坏 提交于 2019-12-23 22:24:25
delphi中由于vcl的存在,于是指针很少用到。昨天和“贱男”(一个做sp的朋友)在讨论一个多线程的问题,最后考虑是不是指针传递的错误。 要求是这样的:sql的数据库,程序中的主线程以sql查询获取二十条记录,然后传递给子线程,主线程挂起。while ....not语句,一条条赋给子线程,每子线程存一条记录,以指针传递的(pchar).应用华为的api(vc编写)其中LPCSTR用delphi 中pchar代替,但是最后子线程得到的数据是乱七八遭的东西。不从数据库读取数据,读字符串和变量都是正确的,实在不解?是不是指针传递数据时候出错? 顺便放出pascal的指针: 浅谈Object Pascal的指针 大家都认为,C语言之所以强大,以及其自由性,很大部分体现在其灵活的指针运用上。因此,说指针是C语言的灵魂,一点都不为过。同时,这种说法也让很多人 产生误解,似乎只有C语言的指针才能算指针。Basic不支持指针,在此不论。其实,Pascal语言本身也是支持指针的。从最初的Pascal发展至今 的Object Pascal,可以说在指针运用上,丝毫不会逊色于C语言的指针。 以下内容分为八个部分,分别是 一、类型指针的定义 二、无类型指针的定义 三、指针的解除引用 四、取地址(指针赋值) 五、指针运算 六、动态内存分配 七、字符数组的运算 八、函数指针 一、类型指针的定义

Failure when trying to compile pascal programs via Notepad++?

时光总嘲笑我的痴心妄想 提交于 2019-12-23 16:34:40
问题 I'm trying to complile pascal files with Notepad++ on Free Pascal Compiler. I've been instructed to use the following script: NPP_SAVE cd $(CURRENT_DIRECTORY) C:\FPC\2.6.4\bin\i386-win32\ppcrossx64.exe $(NAME_PART).pas But when I try to run the program, Notepad++ console gives me the following message: NPP_SAVE: C:\FPC\2.6.4\bin\i386-win32\new 1.pas CD: C:\FPC\2.6.4\bin\i386-win32 Current directory: C:\FPC\2.6.4\bin\i386-win32 C:\FPC\2.6.4\bin\i386-win32\ppcrossx64.exe new 1.pas Process

How to catch OleObject exception in Inno Setup?

时间秒杀一切 提交于 2019-12-23 12:54:31
问题 So I try to make a post request having no internet connection using next modified code: WinHttpReq := CreateOleObject('WinHttp.WinHttpRequest.5.1'); WinHttpReq.Open('POST', '<your_web_server>', false); WinHttpReq.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); try WinHttpReq.Send('data'); except bla:= 'e'; finally bla := 'f'; end; Yet exception does not get catched and I get crush of my setup application with next image: How to handle OleObject exception in Inno Setup?