Showing posts with label programiranje. Show all posts
Showing posts with label programiranje. Show all posts

Saturday, November 20, 2021

Repaint your slow Windows 10 and 11

Howdy, Stranger! 

REGISTRY KNOWLEDGE for better computer response:


Disable_Cortana.reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search]

"AllowCortana"=dword:00000000



Enable_Cortana.reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search]

"AllowCortana"=dword:00000001



NoAutoupdate.reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AU]
"NoAutoUpdate"=dword:00000001





Block that PC Health sucker1.reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHC]
"PreviousUninstall"=dword:00000001



Block that PC Health sucker2-plus.reg:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealthCheck]
"installed"=dword:00000001


Sharing Printer hell in Windows 10 after new updates *** workaround:

-------------------------------
Thankfully, there’s a workaround for 0x0000011b printing errors. To address the 0x0000011b error, open Registry Editor and follow these steps:

In Registry Editor, open HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print key.
Create a new DWORD-32 bit value.
Name it “RpcAuthnLevelPrivacyEnabled”.
Set the value to 0.
Save the changes and close the editor.

---------------------------------


Kako dodatno ubrzati Windows 10 ?

Settings > Update & security > Advanced options > Delivery optimization i isključiti Allow downloads from other PCs.

Settings > System > Notification&Actions i isključiti stvari kao što su Get tips, tricks and suggestions kada koristite Windows ili Show me the Windows welcome experience after updates and occasionally when I sign in to highlight what’s new and suggested i predložena i pojedinačna obaveštenja o aplikaciji.

Settings > Personalization > Start > Show suggestions occasionally in Start.

Settings > Privacy > General > Let apps use advertising ID to make ads more interesting to you based on your app activity (Isključivanjem ovoga ćete resetovati vaš ID).

Settings > Privacy > Inking & typing i isključiti opciju.

Settings > Privacy > Background apps i ili isključite Let apps run in the background ili isključite svaku aplikaciju pojedinačno.

Settings > Accounts > Sync your settings. Možete isključiti sinhronizaciju svih podešavanja ili možete selektivno isključiti određena podešavanja.

Settings > Updates > Advanced options i pod Pause updates izaberite datum u narednih 35 dana. Međutim, nećete moći ponovo da pauzirate nakon tog trenutka dok sistem ne ažurirate.


RESTORE MBR AFTER WRONG WINDOWS+LINUX DUALBOOT INSTALLING:

Download Easy BCD: https://neosmart.net/EasyBCD/ (Download Non Commercial One)


++



1) Load Windows 10 install disk

2) SHIFT+F10

3) bootsect /nt60 ALL /force /mbr

4) bootrec /fixboot

5) bootrec /fixmbr

Tako da, mir, mir, mir, niko nije kriv što je nepažljiv...



Returning to BIOS at boot problem solving:

0) Unplog power cord, press power buton for 10 seconds, Unplug all devices from motherboard, replug again, power on...

1) Set BIOS to defaults.

2) Disable Secure boot control to disabled.

3) Set to UEFI+Legacy

4) Disable Fast boot

5) Launch CSM enabled




Etcher undo from cmd prompt:

diskpart

DISKPART> list disk

select disk 1

clean

create partition primary

select partition N

format fs=fat32 quick



Tuesday, October 12, 2021

Use PC Power Supply for other things

 https://dronebotworkshop.com/atx-bench-supply/





Šta je najbolje protiv virusa i prehlade?

  • Spavajte dovoljno
  • Balansirajte ishranu
  • Koristite med, nanu i sirup ili sok od zove
  • Nadoknadite vitamin D u zimskim mesecima
  • Jedite povrće i voće, a naročito crno voće
  • Uzimajte suplemente cinka
  • Pojedite jedan brazilski orah nedeljno
  • Konzumirajte ribu
  • Slobodno se krećite i spavajte na hladnom







Kafa je zasigurno štetnija nego što to mnogi misle.

Kafa je glavni izvor kofeina, moćnog stimulansa koji je u suštini otrovan. Dovoljno govori to da određene biljke proizvode kofein da bi ih kao pesticid štitio od insekata. Kofeina, osim u kafi, ima i u crnom čaju, kola pićima, energetskim napicima, čokoladi, u pojedinim ljekovima protiv bola, migrene, prehlade...

Kofein utiče na nadražljivost nervnog sistema, i na neki način stimuliše sve djelove kore mozga. Neki stručnjaci kažu da je smrtonosna doza 10 grama, što predstavlja količinu koja se nalazi u oko 70 šolja kafe. Mnogi ljudi svakog dana uzimaju desetinu smrtonosne doze, a čak i u samo jednoj šolji kafe vrebaju supstance koje ozbiljno mijenjaju organizam.

Povezanost sa bolestima

U kafi se nalazi na stotine drugih štetnih hemijskih sastojaka uključujući acetaldehid, amonijak, ugljenik-disulfid, katehol, etanol, metanol, naftalin, fenol, vodonik sulfid....
Kafa je, inače, diuretik, odnosno izlučuje tečnost iz tijela izazivajući dehidraciju koja se smatra predvorjem za bolesti.
Kofein povećava trenutni osjećaj energije tako što podstiče porast nivoa šećera u krvi. Zbog toga se, međutim, naglo izlučuje određena količina insulina iz gušterače. Posljedica njegovog djelovanja je potpuno suprotna - čovjek brzo osjeća iscrpljenost.
Kofein djeluje i kao direktni stimulans srčanog mišića. Kada dođe do srca, prouzrokuje sužavanje arterija. Takođe, povećava opterećenje srca ubrzavajući stopu rada i povećavajući krvni pritisak, istovremeno smanjujući ishranu srca krvlju.

Samo jedna šolja kafe na dan utičena na povećanje i donjeg i gornjeg pritiska, a da ne govorimo o većim količinama. Zato često prestanak konzumiranja napitaka sa kofeinom, naročito kafe, dovodi do snižavanja krvnog pritiska. Onda ljudi pokušavaju da problem niskog pritiska riješe na način što će popiti kafu, a u stvari kafa je uzrok pada pritiska.
Kofein remeti san, i opšte je poznato da oni koji žele da “razbiju” san uzimaju napitke koji sadrže kofein, a to je najčešće kafa.
Kafa može da prouzrokuje rak bešike i jajnika, čir želuca... Rak debelog crijeva je takođe povezan sa konzumiranjem kafe.
Stručnjaci se još raspravljaju da li kafa predstavlja značajan rizik od raka, ali nema sumnje da ovaj proizvod sadrži hemikalije koje mogu da izazovu rak. Među takve hemikalije spadaju metilglioksal, katehol, hlorogena i neohlorogena kiselina. Pojedini stručnjaci kažu da kofein nije pravi kancerogen sam po sebi, već da je ko-kancerogen. To znači da može da poveća vjerovatnoću da će se rak pojaviti, ako je u prisustvu drugih kancerogena.

Napici s kofeinom mogu prouzrokovati i nadraživanje želuca. Za to su odgovorni aditivi iz tih napitaka.
Sam kofein djeluje na krvne žile sistema za varenje tako što podstiče njihovo stezanje. To ometa normalno varenje. Napici s kofeinom tjeraju želudac da izlučuje preveliku količinu želudačne kiseline. To može pogoršati stanje kod osoba s čirom u sistemu za varenje.
Ustanovljeno je i da kofein ometa apsorpciju kalcijuma i gvožđa iz hrane što podstiče razvoj osteoporoze i anemije.
Neki od efekata napitaka sa kofeinom koji se mogu javiti nakon konzumiranja su: poremećena ravnoteža, ubrzan rad srca, povišena ili izmijenjena visina glasa, nesanica, slabo pamćenje, zamor i drhtavica prstiju. Drugi simptomi koji se nešto kasnije javljaju su: problemi sa cirkulacijom, poremećaj pamćenja, glavobolja, uznemirenost, lupanje srca, drhtavica, nestabilnost, vrtoglavica, hiperrefleksija, razdraženost, uzrujanost, nervoza, depresija, nestabilnost u nogama...

Uzeta količina i tip pića koji sadrži kofein određuje stepen neželjenih reakcija i problema koji se mogu javiti kod čovjeka.
Istraženo je i da hlorogena kiselina u kafi prouzrokuje alergije na hranu. Takođe, postoje podaci da je zadržavanje tečnosti sporedni efekat kofeina.

Očito i da dejstvo kofeina na ćelije pankreasa pogoršava dijabetes. U eksperimentima na miševima, kafa je veoma pogoršavala dijabetes. Može se smatrati faktorom rizika za pojavu dijabetesa.
Neka istraživanja pokazuju i da osobe koje piju kafu, u poređenju sa onima koji je ne piju, imaju višak kilograma, koriste više alkohola i puše više cigareta... Otrov kao što je kafa, najpopularniji izvor kofeina, može da stimuliše i mnoge druge zdravstvene probleme, a naročito je štetna po zdravlje ako je organizam već oslabljen ili se pojavila neka bolest.

Zavisnost

Često se raspravlja, naročito među laicima, da li se postaje zavistan od kafe. Medicina je ozbiljno istražila da kofein izaziva određenu zavisnost kod konzumenta, i to se vrlo lako može testirati.
Sve supstance koje stvaraju zavisnost dovode do određenih fizičkih i psihičkih posljedica u trenutku kad se ukine njihova upotreba.
Najbolji način da se preispita zavisnost od kofeina jeste da se nekoliko dana prestane sa uzimanjem te materije u bilo kojem obliku. Najuobičajeniji fizički simptom odvikavanja od kofeina jeste glavobolja, koja može varirati od umjerene do snažne. Ostali simptomi koji se mogu pojaviti jesu osjećaj iscrpljenosti, nedostatak apetita, mučnina i povraćanje.
Čovjek se može osjećati i psihološki bezvoljno. Simptomi često ne traju duže od jednog dana, a u pojedinim slučajevima potraju i četiri do pet dana.
U SAD su rađene analize koje pokazuju da proizvodi koji sadrže kofein, a naročito kafa, često su povezani sa pušenjem u pogledu ponašanja.
I to je zaista tačno. Mnogim pušačima je skoro nezamislivo da uzmu šolju kafe, a da je ne proprate cigaretom. I kafa i cigarete su ozbiljni otrovi koji narušavaju zdravlje.
Istraživanja su pokazala i da ukoliko se kofein ne unosi ujutro, nagon za pušenje se smanjuje ili ga uopšte nema. Izbjegavanje kofeina može da bude put ka prekidu pušenja.

Kafa bez kofeina ništa bolja

Na kraju, neko može da kaže da pije kafu bez kofeina. Dr Agata Treš kaže da „upotreba kafe i drugih napitaka oslobođenih kofeina umesto napitaka sa kofeinom je kao zamjenjivanje oštrog kamena iz desne cipele za oštar kamen u lijevoj”.

“Ovi napitci obično prouzrokuju gubitak osjećaja ukusa hrane zbog remećenja čula ukusa i mirisa. Stariji ljudi naročito mogu da pate zbog upotrebe napitaka bez kofeina, i izgleda da su grupa koja će najvjerovatnije preći sa pića sa kofeinom na ona bez kofeina”, kaže dr Treš.

Kafa bez kofeina sadrži mnoge druge otrove koje sam već naveo na početku priče o kafi.

“Ulja iz kafe zvana kafeoli su i dalje prisutna, i nadražuju stomak i ostatak sistema za varenje, stimulišući veću proizvodnju kisjeline. Istraživanja na mladim pacovima su pokazala da je kafa bez kofeina, koja je davana ovim životinjama, značajno usporavala stopu njihovog rasta, potvrđujući na još jedan način prisustvo i drugih štetnih supstanci pored kofeina”, tvrdi dr Treš u svojoj knjizi “Otrov sa velikim K”.





Thursday, October 7, 2021

Kako napraviti koristan bekap svega

 https://www.howtogeek.com/213145/how-to%C2%A0convert-a-physical-windows-or-linux-pc-to-a-virtual-machine/


https://www.virtualbox.org/wiki/Migrate_Windows



More tips for a good party:

https://www.homemade-circuits.com/simple-hobby-circuits/

Kako zaraditi od čepova:

https://www.instructables.com/Recycled-Chopping-Board/?utm_source=newsletter&utm_medium=email

MORE TIPS:

C:\>

cmd

edit c:\driver.bat

shutdown -s

Alt+F+S
Alt+F+X

C:\>

at 15:40 /every:M,TW,Th,F,S,Su c:\driver.bat


Ова команда ће Вам осигурати да се искључи компјутер после радног времена Ваших заборавних радника !

EndeavourOS+Firefox+YouTube_ram_usage = 1,28 GB





GOOD TIPS:

1) Run > Services.msc
WindowsUpdate, Disable

+ 2)
Run > Regedit
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows
On The Left Panel...
New>Key
\WindowsUpdate
New>Key
\AU
On The Right Panel... > RightMouseKeyPress > New > REG_DWORD (32-bit) Value
NoAutoUpdate
1



----------------
OR
----------------

noautoupdate.reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AU]
"NoAutoUpdate"=dword:00000001



NE555 pin functions

Tuesday, October 5, 2021

Windows 10 update


With a backup at hand, now it's safe to customize a Windows 10 update without receiving any forced updates on your computer. Here's how to make the change in Registry: 1. Press the Windows key + R key to open the Run command. 2. Type regedit, and click OK to open the Registry. Browse the following path: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows 3. Right-click the Windows folder, select "New" and then click "Key". 4. Name the new key "WindowsUpdate" and press "Enter". 5. Right-click the newly created key, select "new", and click "Key". 6. Name the new key AU and press Enter. Inside the newly created key, right-click on the right side, select "New", and click on "DWORD (32-bit) Value". 7. Name the new key AUOptions and press Enter. Double-click the newly created key and change its value to 2. It's for "Notify for download and notify for install". Click "OK". 8. Close the Registry to complete the task. Using this value prevents Windows 10 from downloading updates automatically, and you'll get a notification when new updates are available. In this way, you can avoid any auto Windows 10 update effectively. That's how you could make an attempt to disable Windows 10/11 updates in every way. Each method has been proved to work as long as you wish to turn off all the automatic updates in Windows 10.

*




An incredible idea:

<?php

require('./fpdf.php');

$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output('c:\test1.pdf');
shell_exec("'C:\Program Files\Adobe\Acrobat 6.0\Reader\acrord32.exe' /t c:\test1.pdf \\myserver\myprinter");
?>

CMD>

path "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\"


acrord32 /p /h d:\20200122082625.pdf


Antix, MX, PepprmintOS are the fastest ever, you can install everything from Ubuntu-Debian realm. PeppremintOS has preinstalled Flatpak and Synaptic package manager.
NuTyX and NixOS are an independent distros. NixOS is a brilliant distro.
NeptuneOS is Debian-based Plasma KDE. Nitrux is very good too, it has a Calamares installer.



Monday, October 4, 2021

Hard disk clone

 You can download the Macrium Reflect Free Edition cloning software from: https://www.macrium.com/reflectfree

And the CrystalDiskMark drive benchmarking utility from: https://crystalmark.info/en/software/...

++

TIPS AND TRICKS:

++

CSS GRID TIPS:

++

Windows 10 cool facts and tricks:

++

Strip down your overbloated Windows 10:


ULTRA COOL STUFF in CSS 3D:


USB SMART CARDS ON LINUX (Gemalto and similar):

++











Thursday, September 30, 2021

Shared printers nightmare on Windows 10 new update

 Solutions via command prompt:

  1. Click the Search icon from the taskbar.
  2. Type cmd.exe.
  3. Press Ctrl + Shift + Enter.
  4. Select the Yes option when a UAC dialog shows up.
  5. This will open Command prompt as administrator.
  6. Type the command – wusa /uninstall /kb:5005565.
  7. Hit Enter and click Yes if you are asked for the removal.

Thankfully, there’s a workaround for 0x0000011b printing errors. To address the 0x0000011b error, open Registry Editor and follow these steps:

  1. In Registry Editor, open HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print key.
  2. Create a new DWORD-32 bit value.
  3. Name it “RpcAuthnLevelPrivacyEnabled”.
  4. Set the value to 0.
  5. Save the changes and close the editor.

It is worth noting that the issue is not restricted to particular hardware. If you’re unable to restore the printing feature, you can also uninstall Windows 10 update manually and pause updates for a few weeks or until a new patch is issued by Microsoft.

The cure for all problems:


Најпотребнији програми за Виндовс 10:


https://www.oo-software.com/en/shutup10


https://www.thewindowsclub.com/10appsmanager-windows-10


https://github.com/Sycnex/Windows10Debloater

Friday, July 24, 2020

Postanite profesionalni programer na Linuxu

1) Instalirajte Linux Lite

2) otvorite command promt i unesite:

sudo apt-get update
sudo apt-get lazarus-ide
sudo apt-get lazarus

Čestitamo, sada ste spremni za velika dela:




Lazarus-ide možete koristiti i za programiranje u Windows 10, ali nije u tome poenta, nego da više promovišemo open sors i Linux koji je zapostavljen u Srbiji.

https://rti.etf.bg.ac.rs/rti/ir1p1/materijal.html

https://bubblecup.org/

http://messylab.com/

Object oriented concepts and design patterns

https://medium.com/@ronnieschaniel/object-oriented-design-patterns-explained-using-practical-examples-84807445b092

https://hackernoon.com/10-oop-design-principles-every-programmer-should-know-f187436caf65

https://www.codingame.com/playgrounds/503/design-patterns/object-oriented-programming

https://www.cs.uct.ac.za/mit_notes/software/htmls/ch08s03.html

https://www.geeksforgeeks.org/design-patterns-set-1-introduction/

https://www.freecodecamp.org/news/the-basic-design-patterns-all-developers-need-to-know/

https://github.com/samsam-026/Design_Patterns

https://www.tutorialspoint.com/design_pattern/design_pattern_overview.htm


Bubble Cup finals programming environment


We are just couple of days away from the start of the finals. Compilers and IDEs available on the finals are:
  • C++
    • IDE: CodeBlocks 16.01, Visual Studio 2017
    • Compiler: MinGW 4.9.2, Visual Studio 2017
  • C#
    • IDE: Visual Studio 2017
    • Compiler: Visual Studio 2017
  • Pascal
    • IDE: Free Pascal, Lazarus 1.6.4
    • Compiler: Free Pascal Compiler 3.0.2

Thanks,
Bubble Cup Crew

Tuesday, October 8, 2019

Open PDF in the Internet Explorer

https://helpx.adobe.com/acrobat/using/display-pdf-in-browser.html

or 


  • Close Internet Explorer. Start the Adobe Acrobat Reader program.
  • Click "Edit" and select "Preferences." From the list on the left, select "Internet."
  • Uncheck "Display PDF in browser" and click "OK." Open the "Preferences" window again. Select "Internet." Place a check next to "Display PDF in browser."
  • Open Internet Explorer. Click "Tools." Click "Manage Add-ons."
  • Click "Toolbars and Extensions." Look for and right-click "Adobe Acrobat Control for ActiveX (pdf.ocx)." Select "Enable." Click "OK."
  • Restart Internet Explorer. PDF files opened within Internet Explorer will display within the browser itself.

Sunday, October 14, 2018

Šta je neophodno jednom modernom uredu ili kancelariji

1) ONLYOFFICE https://www.onlyoffice.com/ (from Riga, Latvia)
2) XAMPP
3) VLC
4) Audacity
5) GIMP
6) Inkscape
7) PSPad
8) Notepad ++
9) Visual Studio Code
10) Lazarus IDE
11) Android Studio
12) Java
13) SQLite
14) Postgre
15) GO https://golang.org/
16) Tragac https://beogradsko.blogspot.com/2018/05/aplikacija-tragac-6-je-native-windows.html

 i naravno operativni sistem Windows ili Linux.

Ukoliko i Vi imate da reklamirate neki svoj proizvod ili slične sadržaje, blogove, knjige i sajtove slobodno me kontaktirajte.



**


MORE IMPORTANT TIPS:




IDS protekcija:

Intrusion detection system 
https://en.wikipedia.org/wiki/Intrusion_detection_system

1. Fail2ban scans log files (e.g. /var/log/apache/error_log) and bans IPs that show the malicious signs -- too many password failures, seeking for exploits, etc.:

http://www.fail2ban.org/wiki/index.php/Main_Page

2. OSSEC scans Microsoft IIS log files and integrity:

https://www.ossec.net/downloads.html

Friday, October 5, 2018

The endless possibilities


https://www.linuxliteos.com/download.php


FREEWARE ZA SVAKI DAN 

Drugari, instalirajte što pre ovaj izvanredan operativni sistem, jer isti ne smeta Windowsu, možete imati na primer Microsoft Windows 10, a pored njega i ovaj predivni operativni sistem kao alternativu.

On je u svakom slučaju mnogo brži od Microsoft Windows-a, neki kažu da je i lepši, mada se o ukusima ne raspravlja.

Imajte Microsoft Windows 10 kao i do sada, ali instalirajte i ovaj operativni sistem. Instalacija je veoma jednostavna i može se obaviti iz samog Windows 10 operativnog sistema koristeći mali instalacioni fajl.

Ukoliko imate neko pitanje ili Vam zatreba pomoć, ja sam Vam uvek na raspolaganju kao i do sada 24 sata, 7 dana u nedelji.


Ovaj linux fabrički ugradjuju u brand new Asus laptopove, tako da predstavlja sasvim solidnu zamenu kako za Windows, tako i za ostale Linux distribucije, a da ne govorimo o Android OS.

Ovaj Linux veoma podseća kako na Microsoft Windows 10, tako i na Android, takoreći od oba sveta po malo šmeka:


Ukoliko i Vi imate da reklamirate neki svoj proizvod ili slične sadržaje, blogove, knjige i sajtove slobodno me kontaktirajte.




https://www.bcgroup-online.com/laptopovi/asus-x540na_gq052-%28pentium-n4200.-4gb.-1tb%29-48144

https://www.bcgroup-online.com/laptopovi/asus-x540na_dm164-%28full-hd.-pentium-quadcore-n4200.-4gb.-500gb%29-48008


ENDLESS OS


Preloaded with content

Endless comes with more than 100 free apps and powerful tools that don’t require an Internet connection.

Simple as a smartphone

Endless is designed to feel natural and intuitive, making it easy to use even if you have little or no computer experience.

No hidden costs

Endless is free to download, and software updates are automatically included. It's also virus-resistant, saving you money at every step.

Connect to the world

When you are connected to the internet, Endless works like any other computer, so you can search the web or stay in touch with friends.
Endless OS Short (English) from Endless on Vimeo.





Još mojih lepih i korisnih aplikacija:
Super korisna aplikacija


https://vimeo.com/168222535









Thursday, October 4, 2018

Monday, September 24, 2018

Typed Files in Delphi & Lazarus

Simply put a file is a binary sequence of some type. In Delphi, there are three classes of filetyped, text, and untyped. Typed files are files that contain data of a particular type, such as Double, Integer or previously defined custom Record type. Text files contain readable ASCII characters. Untyped files are used when we want to impose the least possible structure on a file.

Typed Files

While text files consist of lines terminated with a CR/LF (#13#10) combination, typed files consist of data taken from a particular type of data structure.
For example, the following declaration creates a record type called TMember and an array of TMember record variables.
 type
  TMember = record
    Name : string[50];
    eMail : string[30];
    Posts : LongInt;
  end;
 var Members : array[1..50] of TMember; 
Before we can write the information to the disk we have to declare a variable of a file type. The following line of code declares an F file variable.
 var F : file of TMember; 
Note: To create a typed file in Delphi, we use the following syntax:
var SomeTypedFile : file of SomeType
The base type (SomeType) for a file can be a scalar type (like Double), an array type or record type. It should not be long string, dynamic array, class, object or a pointer.
In order to start working with files from Delphi, we have to link a file on a disk to a file variable in our program. To create this link we must use AssignFile procedure in order to associate a file on a disk with a file variable.
 AssignFile(F, 'Members.dat') 
Once the association with an external file is established, the file variable F must be 'opened' to prepare it for reading and/or writing. We call Reset procedure to open an existing file or Rewrite to create a new file. When a program completes processing a file, the file must be closed using the CloseFile procedure. After a file is closed, its associated external file is updated. The file variable can then be associated with another external file.
In general, we should always use exception handling; many errors may arise when working with files. For example: if we call CloseFile for a file that is already closed Delphi reports an I/O error. On the other hand, if we try to close a file but have not yet called AssignFile, the results are unpredictable.

Write to a File

Suppose we have filled an array of Delphi members with their names, e-mails, and number of posts and we want to store this information in a file on the disk. The following piece of code will do the work:
 var
  F : file of TMember;
  i : integer;
begin
 AssignFile(F,'members.dat') ;
 Rewrite(F) ;
 try
  for j:= 1 to 50 do
   Write (F, Members[j]) ;
 finally
  CloseFile(F) ;
 end;
end; 

Read from a File

In order to retrieve all the information from the 'members.dat' file we would use the following code:
 var
  Member: TMember
  F : file of TMember;
begin
 AssignFile(F,'members.dat') ;
 Reset(F) ;
 try
  while not Eof(F) do begin
   Read (F, Member) ;
   {DoSomethingWithMember;}
  end;
 finally
  CloseFile(F) ;
 end;
end; 
Note: Eof is the EndOfFile checking function. We use this function to make sure that we are not trying to read beyond the end of the file (beyond the last stored record).

Seeking and Positioning

Files are normally accessed sequentially. When a file is read using the standard procedure Read or written using the standard procedure Write, the current file position moves to the next numerically ordered file component (next record). Typed files can also be accessed randomly through the standard procedure Seek, which moves the current file position to a specified component. The FilePos and FileSizefunctions can be used to determine the current file position and the current file size.
 {go back to the beginning - the first record}
Seek(F, 0) ;
{go to the 5-th record}
Seek(F, 5) ;
{Jump to the end - "after" the last record}
Seek(F, FileSize(F)) ; 

Change and Update

You've just learned how to write and read the entire array of members, but what if all you want to do is to seek to the 10th member and change the e-mail? The next procedure does exactly that:
 procedure ChangeEMail(const RecN : integer; const NewEMail : string) ;
var DummyMember : TMember;
begin
 {assign, open, exception handling block}
 Seek(F, RecN) ;
 Read(F, DummyMember) ;
 DummyMember.Email := NewEMail;
 {read moves to the next record, we have to
 go back to the original record, then write}
 Seek(F, RecN) ;
 Write(F, DummyMember) ;
 {close file}
end;

Completing the Task


That's it -- now you have all you need to accomplish your task. You can write members' information to the disk, you can read it back and you can even change some of the data (e-mail, for example) in the "middle" of the file.


ORIGINAL ARTICLE:

https://www.thoughtco.com/create-database-delphis-file-typed-files-1058003






NEMA ODMORA DOK TRAJE OBNOVA ---->>>>>

IDEMO DALJE ------------>>>>>