Phone800.366.3472 SupportGet Support DocumentationDocumentation Resource CenterResource Center
search
close
Open Menu

Synergex Blog


Enhanced CodeGen CreateFile utility

By Steve Ives, Posted on August 26, 2019 at 9:58 pm

Steve Ives

For some time CodeGen has shipped with a utility called CreateFile that (given an appropriately configured repository) could be used to create an ISAM file based on a repository FILE or STRUCTURE definition.

A customer recently asked me to create a mechanism that they could use to create multiple files, load data into those files, and also support creating both RELATIVE and ISAM files. Rather than writing something completely new I decided to extend the CreateFile utility, and that new feature has now been released along with the latest version of CodeGen (5.4.2).

Briefly, there is a new command line option -in that allows you to specify an input file containing the details of one or more files to be created and and populated. The file uses a JSON format. If you’re interested in finding out more you can find additional information in the CodeGen documentation.


New string features coming with Synergy/DE 11

By Jerry Fawcett, Posted on August 19, 2019 at 8:58 am

Avatar

Synergy/DE 11 is bringing many new features, and among those additions are some exciting new abilities within the String class. All of these powerful new features are available in both traditional and Synergy .NET.

When dealing with strings, keep in mind that a string is immutable (fancy word for unchangeable), so any time a string variable is changed, a new string variable is created.

First, let me list the new methods added, along with existing methods that include new overloads to the String class: 

String.IsNullorEmpty(@string) , boolean
  • Parameter: String to interrogate for null or empty value
  • Return value: Boolean value indicating whether the string is null or empty
String.IsNullorWhitespace(@string) , boolean
  • Parameter: String to interrogate for null or white-space characters
  • Return value: Boolean value indicating whether the string contains null or white-space characters

New overloads to give precise control on how a string is trimmed:

String.Trim() ,string			(exists prior to version 11)
  • Parameter: None
  • Return value: String with leading and trailing white-space characters removed
String.Trim(@string) ,string 
  • Parameter: Character(s) to be removed from the string’s beginning and end
  • Return value: Returned string with passed-in character(s) removed from the beginning and end
String.TrimStart(@string) ,string
String.TrimEnd(@string) ,string
  • Parameter: Character(s) to remove from either the string’s start or end
  • Return value: String with all instances of character(s) removed from start or end

New methods to control how characters are removed or inserted into a string:

String.Remove(N) ,string
  • Parameter: Starting position in the string to remove all characters until its end
  • Return value: String with all characters from passed starting position to end removed
String.Remove(N) ,string
  • Parameter: Starting position in the string to remove all characters until its end
  • Return value: String with all characters from passed starting position to end removed
String.Insert(N, @string) ,string
  • Parameters:
    1. Starting position to insert string passed as parameter 2
    2. String to be inserted
  • Return value: Returned string with sting passed in parameter 2 inserted

New overloads to give more control on concatenating strings together:

String.Concat(@string, @string) ,string	(exists prior to version 11)
String.Concat(@string, @string, @string) ,string
String.Concat(@string, @string, @string, @string) ,string
String.Concat([#]@string) ,string
  • Parameters:
    1. Two strings to concatenate together
    2. Three strings to concatenate together
    3. Four strings to concatenate together
    4. Dynamic string array to concatenate all elements together
  • Return value: Returned string after concatenation operation

New overloads to locate the position of a substring in a string:

String.IndexOf(A1) ,int			(exists prior to version 11)
String.IndexOf(A1, N) ,int
String.IndexOf(A1, N, N) ,int		(exists prior to version 11)
  • Parameters:
    1. Character(s) to find in string
    2. Character(s) to find in string starting at position specified in parameter 2
    3. Character(s) to find in string starting at position specified in parameter 2 for the length of parameter 3
  • Return value: Integer value with first position of passed character(s)

New overloads to find the last occurrence of a substring in a string:

String.LastIndexOf(A1) ,int		(exists prior to version 11)
String.LastIndexOf(A1,N) ,int
String.LastIndexOf(A1,N,N) ,int		(exists prior to version 11)

Parameters:

  • Parameters
    1. Numeric value of the starting position to begin returning the substring
    2. Numeric value of the length of the substring to return
  • Return value: Returned substring with value from the specified starting and length values

New methods to create an array from a delimited string:

String.Split(A1) ,[#]string
String.Split(A1, StringSplitOptions) ,[#]string (see below for the StringSplitOptions enumeration)
  • Parameters:
    1. Character(s) to use a delimiter
    2. Enumeration StringSplitOptions to control if empty elements are created
    3. Return value: Dynamic string array to be populated with the contents of the passed string

New overload to use the replace method on alphas:

String.Replace(A, A) ,string
  • Parameters:
    1. Alpha value to be replaced by parameter 2
    2. Alpha value to replace all occurrences of parameter 1 in string
  • Return value: Returned string with all occurrences of parameter 1 replaced by parameter 2
String.Replace(@string, @string) ,string 	(exists prior to version 11)
  • Parameters
    1. String value to be replaced by parameter 2
    2. String value to replace all occurrences of parameter 1 in string
  • Return value: Returned string with all occurrences of parameter 1 replaced by parameter 2

And finally, the enumeration StringSplitOptions, which is used with the Split method to control if empty elements are created when creating the string array:

public enum StringSplitOptions
    None		,0
    RemoveEmptyEntries	,1

You can find details on all String members in the System.String topic in the Synergy/DE documentation.

As I mentioned earlier, some of the above are brand new methods (Insert, IsNullorWhitespace, Remove, Split, TrimEnd, TrimStart) added to the System.String class, while others are new overload methods added to existing methods to provide additional functionality. Interestingly, the runtime itself will make use of the String.Concat method when strings are added together (e.g., string1 + string), as it is efficient and generates fewer temporary variables.

Now let’s take a look at one of the new methods. Using the new Split method, we can populate a dynamic array from a delimited string. Say we have a string containing the following:

mystring = “Bob, Mary, Joe, Jack,,,, Fred, Henry, Tom”

We’d like for the values between the commas to be elements in an array, but we don’t want the commas without values between them to become empty elements in the array. This can easily be accomplished with the String.Split method using the syntax below:

stringarray = mystring.split(“,” , StringSplitOptions.RemoveEmptyEntries)

Passing the quoted comma as the first parameter tells the Split method that a comma is the delimiter to look for in the string. Also, for even more control, the delimiter can consist of any number of characters.  There is no need to instantiate the dynamic array, as the dynamic array will automatically be instantiated by the Split method. The result of the above operation will be that the dynamic array stringarray will contain elements with the names that are separated by commas in the string mystring and no empty elements (due to passing StringSplitOptions.RemoveEmptyEntries as the second parameter) for the commas with no values between them:

stringarray[1] = “Bob”
stringarray[2] = “Mary”
stringarray[3] = “Joe”
stringarray[4] = “Jack”
stringarray[5] = “Fred”
stringarray[6] = “Henry”
stringarray[7] = “Tom”

As you can see, the enhancements to the String class are more than enough reason to upgrade to Synergy/DE 11 when it’s released. If you can’t wait and want to try these new capabilities now, the version 11 beta is available in the Resource Center for download. Don’t forget to set your Synergy/DE documentation to the “Beta” version in the version drop-down near the top of the screen.

And wait, there’s more! Now that you’re aware of the new and powerful methods added to the String class, be sure to also check out the new StringBuilder class added to version 11.


Are you protecting yourself and your customers from upcoming security threats?

By Roger Andrews, Posted on August 1, 2019 at 10:07 am

Avatar

Thanks to those of you who joined us last week for our security webinar. We talked about some of the big security threats we all face today, such as ransomware/malware, endpoint attacks, and phishing, and how to protect ourselves from them. Keeping current with security updates is one important step, and this includes operating systems, applications, firewalls, and other components. Also, if you’re using HTTPS or SSL communication, you may need to encrypt your data between computers and when writing to disk (as well as when transferring externally).

Security webinar, July 24, 2019

If you use Windows, make sure you have a plan to upgrade any Windows 7 or Server 2008R2 systems. Microsoft is ending support for these at the end of this year (and for some of their other products soon). This means there will be no more security patches, which will increase the likelihood that your systems will be compromised with ransomware. Also, if you’re using OpenSSL on Windows, you’ll need to upgrade to Synergy/DE 11 (scheduled for release later this year) as it supports the new OpenSSL requirements. Synergy/DE 11 has other security updates, including the ability for services to be configured to run as a user other than system/root.

Here’s an article from our last Synergy-e-News for additional security information. And our Synergy/DE 11 beta page has for more information about our upcoming release. We’ll continue to provide you with information about these security topics and others. In the meantime, please contact us if you have questions or if you would like more information.


CodeGen 5.4.0 Released

By Steve Ives, Posted on July 3, 2019 at 9:59 am

Steve Ives

It’s been a while since a GodeGen release was announced on this BLOG, but rest assured they have been coming thick and fast; in fact there have been 9 interim releases since we last announced here.

So why all the frenetic activity in CodeGen land? Well the primary driving force for so many releases and so many new features is to provide support for the ever evolving Harmony Core RESTful Web Services framework. If you’re not familiar with Harmony Core then you should check it out. More and more Synergy developers are starting to take advantage of it as a way to expose their applications data and business logic in whole new ways and to support a myriad of use cases.

So what’s new in CodeGen 5.4.0? Well the answer to that question is … a LOT! I won’t list all the new features here but if you want to check out the specifics then you can head over to the CodeGen Releases page where you’ll find a detailed change log for this and previous versions. And if you need more information than that then check out the CodeGen Documentation.

We recommend that all developers who are using CodeGen upgrade to this latest version, but particularly if you’re developing with Harmony Core.

Happy 4th Everyone!


Using the Power of PowerShell with Synergy

By Jerry Fawcett, Posted on November 30, 2018 at 1:56 pm

Avatar

Like it or not, change is inevitable. Now that you’ve mastered the command prompt, it’s slowly but surely being replaced by PowerShell. Actually, this process was started by Microsoft way back in 2002, which is how PowerShell came about in the first place.

Starting with Windows 10, the PowerShell command prompt has replaced the Command Prompt as the default. (To control this, toggle the Taskbar setting “Replace Command Prompt with Windows PowerShell in the menu when I right-click the start button or press Widows Key+X.”)

Comparing Command Prompt and Windows PowerShell

PowerShell Up

So you opened a PowerShell window and now everything you try results in copious output in ominous red text? Luckily for those of us who are learning PowerShell from the ground up, PowerShell comes with very complete and verbose help. Just type

get-help cmdlet

For example, you’d use “get-help where” to learn about the powerful where object. However, if you’re familiar with any OO language you’ll probably find PowerShell quite natural.

One would think PowerShell is a Windows-only tool, but surprisingly, Microsoft has made it open source, and it’s also available on macOS, CentOS, and Ubuntu.

You can use PowerShell together with Synergy in many ways, and I’d like to share some of what I’ve learned. Using the power (pun intended) of PowerShell can be helpful in getting information on Synergy products from a machine. Getting this information without PowerShell would be difficult—especially for a non-technical person—and potentially error prone.

By preceding a PowerShell command with “powershell” you can actually run it from a DOS command line without opening a PowerShell console, as the command is passed to the PowerShell processor as a parameter. However, by doing this, you’ll lose the awesome power of tab completion available in the PowerShell console. Try it: Open a DOS command window and type “powershell /?”.

A demo of get-help cmdlet

The PowerShell is Yours!

(At this point, I feel I must tell you that Synergy tools are currently not supported in a PowerShell environment. Ideas post, anyone?)
To list all Synergy products:

Get-WmiObject -ComputerName COMPUTERNAME -Class Win32_Product | sort-object Name | Select-Object Name |where{$_.name -like "*Synergy*"}
Output –
Name
----
Synergy DBL Integration for Visual Studio 10.3.3f
Synergy/DE (X64) 10.3.3f
Synergy/DE 10.3.3f
Synergy/DE Online Manuals 10.3.3
Synergy/DE xfNetLink .NET Edition (X64) 10.3.3f

To list all Windows updates on a machine:

(New-Object -ComObject "Microsoft.Update.Session").CreateUpdateSearcher().QueryHistory(0,(New-Object -ComObject "Microsoft.Update.Session").CreateUpdateSearcher().GetTotalHistoryCount()) | Select-Object Title, Description, Date

If you need to retrieve all events from the Windows Event viewer that deal with the runtime, simply have the end user double-click on a batch file containing the command below and send you the file it creates (C:\temp\SynEventViewerEntries.txt).

powershell Get-EventLog -logname application -source dbr^|Format-List MachineName, Message, TimeGenerated ^|out-file C:\temp\SynEventViewerEntries.txt

To list all installed software on a machine,

Get-WmiObject -ComputerName FAWCETT -Class Win32_Product|Sort-Object name| Select-Object Name, Version

Just so you’re aware, when you get started, you may find no script will successfully run, because script execution is disabled by default. You can enable it as follows:

First, to verify the PowerShell’s execution policy, type

Get-ExecutionPolicy

You’ll probably see

Default is Restricted

To enable execution, you must open the PowerShell command prompt as an Administrator and type

Set-ExecutionPolicy Unrestricted –Force

And just for fun, if— like me—you miss the Windows Experience score that was first introduced with Windows Vista but is now removed, you can use PowerShell to get your machine’s Windows Experience score. The Windows Experience score is a benchmark that measures your PC’s performance in five categories: processor, memory, graphics, gaming graphics, and hard disk performance. The score is the lowest of these benchmarks. To get your machine’s score, run

Get-WmiObject -Class Win32_WinSAT

If you want to learn more, you can search online. Every PowerShell topic I searched for resulted in a wealth of information.

More Power(Shell) to you!

Some good resources:

Microsoft Official PowerShell documentation

Getting Started with Windows PowerShell

PowerShell: The smart person’s guide


CodeGen 5.3.6 Released

By Steve Ives, Posted on September 23, 2018 at 4:43 pm

Steve Ives

Just a quick note to announce that CodeGen 5.3.6 has been released and is available for immediate use. This latest version represents the culmination of a series of recent releases which together have added significant new features across the entire product, including the ability to generate code based on metadata found in the xfServerPlus Synergy Method Catalog.

Many of the new features were added specifically to support code generation for the new Harmony Core RESTful web services framework that we are excited to be introducing at the upcoming DevPartner Conference in New Orleans next month.

If you are joining us for the post-conference Harmony Core workshop then you will need to have this new version of CodeGen installed on your development system; you can download it here. And even if you’re not intending to use the new Harmony Core framework, there are many new features that may be useful to all CodeGen users; we recommend this release for general use.

We’re looking forward to seeing you all in New Orleans between October 8th and 12th. If you haven’t signed up yet, it’s not too late! You can still sign up here.


Performance troubleshooting

By Phil Bratt, Posted on May 14, 2018 at 10:22 am

Avatar

In the 1984 movie classic Ghostbusters, we are introduced to Bill Murray’s character Dr. Peter Venkman, a professor of paranormal studies, testing subjects for the gift of clairvoyance—the ability to gain information about an object, person, location, or event through extrasensory perception. While it is clear Dr. Venkman does not take such things very seriously, we can see the advantage of such an ability, particularly for developers.

Stop me if you’ve heard this before: “We upgraded X and now Y is happening.” In this case, Y is usually associated with a negative behavior like slow performance, a slew of errors, or a bad user experience. Events like these may induce weariness, nausea, dry mouth, and other various side effects that are usually listed in American pharmaceutical commercials. In summary, they’re unpleasant. If only there were some means to predict these events and avoid them in the future…

Unfortunately, most developers are not gifted with the power of clairvoyance to anticipate problems with upgrades before they happen. But maybe instead of a crystal ball, there are tools that can help us avoid upgrade failure. Let’s look at some things that can help anticipate and/or prevent such issues from happening.

A relatively recent addition to the Synergy documentation is the Configuring for performance and resiliency topic in the Installation Configuration Guide. This topic discusses things that one should take into consideration when running Synergy on any system, and it’s based on years of experience from the Synergex Development staff and the results of their testing. If you haven’t read this section yet, I highly recommend doing so. If you’ve already read it, I recommend a quick refresher the next time you’re looking at major system or software changes.

In Support, we often see issues when developers virtualize systems that run Synergy or when data is migrated and then accessed across a network rather than being stored locally. Both scenarios are discussed in this topic. And as part of Synergy’s web-based documentation set, it’s updated regularly with the latest information. Make sure you take a look before any major upgrade in case there are changes.

Other useful tools for avoiding problems are the Synergex Blog, the Synergy migration guides, KnowledgeBase articles like Guideline for debugging performance issues, and the release notes that come with each version of Synergy. Remember that even if you are just changing the operating system and/or hardware and not your version of Synergy, you should re-review these materials. Some of the considerations they outline may now be relevant, even if they didn’t affect you previously. Also, when testing, remember to take load testing or a process running over time into account. We commonly see pitfalls  when developers neglect these two factors in testing.

Taking Action

Now let’s say that despite your excellent planning, you do see a performance issue. What can you do? Here are some steps I’ve found helpful that might get overlooked. Most have to do with simply eliminating factors that affect performance.

  • Establish a baseline

If you’re going to diagnose a problem in performance, the first thing to do is isolate code or create a piece of code that demonstrates the problem. Make this your baseline test for all of the various configurations you’re going to test. This will make your tests consistent as well as eliminate code changes as a factor.

  • Use a metric

Establish a program you’re going to use to measure the difference in performance. If you’re using a traditional Synergy program as your baseline, you can use the Synergy DBL Profiler, which will count CPU time for you. Just make sure you pick the same metric for your testing—CPU time is not the same as real time. This step will enable you to get measurable results to test what is actually making a difference.

  • One by one, test all the things

I’ve found that the easiest way to plan and visualize testing is to make a tree. Each layer is one aspect you’re testing that continues to branch with every different aspect. For example, I had a situation where a production machine migrated Synergy version, operating system, and hardware and virtualized the OS, all in one move. We picked one thing to change (the virtualization of the OS) and tested it.

VirtualizedNon-Virtualized

 

By doing this, we established that virtualization was a factor, because a virtualized environment was slower than a non-virtualized one. We then compared those to the old and new Windows versions, but continued with virtualized and non-virtualized environments using the same virtualization software.

Windows 8Windows 10
VirtualizedNon-VirtualizedVirtualizedNon-Virtualized
In previous tableIn previous table

 

On average, this produced the same result. (It was I/O processing, so we did an average of 10-20 runs based on how volatile the results could be.) Next, we compared the Synergy 10 runtime with the Synergy 9 one.

Windows 8Windows 10
VirtualizedNon-VirtualizedVirtualizedNon-Virtualized
Syn 9Syn 10Syn9Syn 10Syn 9Syn10Syn 9Syn 10
In previousIn previousIn previousIn previous

 

The tree continued growing until all of the factors were considered and tested.

Closing Thoughts

It can be tedious to test one change at a time, but without that kind of granularity, you can’t establish which change affected performance and by how much. In the example I mentioned above, we established that virtualizing the hardware was causing a problem because of the way the virtual machine software emulated separate cores. We never would have come to such a conclusion without carefully eliminating the many different changes one at a time.

After you’re able to establish exactly which changes caused the performance issue(s) and by how much, you can work on a fix or provide a solid case to whichever software support representative you need to contact to get a fix.

You might know most of this already. You might even know of some methods, tips, etc., for performance issues that I didn’t discuss. Maybe you are clairvoyant and you already knew the contents of this post before I did. Either way, I hope you find this information helpful when you look at performance in the future, in both preventative measures and problem diagnosis.


Big Code

By Richard Morris, Posted on April 13, 2018 at 7:13 am

Avatar

If you have large (and I mean LARGE) blocks of code in single source files – and by large I mean 20k lines plus – then you may be having compiler issue with “SEGBIG” errors: “Segment too big”. This issue arises because your code segment is just too big for the compiler to handle and is usually the result of many man years of development to a single routine that has just grown over time.

If you encounter SEGBIG issues, as a customer I have recently worked with did, then this quick blog will give you some practical ideas of how to manage the issue and modify the code to allow for future development and expansion, without having to rewrite the world.

First off, it’s not the physical number of lines of code in the source file that’s the issue, it’s the lines of code and data definitions within each routine block: subroutine or function. Developers have encountered the problem for many years and the resolution has previously been to chop out a section of code, make it into a subroutine or function, and somehow pass all the appropriate data to it – usually by large numbers of arguments or common/global data blocks.

The “today” way is not too dissimilar but is a little more refined: turn the code block into a class. The first major advantage is class-based data. This removes the need to create subroutines or functions that accept large numbers of arguments, or to create large common or global data blocks. As an example:

subroutine BigRoutine

endparams

.include ‘AppCommonData.inc’

record localData

localRoutineData      ,a10

endrecord

proc

call doSomeLogic

call doOtherLogic

xreturn

doSomeLogic,

return

doOtherLogic,

return

end

Obviously this code will not give us a SEGBIG issue, but its an example of the structure of the code. The routine has a common data include and private data. In the routine body we make multiple local label calls. When there is too much data and too many lines of code added we will encounter a SEGBIG error.

So to address this, in the same source file, we can create a class with class-level data (the routine level data) and methods for the local call labels. So, for example:

namespace CompanyName

public class BigRoutineClass

private record localData

localRoutineData      ,a10

endrecord

public method Execute, void

endparams

proc

doSomeLogic()

doOtherLogic()

mreturn

endmethod

method doSomeLogic, void

.include ‘AppCommonData.inc’

proc

mreturn

endmethod

method doOtherLogic, void

.include ‘AppCommonData.inc’

proc

mreturn

endmethod

endclass

endnamespace

In this code, the Execute method becomes the entry point. All the existing code that made the label calls is moved into this routine and the calls changed to method invocations;

doSomeLogic()

doOtherLogic()

Then we can change the existing BigRoutine code;

subroutine BigRoutine

endparams

record

routineInstance       ,@CompanyName.BigRoutineClass

endrecord

proc

routineInstance = new BigRoutineClass()

routineInstance.Execute()

xreturn

end

Simple!

Although the code changes I’ve described here sound monumental, if you use Visual Studio to develop your Traditional Synergy code the process is actually quite simple. Once you have created the scaffolding routine and defined the base class with class level data (which really is a case of cutting and pasting the data definition code), there are a few simple regex commands we can use that will basically do the work for us.

To change all the call references to class method invocations you can use:

Find: ([\t ]+)(call )([\w\d]+)

Replace: $1$3()

 

To change the actual labels into class methods, simply use the following regex:

Find: ^([\t ]+)([a-zA-z0-9_]+)[,]

Replace: $1endmethod\n$1method $2, void\n$1proc

 

And to change the return statements to method returns, use:

Find: \breturn

Replace: mreturn

 

These simple steps will allow you to take your large code routines and make manageable classes from them which can be extended as required.

If you have any questions or would like assistance in addressing your SEGBIG issues, please let me know.


A Winning Formula

By Richard Morris, Posted on February 15, 2018 at 3:28 am

Avatar

For a recent project I’ve worked with a customer who wished to provide their users with an engaging desktop application that would allow management of product formulations.  They had a Synergy UI Toolkit version and also elements of the required application in a third-party system. However, neither met the needs of the users.  After a review and discussions about their requirements we agreed on a Synergy .NET Windows Presentation Foundation based application using Infragistics tooling for the User Experience.

The basic requirements of the application where to allow the creation and maintenance of formulations.  A formulation contains the components required to make a finished product.  For this customer the final product is an aerosol. 

Let’s take a look

The basic interface is built using the Infragistics control to handle navigation (Ribbon menu control), listing and selection of data (powerful DataGrid), hierarchical representation of the formulation components (TreeView) and management of finished product details (Property Grid);

Of course, using the Infragistics DockManager allows the user to drag and reposition all the available windows to their liking.

There are powerful searching facilities, or QBE (Query By Example) controls.  These allow the user to provide snippets of information and the application will query the Synergy DBMS database using Symphony Harmony and the Synergex.SynergyDE.Select class;

The top line of the QBE controls allow the user to enter the data in the columns they wish to search for and so only select the data they require and not have to filter through a list of thousands of formulations.

Because the application is written in Synergy, the existing printing capabilities from the original UI Toolkit application have been retained without change;

The whole application is written in Synergy .NET and utilises the Symphony Framework for controlling the data access and presentation.  If you would like more details, or would like to know how you can build modern applications with Synergy .NET please drop me an email.


What a Cracking Idea

By Richard Morris, Posted on February 9, 2018 at 5:52 am

Avatar

The Synergex Resource Center Community site has a number of great features including the Answers and Ideas portals. Ideas is the place to post your ideas for improving Synergy and related products. You can vote for ideas and provide comment and feedback to help the whole community be more successful. The Synergex community site had an idea posted recently:

You can read the full idea at the Synergex Resource Center.

Synergy DBMS Manager

The Synergy DBMS Manager allows you to query and manage data in your Synergy data files using Symphony Data Objects.

Code generating Symphony Data Objects for your files is a simple process.  Ensure you have your Synergy Repository configured. You need to define the structure and associated file definition for each file you wish to be able to manage using the utility.  There are full instructions at the Symphony Framework page which walk you through the few simple steps to building your data object assembly in Synergy .Net.  Not sure how to build Synergy .NET assemblies – then send me your repository and I’ll do it for you!

To query data you simply issue the required select command and define the response data object;

Simple, and you can scroll through the results.  The idea posted was to be able to then export the selected data to Microsoft Excel so that further review and analysis can be performed.

A new toolbar button has been added and the GemBox Spread assembly used to easily create the Excel document.  Now you can export all the selected rows to an Excel document:

If you’d like more details, please visit the Symphony Framework page or contact me directly.

 

 

 


CodeGen 5.2.2 Released

By Steve Ives, Posted on October 25, 2017 at 3:00 pm

Steve Ives

We are delighted to announce the availability of the CodeGen version 5.2.2 release that includes the following enhancements and changes:

CodeGen Version 5.2.2 Release Notes

  • Added a new field loop expansion token <FIELD_FORMATSTRING> which can be used to access a fields format string value.
  • Added a new command-line option -utpp which instructs CodeGen to treat user-defined tokens as pre-processor tokens. This means that user-defined tokens are expanded much earlier during the initial tokenization phase, which in turn means that other expansion tokens may be embedded within the values of user-defined tokens.
  • Removed the RpsBrowser utility from the distribution; it was an experimental project that was never completed.

This version of CodeGen was built with Synergy/DE 10.3.3d and requires a minimum Synergy version of 10.1.1 in order to operate.


“D” is for Developer

By Richard Morris, Posted on September 20, 2017 at 6:55 am

Avatar

Development of your traditional Synergy code in Microsoft’s Visual Studio was introduced at the DevPartner conference back in 2016. Using an integrated development environment (IDE) like Visual Studio not only promotes better code development practices and team development but shows prospective new hires that your tooling is the latest and greatest.

The next release of Synergy—10.3.3d—includes all the capabilities now required to fully develop and build your traditional Synergy–based applications in Visual Studio. During a recent engagement I worked with a team of developers to migrate their existing Synergy Workbench development to Visual Studio with great results. Although there are a few steps to complete, the results of developing in Visual Studio more than outweigh the effort taken to get there. And if you think developing in Synergy Workbench is great and productive, just wait until you are using Visual Studio—there will be no turning back! Here are the high-level steps you can take to get your traditional Synergy development to Visual Studio.

First place to start is the Synergy Repository. We all have (or should have) one. Synergy now provides a Repository project that will allow you to build your repository files from one or multiple schema files. If you have multiple schema files you can use the new pre-build capability to run your existing command scripts to create the single, ordered schema file or load the repository your way—simple. So why have the Repository project? Because you can load all your individual schema files into it, and if any change, your repository will be rebuilt automatically.

Next create your library projects. These are either executable (recommended) or object libraries. Ensure you reference the Repository project using “Add Reference…”. You no longer define the Repository environment variables “RPSMFIL” and “RPSTFIL”. This step ensures that if your Repository project is rebuilt, any projects referencing it will be as well. Next add the source files for the routines that make up your library, and build. You may have a few build issues to resolve—the 10.3.3d compiler is a little stricter, and unresolved references will need to be resolved. Any environment variables required to build your software should be set in the project common properties page or if they are library specific in the project environment page.

Finally, your main line programs. Create the required project with single or multiple main line programs. The multiple main line project allows you to have all the programs in one place, and you can easily specify the program to run.

Now you can build and run your traditional Synergy code from Visual studio—and even better, you can debug through the code using the powerful Visual Studio debugger.

Using UI Toolkit? Keep a look out for a future blog post showing how to easily incorporate window script file builds into your development process.

Building for UNIX? Not a problem. A future post will show the simple steps to target the UNIX platform from within Visual Studio.

We are here to help! Synergex can help with every aspect of getting your traditional Synergy development environment inside Visual Studio. Just ask your account manager or contact me directly.


CodeGen 5.2.1 Released

By Steve Ives, Posted on August 24, 2017 at 2:10 pm

Steve Ives

We are pleased to announce the release of CodeGen 5.2.1 which includes several new features that significantly extend the possibilities for what can be generated. The core goal for this release was to introduce new features that make it possible to sub-divide the processing of large loops into smaller units of code, and by doing so make it possible to achieve new things, especially when working with very large structures.

For example, the reference code that demonstrates how to implement the replication of ISAM data to a relational database (https://github.com/SteveIves/SqlReplicationIoHooks) previously had a restriction that it could only deal with files (tables) with up to 252 fields (columns). The underlying reason for this related to the maximum number of arguments that can be passed to an external routine, %SSC_BIND in this case. The restriction of 252 available data parameters to %SSC_BIND meant that bad code would be produced for any structure with more than that number of fields. Now however, using some of the new features in CodeGen 5.2.1, the template has been re-structured so that %SSC_BIND will be called multiple times if necessary, removing the previous restriction.

But that’s just one example, there are doubtless many more. Here are the release notes for the new version:

  • We added several a new generic expression token <IF COUNTER_n_op_value> that allows you to write conditional template code based on testing the current value of the two internal template counters against a simple numeric expression. Here is an example of using this new expression:
<IF CODEGEN_COUNTER_1_EQ_10>
Code to include for every 10th item
</IF>
<IF TOTAL_ITEMS_LT_50>
Code for a small number of items.
<ELSE>
Code for a larger number of items.
</IF>
<REQUIRES_CODEGEN_VERSION>5.2.1</REQUIRES_CODEGEN_VERSION>
  • We made a minor correction to the documentation of the -f l command line option. The documentation previously stated that this option caused fields marked as “Excluded by Language” to be EXCLUDED from field loop processing, but actually such fields are excluded by default. The -f l command line option actually suppresses this behavior, causing such fields to be INCLUDED in field loop processing.
  • This version of CodeGen was built with Synergy/DE 10.3.3c and requires a minimum Synergy run-time version of 10.1.1.

The latest version of CodeGen can always be downloaded here.


Developing in Visual Studio

By Steve Ives, Posted on June 30, 2017 at 7:56 pm

Steve Ives

Most Synergy developers would love to use the very latest and greatest development tools to develop and maintain their Synergy applications, but how do you get started? At the recent DevPartner conference in Atlanta product manager Marty Lewis not only discussed the concepts of how to get started, but actually demonstrated the entire process with a real Synergy application. Check out his presentation entitled Developing Synergy Code in Visual Studio:

By the way, this video is just one of many from the 2017 DevPartner Conference.


How “easy” can easy be – Google it!

By Richard Morris, Posted on May 24, 2017 at 4:45 am

Avatar

The post conference workshop developed from the ground up a vinyl record collection catalogue system that allowed the management of your favourite records. The workshop stepped through the various aspects of the system including a desktop WPF maintenance program and remote management of your cloud based catalogue using the Synergy DBMS manager.

Having all your vinyl discs catalogued is great – but when I’m in the record shop browsing through all the latest available titles I often wonder – have I got this one? I’ve got a lot of vinyl’s and many more CD’s so remembering all the one’s I have can be difficult, and there is nothing worse than buying a duplicate.

So our OnVinyl app we built at the conference allows us to scan the barcode of the album in the store and check it against our catalogue – if we have it then the details are displayed and we don’t go and buy it again.

Getting all the album information into our catalogue would have been a long and rather boring job – especially having to trawl the web looking for the artwork to associate with each album we have. We need an easier solution – and so to Google we turn.

We all know how good Google is at searching for basically anything you can think of really, but did you know you can use this powerful searching capability from within your Synergy programs? Google provide a search API that allows you to simply and very easily perform any search you require. This is the facility we added into our OnVinyl Album Maintenance program – enter (or scan if you have a barcode scanner to hand) the barcode on the album and pass this through to the Google search API. Our implementation retrieved the album name, artist, cost and artwork so we are able to populate all the fields in the maintenance form – without any typing!

The Google search API provides a REST API that you can call directly from within your Synergy program. For full details visit https://developers.google.com/custom-search/json-api/v1/using_rest. To use the API you need a Google account. The first step is to create an “API key” which allows you access to various Google API’s and identifies you to those API’s. Visit the Google API Manager console to create an API Key. Once you have an API key then you can set up a custom “search engine” that allow you to customize how your searching is performed. You can limit the results to certain web sites for example. This is all configured using the Google control panel (https://cse.google.com/all). To begin you create a new “search engine” and name it. Once created it will be assigned a unique search engine ID – you’ll need this!

In your Synergy code define some constants;

The API is a REST implementation that has a defined URI;

And then make the required REST call to retrieve the search results;

And that’s the call to your custom search engine complete. The response from Google will be in the form of a JSON string which you need to parse and out and extract the individual elements you require. The code for that is available in the OnVinyl project.

And the results in your application;

Easy really is easy with Synergy and Google searching!

On a side note – I’ve been wondering where Jodah had got to, and then this appeared in my inbox;

I’m sure I recognise those eyes…. Have you seen or got a picture of Jodah’s identifying name tag?

 

 

 


Don't miss a post!

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Recent Posts Categories Tag Cloud Archives