Array Functions

The dynamic array is the corner stone of the BASIC+ language. Simple array manipulation is elegantly and efficiently handled by the OpenInsight engine. However, there are a few tasks that become inefficient due to complexity or limits of the interpreted language. SRP Utilities offloads much of this to the SRPUtilty.dll for easy, fast processing.

There are several array manipulation functions at your disposal. The SRP_Clean_Array function quickly removes blanks and duplicates from your array, and SRP_Join_Arrays builds a new array that is a logical combination of two arrays. Need to prepare a two-dimensional array for use with V119? Use SRP_Reorder_Array to rearrange your columns, then use SRP_Rotate_Array to turn an ARRAY into an LIST. Both functions perform at incredible speeds not possible in the BASIC+ function. Better yet, forget using V119 and use SRP_Sort_Array instead. Doing so will eliminate the need to prepare your data altogether. And it's fast!

For those looking for even more performance, check out our alternative arrays: SRP Fast Arrays and SRP Lists.

System Functions

These days, most applications need to interact with the Windows registry. SRP_Registry makes it all very easy. This single function offers a handful of services, like the Utility function in OpenInsight. The EXISTS service determines if a key or value exists. The LISTVALUES and LISTKEYS services enumerate registry entries. You can read from the registry using the READ and READDEF services and write to the registry using the WRITE service. Lastly, you can delete from the registry using the DELETE service. You get easy to use and easy to read error checking to boot.

Controlling how your windows appear is another important facet of application development. SRP Utilities makes window management and control easier with a few additional functions. The SRP_Set_MinMaxInfo function allows you to constrain a window's size and location, while the SRP_Show_Window function lets you display windows taking into account differences in user themes. Use the SRP_Set_SysColorChange function to ensure your windows and controls update their colors when the user changes the system's colors.

Need to run an external command or executable without seeing the ugly DOS window? Use the SRP_Run_Command to run external commands and reroute the output to BASIC+ or an OpenInsight edit box. Or use it simply to avoid seeing that ugly DOS window. No matter how you use it, your application looks good. Did we mention how ugly that DOS window is?

Sometimes, you may find yourself needing to copy data into a WinAPI structure for which you only have a pointer. The SRP_Copy_Memory method solves the problem by letting you perform direct byte-for-byte copies from BASIC+ variables to WinAPI pointers. Use with caution.

While there are screenshot capabilities built into windows, and even some great third party products, they usually involve several steps. With SRP_Save_Screenshot, you can programmatically take a screenshot, save it to a bitmap file, and use it as you wish. For example, you could allow the use, with a single click, to print the screenshot of a window directly to a printer using OIPI.

The windows taskbar is usually off limits to programmers, but there are times when we want to access it's behavior in order to provide feedback to the user. With the SRP_Taskbar method, you can do just that. For example, you can change the text that appears when the taskbar groups your application into a single button.

Network communication is vital in today's application, and sometimes we need to talk to a remote service in a low-level way. SRP_TcpClient makes it simple to connect to a remote TCP/IP socket and send it data. It also simplifies communication with the SRP Engine Service.

If you use Win32 API calls a lot, then you have certainly encountered the frustration of one such call returning data that OI was not able to convert from it's internal Win32 type into OI. We've got you covered with SRP_Win32_To_OI and SRP_OI_To_Win32.

Need to know if the user has been away from the computer for a while? Use SRP_Get_IdleTime to determine the amount of time the user has not touched their mouse or keyboard. Useful if you need release resources that are tied up due to end user neglect.

OI programmers deal with dates and times a lot. SRP_Date, SRP_Time, and SRP_DateTime provide a host of useful services to help you manipulate dates and types with ease.

Cryptography Functions

The SRP Utilities library includes cryptography support. Generating check sums for verification and digital signatures can be achieved using the SRP_Hash function. Need to encode binary data in a format suitable for transfer or printing? Use the SRP_Encode and SRP_Decode functions. All cryptography functions are flexible, fast and secure.

Math Function

If you need to break beyond the 32-bit barrier when performing math on decimal numbers with more than 16 digits, turn to the SRP_Math function. It provides over 40 operations that and can handle any number of decimal places.

XML Function

XML has become quite ubiquitous in the programming world, which is usually good news for OpenInsight developers. After all, multivalue data maps naturally to XML structures and the string processing power of BASIC+ makes it easy to generate XML data on the fly. However, pulling XML data out in a meaningful way usually requires tedious work that could be easily avoided using modern conventions. SRP_Extract_Xml uses the XPath query language to extract data from an XML file using one line of code.

COM Function

COM functionality was built into OpenInsight in 7.2, but the developers at SRP have encountered the need to access COM objects for clients unwilling to move out of older versions of OI. SRP_Com works in any version of OpenInsight. We've tried to make it streamlined and easy to use, so you may even consider using it in newer versions of OpenInsight as well.

  • No labels