Posts

Read XML String and load the data in Controls

We can read a XML string and parse the data based on the XML tags and load the data into our UI COntrols. In the following example a Customer data is sent as XML String, We are going to retrieve the Customer Name, Address and City and load the same in the Edit Controls. s XML is string = "<?xml version='1.0' encoding='utf-8'?><XMLHDR><RESULT>TRUE</RESULT><CUSTOMER><NAME>TESTNAME</NAME><ADDRESS>12 A BLOCK</ADDRESS><STREET>15TH STREET</STREET><CITY>CHENNAI</CITY></CUSTOMER></XMLHDR>" XMLDocument ( "XMLOrd" , s XML )  XMLFirst ( "XMLOrd" ) XMLChild ( "XMLOrd" ) IF XMLElementName ( "XMLOrd" ) = "RESULT" THEN        IF XMLData ( "XMLOrd" ) = "TRUE" THEN                               WHILE XMLOut ( "XMLOrd"...

BarCode Scanner

              Windev supports Bar code scanner device via Serial Port, Parallel Port and IR Port. Serial Port connection only allows the read function. Many systems have parallel ports default. So we need to convert Parallel Port to Serial port to use windev functions. To convert a Parallel Port to Serial port we need to do some configurations.                Install HSM USB Serial Driver                    First we need to scan particular barcode given with HSM USB Serial Driver Codes to connect a Barcode Scanner via Serial Port :                       // Declare the variables                       // Define the number of characters that must be read            n NbCharToRead  is  int ...

Access HFSQL DataFile from a different application

Sometimes there will be a need to access any one or more HFSQL Datafiles from a different path other than the current application folder. We have a function called HChangeDir to change the connection to a specified application folder. Example HChangeDir(TableName,CompleteDir(PathOfFileServer))              Where PathOfFileServer is the Path of the different application

Zip functionalities

Adding Files to Zip In some projects there might be many files generated which needs to be added as an archive and send to a client or transferred to a specific pre-defined directory. We have ZipCreate and ZipAddDirectory function for this in windev ZipCreate ZipCreate function is used to create an Archive with the mentioned name. ZipAddFile Adds a file (of any type) into an archive  ZipAddDirectory Adds all the files in a Directory to the Archive      // Create the archive      ResCreate = zipCreate ( "MyArchive" , "C:\Temp\Archive.zip" )      IF ResCreate = 0 THEN               // Add a file into an archive              ResAddFile = zipAddFile ( "MyArchive" , ...                    "C:\MyDirectory\MyFiles\File.pdf" , zipDrive )              //adds all the files in ...

Track Directory

Image
fTrackDirectory (Function) When there is a requirement to track the files creation, modification, deletion of the files in a specified directory we can use the function fTrackDirectory. This function detects the modifications performed on the content of a directory. Only the modifications performed on the files found in the directory are detected. In case of modification, a specific procedure is run in a thread. Example          // Name of directory to track s DirectoryName is string = "C:\Temp\MyDir"         // The ProcessDirModification procedure will be called        // whenever a file or directory found in the "C:\Temp\MyDir" directory is modified.   IF fTrackDirectory ( s DirectoryName , ProcessDirModification , ftCreateFile  ... + ftModifyFile + ftDeleteFile + ftRename ) THEN                  // Inform the ...

Toast Display

Image
Displays a "Toast" message. The Toast is a furtive message that appears during a few seconds on the screen before disappearing with a fade-in effect without any intervention from the user. A Toast message does not take focus, it is not modal and it does not interrupt the execution of the application. The display of Toasts is recommended to transmit information to the user without locking the execution of the application (example: displaying a message to indicate the end of a download operation). Example ToastDisplay ( "This is a Toast message." ) ToastDisplay ( "This is a Toast message." ,  toastLong ,  vaMiddle ,  haCenter ,  LightGreen )) Syntax ToastDisplay(<Message> [, <Display Duration> [, <Vertical Alignment> [, <Horizontal Alignment> [, <Background Color>]]]]) <Message>:  Character string (with quotes) Message ...

Word Processing Control

Image
Overview The "Word processing" control is an evolved control allowing the end user to create and edit documents in docx format in theWINDEV application. The benefits are time saving, consistent interface, no other software to install/drive/manage. This control allows you to: ·     Open, create, modify, save "docx" files, ·         Convert docx into PDF, into HTML to send emails, ·         Manage the images and tables, ·         Save the documents in HFSQL databases, ·         Use a spelling checker, ·         Perform prints, ... Several keyboard shortcuts are also available: Shortcut Effect Shortcut Effect CTRL A Selects the entire text. CTRL C Copies the selection into the clipboard. CTRL F Starts the search. CTRL G Switches the selection to bold CT...