Search Results

Search found 612 results on 25 pages for 'pascal av'.

Page 1/25 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Android : développer en Pascal est désormais possible grâce au compilateur open-source Free Pascal

    Android : Développer en Pascal Est désormais possible grâce au compilateur open-source Free Pascal Depuis la version 2.3 d'Android, il est possible de produire du code Android natif sans avoir à écrire une seule ligne de code en Java. Avec le compilateur Free Pascal, un outil open-source et gratuit, il est donc désormais possible de développer pour l'OS mobile de Google en Pascal. Free Pascal est disponible avec une documentation très complète expliquant pas à pas comment l'utiliser. Tél...

    Read the article

  • Is Oberon really "a better Pascal"?

    - by Maksee
    Reading Niklaus Wirth, one can notice that despite some popularity of Pascal, he is not glad that Oberon (as a "polished" successor of Pascal and Modula) didn't get much popularity. I never did anything in Oberon, but reading the page Oberon For Pascal Developers I really did not like many of the changes as a Delphi/pascal developer, for example forcing the reserved words to be always uppercase making the language case-sensitive getting rid of enumeration types What do you think about Oberon, is it really "a better Pascal" from your point of view?

    Read the article

  • Why has C prevailed over Pascal?

    - by Konrad Morawski
    My understanding is that in the 1980s and perhaps in the 1990s, too - Pascal and C were pretty much head-to-head as production languages. Is the ultimate demise of Pascal only due to Borland's neglection of Delphi? Or was there more of such bad luck; or perhaps something inherently wrong with Pascal (any hopes for its revival?). I hope it's not an open, unanswerable question. I'm interested in historical facts and observations one can back up, rather than likes and dislikes. I also failed to find a duplicate question, which actually surprised me somewhat.

    Read the article

  • Trace code pascal [on hold]

    - by mghaffari
    I haven't worked with Pascal so far, and my problem is understanding the recursive aspects that prm assignment operators and how the final (correct) value is derived. Would someone please explain that line for me. Program test(output); FUNCTION prm(az:integer) : real; begin if az = 1 then prm := sqrt(12) else prm := sqrt(12*prm(az-1)); end; begin writeln(prm(30):0:2); end.

    Read the article

  • Understanding this Pascal-FC threaded code

    - by dmindreader
    **Program Parcial2; type buffer = channel of integer; var buffers : array [1..2] of buffer; val:integer; process sleeper (id:integer); var i : integer; begin for i:=1 to 10 do begin sleep (random(10*id)); **buffers (id):any;** end; end; process troll; begin **buffers[1]: random(10);** end;** What are buffers(id):any and buffers[1]:random(10) doing?

    Read the article

  • E: Sub-process /usr/bin/dpkg returned an error code (1)

    - by Joel
    I cant install or uppdate anything on my system 12.04 I get the error... installArchives() failed: dpkg: error processing libqt4-xmlpatterns (--configure): libqt4-xmlpatterns:amd64 4:4.8.1-0ubuntu4.2 cannot be configured because libqt4-xmlpatterns:i386 is in a different version (4:4.8.1-0ubuntu4.3) dpkg: error processing libqt4-xmlpatterns:i386 (--configure): libqt4-xmlpatterns:i386 4:4.8.1-0ubuntu4.3 cannot be configured because libqt4-xmlpatterns:amd64 is in a different version (4:4.8.1-0ubuntu4.2) dpkg: dependency problems prevent configuration of libqt4-declarative:i386: libqt4-declarative:i386 depends on libqt4-xmlpatterns (= 4:4.8.1-0ubuntu4.3); however: Package libqt4-xmlpatterns:i386 is not configured yet. dpkg: error processing libqt4-declarative:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-declarative: libqt4-declarative depends on libqt4-xmlpatterns (= 4:4.8.1-0ubuntu4.3); however: Version of libqt4-xmlpatterns on system is 4:4.8.1-0ubuntu4.2. dpkg: error processing libqt4-declarative (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqtgui4:i386: libqtgui4:i386 depends on libqt4-declarative (= 4:4.8.1-0ubuntu4.3); however: Package libqt4-declarative:i386 is not configured yet. dpkg: error processing libqtgui4:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqtgui4: No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already libqtgui4 depends on libqt4-declarative (= 4:4.8.1-0ubuntu4.3); however: Package libqt4-declarative is not configured yet. dpkg: error processing libqtgui4 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-designer: libqt4-designer depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4 is not configured yet. dpkg: error processing libqt4-designer (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-designer:i386: libqt4-designer:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-designer:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-opengl: libqt4-opengl depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4 is not configured yet. dpkg: error processing libqt4-opengl (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-opengl:i386: libqt4-opengl:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-opengl:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-qt3support: libqt4-qt3support depends on libqt4-designer (= 4:4.8.1-0ubuntu4.3); however: Package libqt4-designer is not configured yet. libqt4-qt3support depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4 is not configured yet. dpkg: error processing libqt4-qt3support (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-qt3support:i386: libqt4-qt3support:i386 depends on libqt4-designer (= 4:4.8.1-0ubuntu4.3); however: Package libqt4-designer:i386 is not configured yet. libqt4-qt3support:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-qt3support:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-scripttools:i386: libqt4-scripttools:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-scripttools:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-svg: libqt4-svg depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4 is not configured yet. dpkg: error processing libqt4-svg (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-svg:i386: libqt4-svg:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-svg:i386 (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: libqt4-xmlpatterns libqt4-xmlpatterns:i386 libqt4-declarative:i386 libqt4-declarative libqtgui4:i386 libqtgui4 libqt4-designer libqt4-designer:i386 libqt4-opengl libqt4-opengl:i386 libqt4-qt3support libqt4-qt3support:i386 libqt4-scripttools:i386 libqt4-svg libqt4-svg:i386 Error in function: dpkg: dependency problems prevent configuration of libqt4-declarative: libqt4-declarative depends on libqt4-xmlpatterns (= 4:4.8.1-0ubuntu4.3); however: Version of libqt4-xmlpatterns on system is 4:4.8.1-0ubuntu4.2. dpkg: error processing libqt4-declarative (--configure): dependency problems - leaving unconfigured dpkg: error processing libqt4-xmlpatterns (--configure): libqt4-xmlpatterns:amd64 4:4.8.1-0ubuntu4.2 cannot be configured because libqt4-xmlpatterns:i386 is in a different version (4:4.8.1-0ubuntu4.3) dpkg: error processing libqt4-xmlpatterns:i386 (--configure): libqt4-xmlpatterns:i386 4:4.8.1-0ubuntu4.3 cannot be configured because libqt4-xmlpatterns:amd64 is in a different version (4:4.8.1-0ubuntu4.2) dpkg: dependency problems prevent configuration of libqtgui4: libqtgui4 depends on libqt4-declarative (= 4:4.8.1-0ubuntu4.3); however: Package libqt4-declarative is not configured yet. dpkg: error processing libqtgui4 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-declarative:i386: libqt4-declarative:i386 depends on libqt4-xmlpatterns (= 4:4.8.1-0ubuntu4.3); however: Package libqt4-xmlpatterns:i386 is not configured yet. dpkg: error processing libqt4-declarative:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-svg: libqt4-svg depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4 is not configured yet. dpkg: error processing libqt4-svg (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-opengl: libqt4-opengl depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4 is not configured yet. dpkg: error processing libqt4-opengl (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-designer: libqt4-designer depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4 is not configured yet. dpkg: error processing libqt4-designer (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-qt3support: libqt4-qt3support depends on libqt4-designer (= 4:4.8.1-0ubuntu4.3); however: Package libqt4-designer is not configured yet. libqt4-qt3support depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4 is not configured yet. dpkg: error processing libqt4-qt3support (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqtgui4:i386: libqtgui4:i386 depends on libqt4-declarative (= 4:4.8.1-0ubuntu4.3); however: Package libqt4-declarative:i386 is not configured yet. dpkg: error processing libqtgui4:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-svg:i386: libqt4-svg:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-svg:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-opengl:i386: libqt4-opengl:i386 depends on libqtgui4 (= 4:4.8.1-0ubuntu4.3); however: Package libqtgui4:i386 is not configured yet. dpkg: error processing libqt4-opengl:i386 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of libqt4-designer:i386: joel@Joel-PC:~$ sudo apt-get install -f [sudo] password for joel: Läser paketlistor... Färdig Bygger beroendeträd Läser tillståndsinformation... Färdig Korrigerar beroenden.... Färdig Följande paket har installerats automatiskt och är inte längre nödvändiga: kde-l10n-sv language-pack-kde-sv-base language-pack-kde-zh-hans-base calligra-l10n-engb calligra-l10n-sv calligra-l10n-zhcn language-pack-kde-en kde-l10n-engb language-pack-kde-sv language-pack-zh-hans-base kde-l10n-zhcn language-pack-zh-hans language-pack-kde-zh-hans language-pack-kde-en-base Använd "apt-get autoremove" för att ta bort dem. Följande ytterligare paket kommer att installeras: libqt4-xmlpatterns Följande paket kommer att uppgraderas: libqt4-xmlpatterns 1 att uppgradera, 0 att nyinstallera, 0 att ta bort och 22 att inte uppgradera. 15 är inte helt installerade eller borttagna. Behöver hämta 0 B/1 033 kB arkiv. Efter denna åtgärd kommer ytterligare 0 B utrymme användas på disken. Vill du fortsätta [J/n]? J dpkg: fel vid hantering av libqt4-xmlpatterns (--configure): libqt4-xmlpatterns:amd64 4:4.8.1-0ubuntu4.2 cannot be configured because libqt4-xmlpatterns:i386 is in a different version (4:4.8.1-0ubuntu4.3) dpkg: fel vid hantering av libqt4-xmlpatterns:i386 (--configure): libqt4-xmlpatterns:i386 4:4.8.1-0ubuntu4.3 cannot be configured because libqt4-xmlpatterns:amd64 is in a different version (4:4.8.1-0ubuntu4.2) dpkg: beroendeproblem förhindrar konfigurering av libqt4-declarative:i386: libqt4-declarative:i386 är beroende av libqt4-xmlpatterns (= 4:4.8.1-0ubuntu4.3), men: Paketet libqt4-xmlpatterns:i386 har inte konfigurerats ännu. dpkg: fel vid hantering av libqt4-declarative:i386 (--configure): beroendeproblem - lämnar okonfigurerad dpkg: beroendeproblem förhindrar konfigurering av libqt4-declarative: libqt4-declarative är beroende av libqt4-xmlpatterns (= 4:4.8.1-0ubuntu4.3), men: Versionen av libqt4-xmlpatterns på systemet är 4:4.8.1-0ubuntu4.2. dpkg: fel vid hantering av libqt4-declarative (--configure): beroendeproblem - lämnar okonfigurerad dpkg: beroendeproblem förhindrar konfigurering av libqtgui4:i386: libqtgui4:i386 är beroende av libqt4-declarative (= 4:4.8.1-0ubuntu4.3), men: Paketet libqt4-declarative:i386 har inte konfigurerats ännu. dpkg: fel vid hantering av libqtgui4:i386 (--configure): beroendeproblem - lämnar okonfigurerad dpkg: beroendeproblem förhindrar koIngen apport-rapport skrevs därför att felmeddelandet indikerar att det är ett efterföljande fel från ett tidigare problem. Ingen apport-rapport skrevs därför att felmeddelandet indikerar att det är ett efterföljande fel från ett tidigare problem. Ingen apport-rapport skrevs därför att felmeddelandet indikerar att det är ett efterföljande fel från ett tidigare problem. Ingen apport-rapport skrevs därför att felmeddelandet indikerar att det är ett efterföljande fel från ett tidigare problem. Ingen apport-rapport skrevs därför att felmeddelandet indikerar att det är ett efterföljande fel från ett tidigare problem. Ingen apport-rapport skrevs därför att felmeddelandet indikerar att det är ett efterföljande fel från ett tidigare problem. nfigurering av libqtgui4: libqtgui4 är beroende av libqt4-declarative (= 4:4.8.1-0ubuntu4.3), men: Paketet libqt4-declarative har inte konfigurerats ännu. dpkg: fel vid hantering av libqtgui4 (--configure): beroendeproblem - lämnar okonfigurerad dpkg: beroendeproblem förhindrar konfigurering av libqt4-designer: libqt4-designer är beroende av libqtgui4 (= 4:4.8.1-0ubuntu4.3), men: Paketet libqtgui4 har inte konfigurerats ännu. dpkg: fel vid hantering av libqt4-designer (--configure): beroendeproblem - lämnar okonfigurerad dpkg: beroendeproblem förhindrar konfigurering av libqt4-designer:i386: libqt4-designer:i386 är beroende av libqtgui4 (= 4:4.8.1-0ubuntu4.3), men: Paketet libqtgui4:i386 har inte konfigurerats ännu. dpkg: fel vid hantering av libqt4-designer:i386 (--configure): beroendeproblem - lämnar okonfigurerad dpkg: beroendeproblem förhindrar konfigurering av libqt4-opengl: libqt4-opengl är beroende av libqtgui4 (= 4:4.8.1-0ubuntu4.3), men: Paketet libqtgui4 har inte konfigurerats ännu. dpkg: fel vid hantering av libqt4-opengl (--configure): beroendeproblem - lämnar okonfigurerad dpkg: beroendeproblem förhindrar konfigurering av libqt4-opengl:i386: libqt4-opengl:i386 är beroende av libqtgui4 (= 4:4.8.1-0ubuntu4.3), men: Paketet libqtgui4:i386 har inte konfigurerats ännu. dpkg: fel vid hantering av libqt4-opengl:i386 (--configure): beroendeproblem - lämnar okonfigurerad dpkg: beroendeproblem förhindrar konfigurering av libqt4-qt3support: libqt4-qt3support är beroende av libqt4-designer (= 4:4.8.1-0ubuntu4.3), men: Paketet libqt4-designer har inte konfigurerats ännu. libqt4-qt3support är beroende av libqtgui4 (= 4:4.8.1-0ubuntu4.3), men: Paketet libqtgui4 har inte konfigurerats ännu. dpkg: fel vid hantering av libqt4-qt3support (--configure): beroendeproblem - lämnar okonfigurerad dpkg: beroendeproblem förhindrar konfigurering av libqt4-qt3support:i386: libqt4-qt3support:i386 är beroende av libqt4-designer (= 4:4.8.1-0ubuntu4.3), men: Paketet libqt4-designer:i386 har inte konfigurerats ännu. libqt4-qt3support:i386 är beroende av libqtgui4 (= 4:4.8.1-0ubuntu4.3), men: Paketet libqtgui4:i386 har inte konfigurerats ännu. dpkg: fel vid hantering av libqt4-qt3support:i386 (--configure): beroendeproblem - lämnar okonfigurerad dpkg: beroendeproblem förhindrar konfigurering av libqt4-scripttools:i386: libqt4-scripttools:i386 är beroende av libqtgui4 (= 4:4.8.1-0ubuntu4.3), men: Paketet libqtgui4:i386 har inte konfigurerats ännu. dpkg: fel vid hantering av libqt4-scripttools:i386 (--configure): beroendeproblem - lämnar okonfigurerad dpkg: beroendeproblem förhindrar konfigurering av libqt4-svg: libqt4-svg är beroende av libqtgui4 (= 4:4.8.1-0ubuntu4.3), men: Paketet libqtgui4 har inte konfigurerats ännu. dpkg: fel vid hantering av libqt4-svg (--configure): beroendeproblem - lämnar okonfigurerad dpkg: beroendeproblem förhindrar konfigurering av libqt4-svg:i386: libqt4-svg:i386 är beroende av libqtgui4 (= 4:4.8.1-0ubuntu4.3), men: Paketet libqtgui4:i386 har inte konfigurerats ännu. dpkg: fel vid hantering av libqt4-svg:i386 (--configure): beroendeproblem - lämnar okonfigurerad Fel uppstod vid hantering: libqt4-xmlpatterns libqt4-xmlpatterns:i386 libqt4-declarative:i386 libqt4-declarative libqtgui4:i386 libqtgui4 libqt4-designer libqt4-designer:i386 libqt4-opengl libqt4-opengl:i386 libqt4-qt3support libqt4-qt3support:i386 libqt4-scripttools:i386 libqt4-svg libqt4-svg:i386 E: Sub-process /usr/bin/dpkg returned an error code (1)

    Read the article

  • embedding pascal

    - by Sam P
    Is anyone aware of a Pascal interpreter/compiler which is embeddable in C++ (or anything else other than Pascal) applications? I am cloning (for lack of a better word) an application which uses an Object-Pascal compatible scripting language and needs to be script compatible. Am I going to end up writing an interpreter? (!)

    Read the article

  • Execute Assembly from Pascal

    - by London
    How can I execute this code from Pascal : MOV EAX, variable1 PUSH EBX, EAX MOV EAX, variable2 POP EBX AND EBX, EAX Where I define method/function arguments in function(variable1, variable2). This is a school assignment I don't know why they are making us do Pascal/Assembly instead of Java/C++ or such. This is not the whole assignment I did do plenty of work before I just need help with this, any help is appreciated thank you

    Read the article

  • Problem solving-pascal

    - by lancelot-clair
    Salutations, Need some help writing this; a pseudocode that accepts as input the name and sections(160, 220, 280, 350, 425) of a masquerader, continue to run until a blank name is input. After that, pseudocode should process the amount the masquerader pay.Then pseudocode code output masqueraders name and amount to pay. Then use programming language Pascal to write this. Thanks, appreciate your response.

    Read the article

  • Validating String Characters as Numeric w/ Pascal (FastReport 4)

    - by user2525015
    I'm new to Pascal and FastReport. This question can probably be answered without knowledge of FastReport. Pascal is Delphi. FastReport4. I have a text box accepting an 8 character string as input. Each character should be numeric. I'm attempting to validate each character as numeric. I've tried using the val function... Procedure Val(S : String; var R: Real; Code : Integer); begin end; procedure thisinputOnChange(Sender: TfrxComponent); var S : String; error : Integer; R : Real; begin S := thisinput.lines.text; Val (S, R, error); If error > 0 then Button2.enabled := False; end; I got this code online. The explanation says that the function will return an error with a code greater than zero if the character cannot be converted to an integer. Is that explanation correct? Am I misinterpreting? Right now I am trying to set a button's enabled property to false if the validation fails. I might change that to a message. For now, I would like to get it to work by setting the button property. I'm not sure if I should be using the onChange event or another event. I'm also not sure if I need to send the input to the val function in a loop. Like I said, I'm just learning how to use this function. I am able to validate the length. This code works... procedure thisinputOnChange(Sender: TfrxComponent); begin if length(thisinput.lines.text) = 8 then Button2.enabled := True; end; Any suggestions? Should I use the val function or something else? Let me know if I need to provide more info. I might not be able to check back until later, though. Thanks for any help.

    Read the article

  • Delphi/Pascal training in high school/college/university

    - by Bruce McGee
    Are Delphi/Pascal being taught in any high schools/colleges/universities, particularly in Canada and the US? I was surprised how many schools in the UK are teaching Delphi. Their largest exam board is even dropping PHP/C#/C in 2011 and encouraging Delphi. I also remember that CodeGear was going to provide development tool licenses to Russian schools a couple of years ago. I'd like to know if it's being taught closer to (my) home.

    Read the article

  • Using windows command line from Pascal

    - by Jordan
    I'm trying to use some windows command line tools from within a short Pascal program. To make it easier, I'm writing a function called DoShell which takes a command line string as an argument and returns a record type called ShellResult, with one field for the process's exitcode and one field for the process's output text. I'm having major problems with some standard library functions not working as expected. The DOS Exec() function is not actually carrying out the command i pass to it. The Reset() procedure gives me a runtime error RunError(2) unless i set the compiler mode {I-}. In that case i get no runtime error, but the Readln() functions that i use on that file afterwards don't actually read anything, and furthermore the Writeln() functions used after that point in the code execution do nothing as well. Here's the source code of my program so far. I'm using Lazarus 0.9.28.2 beta, with Free Pascal Compiler 2.24 program project1; {$mode objfpc}{$H+} uses Classes, SysUtils, StrUtils, Dos { you can add units after this }; {$IFDEF WINDOWS}{$R project1.rc}{$ENDIF} type ShellResult = record output : AnsiString; exitcode : Integer; end; function DoShell(command: AnsiString): ShellResult; var exitcode: Integer; output: AnsiString; exepath: AnsiString; exeargs: AnsiString; splitat: Integer; F: Text; readbuffer: AnsiString; begin //Initialize variables exitcode := 0; output := ''; exepath := ''; exeargs := ''; splitat := 0; readbuffer := ''; Result.exitcode := 0; Result.output := ''; //Split command for processing splitat := NPos(' ', command, 1); exepath := Copy(command, 1, Pred(splitat)); exeargs := Copy(command, Succ(splitat), Length(command)); //Run command and put output in temporary file Exec(FExpand(exepath), exeargs + ' __output'); exitcode := DosExitCode(); //Get output from file Assign(F, '__output'); Reset(F); Repeat Readln(F, readbuffer); output := output + readbuffer; readbuffer := ''; Until Eof(F); //Set Result Result.exitcode := exitcode; Result.output := output; end; var I : AnsiString; R : ShellResult; begin Writeln('Enter a command line to run.'); Readln(I); R := DoShell(I); Writeln('Command Exit Code:'); Writeln(R.exitcode); Writeln('Command Output:'); Writeln(R.output); end.

    Read the article

  • Why are Pascal control structures inconsistent?

    - by 70Mike
    Most Pascal control structures make sense to me, like: for ... do {statement}; if (condition) then {statement}; while (condition) do {statement}; where the {statement} is either a single statement, or a begin ... end block. I have a problem with: repeat {statement-list} until (expression); try {statement-list} except {statement-list} end; Wouldn't it be better that repeat and try have the same general structure, accepting only a single statement or a begin ... end block, instead of having a statement-list that's not formally blocked with a begin and an end?

    Read the article

  • Making pascal's triangle with mpz_t's

    - by SDLFunTimes
    Hey, I'm trying to convert a function I wrote to generate an array of longs that respresents Pascal's triangles into a function that returns an array of mpz_t's. However with the following code: mpz_t* make_triangle(int rows, int* count) { //compute triangle size using 1 + 2 + 3 + ... n = n(n + 1) / 2 *count = (rows * (rows + 1)) / 2; mpz_t* triangle = malloc((*count) * sizeof(mpz_t)); //fill in first two rows mpz_t one; mpz_init(one); mpz_set_si(one, 1); triangle[0] = one; triangle[1] = one; triangle[2] = one; int nums_to_fill = 1; int position = 3; int last_row_pos; int r, i; for(r = 3; r <= rows; r++) { //left most side triangle[position] = one; position++; //inner numbers mpz_t new_num; mpz_init(new_num); last_row_pos = ((r - 1) * (r - 2)) / 2; for(i = 0; i < nums_to_fill; i++) { mpz_add(new_num, triangle[last_row_pos + i], triangle[last_row_pos + i + 1]); triangle[position] = new_num; mpz_clear(new_num); position++; } nums_to_fill++; //right most side triangle[position] = one; position++; } return triangle; } I'm getting errors saying: incompatible types in assignment for all lines where a position in the triangle is being set (i.e.: triangle[position] = one;). Does anyone know what I might be doing wrong?

    Read the article

  • Summation loop program in Pascal

    - by user2526598
    I am having a bit of an issue with this problem. I am taking a Pascal programming class and this problem was in my logic book. I am required to have the user enter a series of (+) numbers and once he/she enters a (-) number, the program should find the sum of all the (+) numbers. I accomplished this, but now I am attempting part two of this problem, which requires me to utilize a nested loop to run the program x amount of times based on the user's input. The following code is what I have so far and honestly I am stumped: program summation; //Define main program's variables var num, sum, numRun : integer; //Design procedure that will promt user for number of runs procedure numRunLoop ( var numRun : integer ); begin writeln('How many times shall I run this program?'); readln(numRun); end; //Design procedure that will sum a series of numbers //based on user input procedure numPromptLoop( numRun : integer; var num : integer ); var count : integer; begin //Utilize for to establish run limit for count := 1 to numRun do begin //Use repeat to prompt user for numbers repeat writeln('Enter a number: '); readln(num); //Tells program when to sum if num >= 0 then sum := sum + num; until num < 0; end; end; //Design procedure that will display procedure addItion( sum : integer ); begin writeln('The sum is; ', sum); end; begin numRunLoop(numRun); numPromptloop(numRun, num); addItion(sum); readln(); end.

    Read the article

  • [inno setup] Pascal and Delphi Syntax Error?!

    - by neo-nant
    This is the code section from inno setup.My intention is to make two Checkbox where at a time one is being selected. But this code return error. [code] section: procedure CheckBoxOnClick(Sender: TObject); var Box2,CheckBox: TNewCheckBox; begin if CheckBox.Checked then CheckBox.State := cbUnchecked; Box2.State := cbChecked; else //THIS LINE RETURNS AN ERROR: "Identifier Expected." CheckBox.State := cbChecked; Box2.State := cbUnchecked; end; procedure Box2OnClick(Sender: TObject); var Box2,CheckBox: TNewCheckBox; begin if Box2.Checked then CheckBox.State := cbChecked; Box2.State := cbUnchecked; else //same error CheckBox.State := cbUnchecked; Box2.State := cbChecked; end; procedure CreateTheWizardPages; var Page: TWizardPage; Box2,CheckBox: TNewCheckBox; begin { TButton and others } Page := CreateCustomPage(wpWelcome, '', ''); CheckBox := TNewCheckBox.Create(Page); CheckBox.Top :=ScaleY(8)+ScaleX(50); CheckBox.Width := Page.SurfaceWidth; CheckBox.Height := ScaleY(17); CheckBox.Caption := 'Do this'; CheckBox.Checked := True; CheckBox.OnClick := @CheckBoxOnClick; CheckBox.Parent := Page.Surface; Box2 := TNewCheckBox.Create(Page); Box2.Top :=ScaleY(8)+ScaleX(70); Box2.Width := Page.SurfaceWidth; Box2.Height := ScaleY(17); Box2.Caption := 'No,Thanks.'; Box2.Checked := False; Box2.OnClick := @Box2OnClick; Box2.Parent := Page.Surface; end; procedure InitializeWizard(); //var begin { Custom wizard pages } CreateTheWizardPages; end; Please tell me where to change..

    Read the article

  • Delphi Pascal - Using SetFilePointerEx and GetFileSizeEx, Getting Physical Media exact size when reading as a file

    - by SuicideClutchX2
    I am having trouble understanding how to delcare GetFileSizeEx and SetFilePointerEx in Delphi 2009 so that I can use them since they are not in the RTL or Windows.pas. I was able to compile with the following: function GetFileSizeEx(hFile: THandle; lpFileSizeHigh: Pointer): DWORD; external 'kernel32'; Then using GetFileSizeEx(PD, Pointer(DriveSize)); to get the size. But could not get it to work, the disk handle I am using is valid and I have had no problem reading the data or working under the 2gb mark with the older API's. GetFileSize of course returns 4294967295. I have had greater trouble trying to use SetFilePointerEx with the data types it uses. The overall project needs to read the data from a flash card, which is not a problem at all I can do this. My problem is that I can not find the length or size of the media I will be reading. I have code I have used in the past to do this with media under 2GB. But now that I need to read media over 2GB it is a problem. If you still dont understand I am dumping a card with all data including the boot record, etc. This is the code I would normally use to read from the physical disk to grab say the boot record and dump it to file: SetFilePointer(PD,0,nil,FILE_BEGIN); SetLength(Buffer,512); ReadFile(PD,Buffer[0],512,BytesReturned,nil); I just need to figure out how to find the end of an 8gb card and so on as well as being able to set a file pointer beyond the 2gb barrier. I guess any help in the external declarations as well as understand the values that SetFilePointerEx uses (I do not understand the whole High Low thing) would be of great help. var Form1: TForm1; function GetFileSizeEx(hFile: THandle; var FileSize: Int64): DWORD; stdcall; external 'kernel32'; implementation {$R *.dfm} function GetLD(Drive: Char): Cardinal; var Buffer : String; begin Buffer := Format('\\.\%s:',[Drive]); Result := CreateFile(PChar(Buffer),GENERIC_READ Or GENERIC_WRITE,FILE_SHARE_READ,nil,OPEN_EXISTING,0,0); If Result = INVALID_HANDLE_VALUE Then begin Result := CreateFile(PChar(Buffer),GENERIC_READ,FILE_SHARE_READ,nil,OPEN_EXISTING,0,0); end; end; function GetPD(Drive: Byte): Cardinal; var Buffer : String; begin If Drive = 0 Then begin Result := INVALID_HANDLE_VALUE; Exit; end; Buffer := Format('\\.\PHYSICALDRIVE%d',[Drive]); Result := CreateFile(PChar(Buffer),GENERIC_READ Or GENERIC_WRITE,FILE_SHARE_READ,nil,OPEN_EXISTING,0,0); If Result = INVALID_HANDLE_VALUE Then begin Result := CreateFile(PChar(Buffer),GENERIC_READ,FILE_SHARE_READ,nil,OPEN_EXISTING,0,0); end; end; function GetPhysicalDiskNumber(Drive: Char): Byte; var LD : DWORD; DiskExtents : PVolumeDiskExtents; DiskExtent : TDiskExtent; BytesReturned : Cardinal; begin Result := 0; LD := GetLD(Drive); If LD = INVALID_HANDLE_VALUE Then Exit; Try DiskExtents := AllocMem(Max_Path); DeviceIOControl(LD,IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,nil,0,DiskExtents,Max_Path,BytesReturned,nil); If DiskExtents^.NumberOfDiskExtents > 0 Then begin DiskExtent := DiskExtents^.Extents[0]; Result := DiskExtent.DiskNumber; end; Finally CloseHandle(LD); end; end; procedure TForm1.Button1Click(Sender: TObject); var PD : DWORD; BytesReturned : Cardinal; Buffer : Array Of Byte; myFile: File; DriveSize: Int64; begin PD := GetPD(GetPhysicalDiskNumber(Edit1.Text[1])); If PD = INVALID_HANDLE_VALUE Then Exit; Try GetFileSizeEx(PD, DriveSize); //SetFilePointer(PD,0,nil,FILE_BEGIN); //etLength(Buffer,512); //ZeroMemory(@Buffer,SizeOf(Buffer)); //ReadFile(PD,Buffer[0],512,BytesReturned,nil); //AssignFile(myFile, 'StickDump.bin'); //ReWrite(myFile, 512); //BlockWrite(myFile, Buffer[0], 1); //CloseFile(myFile); Finally CloseHandle(PD); End; end;

    Read the article

  • tic tac toe in pascal --> a problem occurred

    - by Emese
    I don't know why my program doesn't run. I would really appreciate your help. Here's my program: USES graph,crt; type tegla=record x,y:integer; ertek:0..2; end; var gd,gm:integer; i,j:integer; c:char; jatekos:integer; a:array[1..3,1..3]of tegla; lx,ly:integer; procedure tabla; var x,y,i,j:integer; begin lx:=getmaxx div 3; ly:=getmaxy div 3; for i:=1 to 3 do begin y:=(i-1)*ly; for j:=1 to 3 do begin x:=(j-1)*lx; a[i,j].x:=x; a[i,j].y:=y; a[i,j].ertek:=0; setbkcolor(10); setcolor(9); rectangle(a[i,j].x,a[i,j].y,a[i,j].x+lx,a[i,j].y+ly); end; end; end; procedure aktival(i,j:integer); begin setcolor(red); rectangle(a[i,j].x,a[i,j].y,a[i,j].x+lx,a[i,j].y+ly); end; procedure visszaallit(i,j:integer); begin setcolor(9); rectangle(a[i,j].x,a[i,j].y,a[i,j].x+lx,a[i,j].y+ly); end; procedure rajzolx(i,j:integer); begin setcolor(5); line(a[i,j].x,a[i,j].y,a[i,j].x+lx,a[i,j].y+ly); line(a[i,j].x+lx,a[i,j].y,a[i,j].x,a[i,j].y+ly); end; procedure rajzol_0(i,j:integer); begin setcolor(13); circle(a[i,j].x+lx div 2, a[i,j].y+ly div 2, 50); end; procedure kinyer(i,j:integer); begin jatekos:=1; if a[1,1]=a[2,2] and a[3,3]=a[1,1] and a[2,2]=a[3,3] or a[3,1]=a[2,2] and a[1,3]=a[3,1] and a[1,3]=a[2,2] then if jatekos then begin cleardevice; writeln('x nyert!'); end else if jatekos+1 then begin cleardevice; writeln('O nyert!'); end else for i:=1 to 3 do begin if a[i,1]=a[i,2] and a[i,1]=a[i,3] and a[i,2]=a[i,3] or a[1,i]=a[2,i] and a[1,i]=a[3,i] and a[2,i]=a[3,i] then if jatekos then begin cleardevice; writeln('x nyert'); end else if jatekos+1 then begin cleardevice; writeln('O nyert!'); end; end; Begin initgraph(gd,gm,' '); tabla; jatekos:=1; i:=2; j:=2; aktival(i,j); repeat c:=readkey; if ord(c)=0 then begin c:=readkey; case ord(c)of 72: if i>1 then begin visszaallit(i,j); dec(i); aktival(i,j);end; 77:if j<3 then begin visszaallit(i,j); inc(j); aktival(i,j); end; 80:if i<3 then begin visszaallit(i,j); inc(i); aktival(i,j); end; 75:if j>1 then begin visszaallit(i,j); dec(j); aktival(i,j); end; end; end; if ord(c)=13 then begin if a[i,j].ertek=0 then if jatekos=1 then begin rajzolx(i,j); a[i,j].ertek:=1; jatekos:=2; end else begin rajzol_0(i,j); a[i,j].ertek:=2; jatekos:=1; end; end; until ord(c)=27; kinyer(i,j); end; end. I hope you can help me. Thank you a lot!

    Read the article

  • tic tac toe in pascal --> a problem occured

    - by Emese
    I don't know why my program doesn't run. I would really appreciate your help. here's my program: USES graph,crt; type tegla=record x,y:integer; ertek:0..2; end; var gd,gm:integer; i,j:integer; c:char; jatekos:integer; a:array[1..3,1..3]of tegla; lx,ly:integer; procedure tabla; var x,y,i,j:integer; begin lx:=getmaxx div 3; ly:=getmaxy div 3; for i:=1 to 3 do begin y:=(i-1)*ly; for j:=1 to 3 do begin x:=(j-1)*lx; a[i,j].x:=x; a[i,j].y:=y; a[i,j].ertek:=0; setbkcolor(10); setcolor(9); rectangle(a[i,j].x,a[i,j].y,a[i,j].x+lx,a[i,j].y+ly); end; end; end; procedure aktival(i,j:integer); begin setcolor(red); rectangle(a[i,j].x,a[i,j].y,a[i,j].x+lx,a[i,j].y+ly); end; procedure visszaallit(i,j:integer); begin setcolor(9); rectangle(a[i,j].x,a[i,j].y,a[i,j].x+lx,a[i,j].y+ly); end; procedure rajzolx(i,j:integer); begin setcolor(5); line(a[i,j].x,a[i,j].y,a[i,j].x+lx,a[i,j].y+ly); line(a[i,j].x+lx,a[i,j].y,a[i,j].x,a[i,j].y+ly); end; procedure rajzol_0(i,j:integer); begin setcolor(13); circle(a[i,j].x+lx div 2, a[i,j].y+ly div 2, 50); end; procedure kinyer(i,j:integer); begin jatekos:=1; if a[1,1]=a[2,2] and a[3,3]=a[1,1] and a[2,2]=a[3,3] or a[3,1]=a[2,2] and a[1,3]=a[3,1] and a[1,3]=a[2,2] then if jatekos then begin cleardevice; writeln('x nyert!'); end else if jatekos+1 then begin cleardevice; writeln('O nyert!'); end else for i:=1 to 3 do begin if a[i,1]=a[i,2] and a[i,1]=a[i,3] and a[i,2]=a[i,3] or a[1,i]=a[2,i] and a[1,i]=a[3,i] and a[2,i]=a[3,i] then if jatekos then begin cleardevice; writeln('x nyert'); end else if jatekos+1 then begin cleardevice; writeln('O nyert!'); end; end; Begin initgraph(gd,gm,' '); tabla; jatekos:=1; i:=2; j:=2; aktival(i,j); repeat c:=readkey; if ord(c)=0 then begin c:=readkey; case ord(c)of 72: if i>1 then begin visszaallit(i,j); dec(i); aktival(i,j);end; 77:if j<3 then begin visszaallit(i,j); inc(j); aktival(i,j); end; 80:if i<3 then begin visszaallit(i,j); inc(i); aktival(i,j); end; 75:if j>1 then begin visszaallit(i,j); dec(j); aktival(i,j); end; end; end; if ord(c)=13 then begin if a[i,j].ertek=0 then if jatekos=1 then begin rajzolx(i,j); a[i,j].ertek:=1; jatekos:=2; end else begin rajzol_0(i,j); a[i,j].ertek:=2; jatekos:=1; end; end; until ord(c)=27; kinyer(i,j); end; end. I hope you can help me. Thank you a lot!

    Read the article

  • Human age program in pascal

    - by bah
    Hi, I have this task and i can't figure out how to do it. I need to find persons age in days, there are given birth and death dates, there's data file: 8 Albertas Einšteinas 1879 03 14 1955 04 18 Balys Sruoga 1896 02 02 1947 10 16 Antanas Vienuolis 1882 04 07 1957 08 17 Ernestas Rezerfordas 1871 08 30 1937 10 17 Nilsas Boras 1885 10 07 1962 11 18 Nežiniukas Pirmasis 8 05 24 8 05 25 Nežiniukas Antrasis 888 05 25 888 05 25 Nežiniukas Treciasis 1 01 01 125 01 01 and there's how result file should look like: 1879 3 14 1955 4 18 27775 1896 2 2 1947 10 16 18871 1882 4 7 1957 8 17 27507 1871 8 30 1937 10 17 24138 1885 10 7 1962 11 18 28147 8 5 24 8 5 25 1 888 5 25 888 5 25 0 1 1 1 125 1 1 45260 Few things to notice: all februarys have 28 days. My function for calculating age: function AmziusFunc(Mas : TZmogus) : longint; var i, s : integer; amzius, max : longint; begin max := 125 * 365; amzius := (Mas.mirY - Mas.gimY) * 365 + (Mas.mirM - Mas.gimM) * 31 + (Mas.mirD - Mas.gimD); if ( amzius >= max ) then amzius := 0; AmziusFunc := amzius; end; What should i change there? Thanks.

    Read the article

  • call by value-result in Pascal

    - by Luciano Lorenti
    How can i simulate calling by value-result in this example. Without adding variables and without change a variable name.? Program one; var x:integer; Function two():integer; begin x:=x+1; dos:=x; end; Procedure three(x:integer); begin x:=x+5; x:=two(); end; begin x:=8; trhee(x); write(x); end.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >