Pascal – Decision Making

July 5, 2019 0

Decision making structures require that the programmer specify one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to […]

Get the name of the day today!

June 22, 2019 0

Here is an example of what the function returns: ‘The day today is ‘ + daytoday+’.’ Returns on a monday: The day today is Monday. Here is the function: function daytoday: string; begin Result:=”; {Can […]

Arduino – Overview

April 25, 2017 0

Arduino is a prototype platform (open-source) based on an easy-to-use hardware and software. It consists of a circuit board, which can be programed (referred to as a microcontroller) and a ready-made software called Arduino IDE […]

Pascal – Units

July 5, 2019 0

A Pascal program can consist of modules called units. A unit might consist of some code blocks, which in turn are made up of variables and type declarations, statements, procedures, etc. There are many built-in […]

Check if a file is in use – delphi

January 15, 2020 0

// Check if a file is in use function IsFileInUse(FileName: TFileName): Boolean; var HFileRes: HFILE; begin Result := False; if not FileExists(FileName) then Exit; HFileRes := CreateFile(PChar(FileName), GENERIC_READ or GENERIC_WRITE, 0, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); […]

Get/set the Date of a folder

January 17, 2020 0

Get/set the Date of a folder in delphi function GetFolderDate(Folder: string): TDateTime; var Rec: TSearchRec; Found: Integer; Date: TDateTime; begin if Folder[Length(folder)] = ‘\’ then Delete(Folder, Length(folder), 1); Result := 0; Found := FindFirst(Folder, faDirectory, […]

Arduino – Fading LED

April 25, 2017 0

This example demonstrates the use of the analogWrite() function in fading an LED off. AnalogWrite uses pulse width modulation (PWM), turning a digital pin on and off very quickly with different ratios between on and […]

Search a file for a specified text

January 17, 2020 0

Search a file for a specified text from delphi function ScanFile(const FileName: string; const forString: string; caseSensitive: Boolean): Longint; { returns position of string in file or -1, if not found } const BufferSize = […]

Run a Program automatically at Windows start-up

January 17, 2020 0

Run a Program automatically at Windows start-up uses Registry; procedure SetAutoStart(AppName, AppTitle: string; bRegister: Boolean); const RegKey = ‘\Software\Microsoft\Windows\CurrentVersion\Run’; // or: RegKey = ‘\Software\Microsoft\Windows\CurrentVersion\RunOnce’; var Registry: TRegistry; begin Registry := TRegistry.Create; try Registry.RootKey := HKEY_LOCAL_MACHINE; […]

Arduino – Program Structure

April 25, 2017 0

In this chapter, we will study in depth, the Arduino program structure and we will learn more new terminologies used in the Arduino world. The Arduino software is open-source. The source code for the Java […]

Arduino – Serial Peripheral Interface

April 25, 2017 0

A Serial Peripheral Interface (SPI) bus is a system for serial communication, which uses up to four conductors, commonly three. One conductor is used for data receiving, one for data sending, one for synchronization and […]

Android – Fragments

July 5, 2019 0

A Fragment is a piece of an activity which enable more modular activity design. It will not be wrong if we say, a fragment is a kind of sub-activity. Following are important points about fragment − A fragment […]

Follow on Facebook