Program sifrarnik; Uses sysutils; Type myrecord=Record num:integer; itemname:String[20]; price:Integer; End; Var data:array[1..10] of myrecord; doc:file of myrecord; operatingnum:integer;//item number used for reading and writeing into base error1,choice1,i,j,n,a:integer; begin Repeat Begin WriteLn('1. Add items date':10); WriteLn('2. See items data':10); WriteLn('3. Close'); Write('Chose: ':10); ReadLn(choice1); Case choice1 of 1 : Begin Assign(doc,'myfile.dat'); rewrite(doc); Write('How many items data do u want to enter ':10); ReadLn(n); For i:=1 To n Do Begin WriteLn('Enter items num: ':10); ReadLn(operatingnum); with data[operatingnum] do begin num:=operatingnum; Write('Enter Items name: ':10); ReadLn(itemname); write('Enter items price: ': 10); ReadLn(prodcena); ReadLn; End; Write(doc,data[operatingnum]); End; Close(doc); readln; End; 2 : Begin Assign(doc,'myfile.doc'); …

Member Avatar
Member Avatar
+0 forum 2

Okay so I have this program that generates 10 random number (1-1000), calculates their average and the amount of larger as well as smaller numbers than the average, this is what I have and for the life of me I can't figure out wheat I don't do right: program random1; var i,sum,min_pl,max_pl:integer; pin:array[1..10] of integer; mo:array[1..10] of real; begin randomize; for i:=1 to 10 do pin[i]:=random(1000); for i:=1 to 10 do writeln(pin[i]); sum:=0; for i:=1 to 10 do begin sum:=sum+pin[i]; mo[i]:=sum/10; end; writeln(); writeln('The average is: ',mo[i]:4:2); writeln(); min_pl:=0; max_pl:=0; for i:=1 to 10 do if (mo[i]<pin[i]) then min_pl:=min_pl+1 else …

Member Avatar
Member Avatar
+0 forum 6

I have a 3 character fkLookup field sat_site in a table. I'm using TAdsTable table component. When I filter out records in my grid on a field sat_site, grid does not show any records. With ShowMessage() I check the value of field sat_site which shows blanks or boxes in the message pop-up. Following is my source code: procedure TfrmMain.tblSaturdayFilterRecord(DataSet: TDataSet; var Accept: Boolean); begin if frmSatOffDays.Edit7.Text <> '' then begin ShowMessage(tblSaturday.FieldByName('SAT_SITE').AsString); // checking value if (DataSet['sat_month']= frmSatOffDays.Edit9.Text) and (tblSaturday.FieldByName('SAT_SITE').AsString = frmSatOffDays.Edit7.Text) then begin Accept := True; end else begin Accept := False; end; end else begin if tblSaturday.FieldByName('sat_month').AsString = frmSatOffDays.Edit9.Text …

Member Avatar
Member Avatar
+0 forum 2

I have 5 date fields in a table. I want to place CheckBoxes against each date field to allow user to check the appropriate date for the employee's weekly holiday. I do not have boolean fields in the table. How can I place CheckBox against each date cell in a dbGrid? Thanks.

Member Avatar
Member Avatar
+0 forum 2

Can anyone help me out with abit of code that will detect the location of any exe file on a hard drive / cd? am trying to build a simple exe launcher thanks.

Member Avatar
Member Avatar
+0 forum 4

I'm having an issue using the ADO.Locate function (Using Delphi 7). I've got the following code: procedure TFrmMain.RzBtnProcessClick(Sender: TObject); var WB: IXLSWorkbook; WS: IXLSWorksheet; X: Integer; MillStyle: Integer; KnitNo: Integer; CustSKU: String; begin if RzBtnEditInputFile.Text = '' then Application.MessageBox('You Must Select An Input File!','Error',MB_OK) else if not FileExists(RzBtnEditInputFile.Text) then Application.MessageBox('Cannot Locate Input File! Please Select A Valid File!','Error',MB_OK) else begin FrmInfo.RzLblInfo.Caption:='Opening AS/400 Connection...'; FrmInfo.Show; FrmInfo.Refresh; ADOCnx400.Open; ADOTblPRICEP.Open; FrmInfo.RzLblInfo.Caption:='Opening Spreadsheet...'; FrmInfo.Refresh; WB:=TXLSWorkbook.Create; WB.Open(RzBtnEditInputFile.Text); WS:=WB.WorkSheets[1]; FrmInfo.RzLblInfo.Caption:='Processing...'; FrmInfo.Refresh; for X:=2 to WS.UsedRange.Rows.Count do begin if not VarIsNull(WS.Cells[X,3].Value) then begin MillStyle:=WS.Cells[X,2].Value; KnitNo:=WS.Cells[X,3].Value; SiMain.LogInteger('MillStyle',MillStyle); SiMain.LogInteger('KnitNo',KnitNo); ADOTblPRICEP.First; if ADOTblPRICEP.Locate('DHMSTY;DHKNIT',VarArrayOf([MillStyle,KnitNo]),[]) then begin CustSKU:=ADOTblPRICEP.FieldByName('DHCSTY').AsString; SiMain.LogInteger('RecNo',ADOTblPRICEP.RecNo); SiMain.LogMessage('** FOUND **'); …

Member Avatar
Member Avatar
+0 forum 5

Ok here what am trying to do, when its scrolling left, I want to get the full length of the lblmarquee caption and then when it scrolls to the end of the last letter or caption it will then auto change to right scroll and then back to left so on, so it bouncing left and right. txt := lblMarquee.Caption; if rgDirection.ItemIndex = 0 then //left lblMarquee.Caption := Copy(txt, 2, length(txt)-1) + Copy(txt,1,1) else //right lblMarquee.Caption := Copy(txt,length(txt)-1,1) + Copy(txt, 1, length(txt)-1); any one got idea ideas thanks alot

Member Avatar
Member Avatar
+0 forum 1

Am trying to read a URL address something like http://www.myaddress.com/id=563?name=mark from the Embedded Web Browser then I want to be able to get the url parameters of a link with in my delphi application, so am able to do a messagve box like: ShowMessage(id); // this would show 563 ShowMessage(name); // this would show mark anyone got any ideas? Thanks

Member Avatar
Member Avatar
+0 forum 1

Am having a awful time trying to get this to work I googled it and even asked few friends about it, but it seams it more difficult than I expected it to be. basicly what am trying to do is capture if or when a user clicks on a button within a html page as follows: <button type="button">Click Me!</button> then for my program to reacte by showing a dialog such as good old Hello World message, but it seamns to be very difficult indeed and when I googled there is help on how to make a normal TButton press a …

Member Avatar
Member Avatar
+0 forum 2

Im writing a program that keeps track of a bussiness/banks loans and also shows results of the payments recieved and payments not recieved. basicly it's just a program for loans. i need a name and logo for it, any ideas?

Member Avatar
Member Avatar
+0 forum 5

I have a small issue with following code am inserting a new room into mysql using query and then I want it to auto join the room once its made but the problem is when room is in process of being made it will call the GoTo procedure and it will fail is there any way to slow this down safely with out using sleep or is thee away to execute procedure once query has finished. procedure TListingServer.BuildRoom(const RoomName, LobbyName, RoomComment, RoomURL, RoomPassword, MinPlayers, MaxPlayers: string; rSocket: TWSocketClient); var ReplacedRoomName, ReplacedRoomComment, ReplacedRoomPassword: String; MyLobbyQuery: TMyQuery; MyRoomQuery: TMyQuery; aRoomURL: String; begin …

Member Avatar
Member Avatar
+0 forum 2

I am using delphi 2010 in WinXP. In C# and Java there are Normalizer function. It can transform letters with diacritics into ASCII (remove those accent marks). I do not know if there is Normalizer in delphi. What I am testing is below, but failed. I do not know how to solve it. I am using the [NormalizeString](https://msdn.microsoft.com/en-us/library/windows/desktop/dd319093(v=vs.85).aspx) Test for stripping accents aáeéiíoóöuúü AÁEÉIÍOÓÖUÚÜ --> aaeeiiooouuu AAEEIIOOOUUU Type ... const NormalizationD=2; var Form1: TForm1; implementation {$R *.dfm} function NormalizeString(NormForm: Integer; lpSrcString: LPCWSTR; cwSrcLength: Integer; lpDstString: LPWSTR; cwDstLength: Integer): Integer; stdcall; external 'C:\WINDOWS\system32\normaliz.dll'; function NormalizeText(Str: string): string; var nLength: integer; c: …

Member Avatar
Member Avatar
+0 forum 7

Hi, I want to use Lazarus on my mac, and I went through the steps, installed the three packages at http://sourceforge.net/projects/lazarus/files/Lazarus%20Mac%20OS%20X%20i386/Lazarus%201.2.6/ . I also typed xcode-select --install into my terminal, which installed some necessary command line tools. The 'Configure Lazarus IDE' has recognised the compiler, FPC sources, and 'make', but says that the GNU debugger cannot be found, at /usr/bin/gdb. If I understood the things I read while googling correctly, XCode has switched to LLDB, and it was Apple itself that supplied gdb for Mac. Where can I get a debugger for Pascal on Mac? Thanks

Member Avatar
Member Avatar
+0 forum 1

Hello everyone, I'm new here - just joined. I'm strugling with a bit of code. Im trying to check if a number is a prime number, but my program produces weird results. Herse the code: { Vefies if a value is prime. } function TMactacHash.IsPrime(value: integer): boolean; var i, overValue: integer; flag: boolean; begin flag := true; for i := 1 to value do begin overValue := value mod i; if overValue = 0 then flag := false; WriteLn(IntToStr(value) + ' mod ' + IntToStr(i) + ' = ' + IntToStr(overValue)); readln; end; Result := flag; end; { Generates the …

Member Avatar
Member Avatar
+0 forum 10

Am crating abit of code to save and add a menuitem to main menu but am having a small problem when reloading the saved lobby.dat file when its saved it should be save just click the lobby name is below **Support Group Lobby=56** but it keeps thinking the space is a new line and saves like below. **Support Group Lobby=56** if FileExists(DataFolder + '\lobbies.dat') then begin sl := TStringList.Create; sl.LoadFromFile(DataFolder + '\lobbies.dat'); // NewItem := TMenuItem.Create(Self); NewItem.Caption := LobbyName; NewItem.Tag := StrToInt(LobbyID); NewItem.OnClick := GoToLobbyClick; // MainMenu.Items.Items[2].Items[0].Add(NewItem); // sl.Duplicates := dupIgnore; sl.CommaText := NewItem.Caption+'='+IntToStr(NewItem.Tag); sl.SaveToFile(DataFolder + '\lobbies.dat'); sl.Free; end; any …

Member Avatar
Member Avatar
+0 forum 3

Am using GetProgrammDir to get my application folder and it works but I need more control over it were I can select folders inside or outside of my program say there 2 folders Data and Items data will store exe and items will store information txt but the data will be out side of the data folder like below `C:\MyProgra\Items\Readme.txt` `C:\MyProgram\Data\RunMe.exe` Now when I use GetDir I get data and exe folder fine but am unable to modify it to get MyProgram Folder only so that I can set the needed folders like `C:\MyProgram\<THEN I WOULD SET IT HERE IN …

Member Avatar
Member Avatar
+0 forum 3

Am currently using the following code to build my userlist but the down side to this is it will loop names over and over making duplicate names so am having to do extra code to stop same names showing up in list so am wondering if there a more professional less resource and hassle code for building userlist for rooms or lobbys? function TLobbyServer.GetLobbyUsers(const LobbyID: string): string; var i: Integer; HostID: string; begin Result := ''; for i := 0 to (SocketServer.ClientCount -1) do begin if (CompareText(SocketServer.Client[i].Lobby, LobbyID) = 0) then begin HostID := ''; HostID := IntToStr(Integer(CompareText(SocketServer.Client[i].LobbyOwner, SocketServer.Client[i].Name) = …

Member Avatar
Member Avatar
+0 forum 2

Am looking for a way to download a image from a URL using twebbrower and to save it to a folder, it would access url and then have section for file name and folder name and then it would save the file as a jpg to the folder on drive. I googled this and I can not seam to find what I need so am wondering if anyone can help ? Thanks

Member Avatar
Member Avatar
+0 forum 8

Am trying to look the code below so it will loop the current items already in the list and display them all plus any new onces added but am having a bit of trouble doing this what am I missing or doing wrong? Gallery.Duplicates := dupIgnore; Gallery.Sorted := True; // page := '<HTML><BODY BGCOLOR=000000 TEXT=00FF00><TABLE CELLSPACING=0 CELLPADDING=0>'; page := page + '<TR>'; page := page + '<TD ALIGN=CENTER VALIGN=TOP>'; page := page + '<TABLE CELLSPACING=3 CELLPADDING=0>'; page := page + '<TR><TD ALIGN=CENTER>'; page := page + '<IMG SRC="'+FileDir+FileName+'" height="128" width="128" border="0">'; page := page + '</TD></TR>'; page := page + …

Member Avatar
Member Avatar
+0 forum 1

Am looking for a way to add a custom item image in icon view on a listview the icons I want to use is a single image bmp file with 4 icons on the image so I need a way to select each image on the file and a nice clean way to update the room icons at any time with out no flickering, I have done this before using a imagelist but I would really like to just to keep all images as bmp format so that the users can make there own custom icons at anytime, can anyone …

Member Avatar
Member Avatar
+0 forum 1

I am trying to create a form dynamicly and thus I need to initialize my DBGrid with code. { Connect the DBGrid to the database. } procedure TfrmRemoveRecord.InitDBGrid(); begin dbgList.DataSource := dmProgramDatabase.dsrCaches; end; But I get an access violation error.

Member Avatar
Member Avatar
+0 forum 3

Am trying to make my program menu and skin resize when I disable the MainMenu VCL I have attached a image of a program that uses same idea when menu is enabled there is too buttons hidden but once the menu is disabled the pager and options buttons and rest of the skin is visible I been trying to recreate this with out any luck can any one help ? Thanks alot ![f7d0d05b451a50953ebde55bdaa34474](/attachments/large/2/f7d0d05b451a50953ebde55bdaa34474.jpg "f7d0d05b451a50953ebde55bdaa34474")

Member Avatar
Member Avatar
+0 forum 3

I use Delphi 7 to develop programs, but the programs that I make, UI looks outdated. I was wondering if there is an option that I can adjust how to generated UI looks like? Thanks.

Member Avatar
Member Avatar
+0 forum 2

I have a huge project to do for my Gr11 PAT(Practical Assessment task) We have to create a project based on Geocaching [Click Here](http://www.geocaching.com) and I need ideas to start planning my Fase 1 - wich constructs of a basic descrption of at my program wil do. I need at least 3 ideas - 3 programs in the one program. I already have an idea ( giving the distance between 2 coordines) but since the teacher and the project suggested that option already i need 2 great additional ideas. It has to be any kind of geographic IT program - …

Member Avatar
Member Avatar
+0 forum 4

Does anyone have an idea of how I should make a simple calculator without the case function?

Member Avatar
Member Avatar
+0 forum 4

I have a project in wich i have to create a program making usae of geotechnology. My program revolves around pilots, paragliders and airbaloons. Basicly it has 3 seperate programs for each category and solves some of the difficulties that come along with it. Any idead for a name and logo I can use? thanks

Member Avatar
Member Avatar
+0 forum 5

I am trying to make a simple calculator, unfortunately, it isn't going so well. Any ideas on how to make it simple? if gamemode=1 then {If gamemode 1 has been chosen} begin clrscr; title; writeln ('Welcome to Calculator'); writeln; writeln ('To begin, press <Enter>'); readln; clrscr; title; writeln ('Choose which symbol is needed'); writeln ('"+" "-" "*" "/"'); readln(symbol); if symbol='+' then {addition} begin clrscr; title; writeln ('Addition Problem (One time use only)'); writeln; writeln ('Enter two numbers(with spaces) to solve out.(No decimal numbers)'); readln (add1,add2); addresult:=add1+add2; writeln; writeln ('The result is ',addresult); readln; clrscr; title; quit; end; if symbol='-' …

Member Avatar
Member Avatar
+0 forum 2

I have an array of seven numbers and I would like to sort the numbers from the smallest to the largest. How should I do it?

Member Avatar
Member Avatar
+0 forum 2

Why learn Pascal or delphi? They are both old and not used much. So why learn them instead of a more popular language like Java?

Member Avatar
Member Avatar
+0 forum 3

Is it just me or is Delphi not so popular when it comes to programming laungages?

Member Avatar
Member Avatar
+0 forum 6

The End.