News and Updates for Synergy/DE Developers
SYNERGY-E-NEWS
News and Updates for Synergy/DE Developers

February 11, 2011

Synergy .NET New Language Feature: Delegates
By James Sahaj, Sr. Systems Software Engineer, Synergy/DE

When Synergy .NET was released last November (with Synergy/DE 9.5), it introduced a number of new language features that are not present in traditional Synergy. One construct that is often used behind the scenes is delegates. Delegates allow you to pass methods, support callbacks, and support events in a type-safe manner.

 
Where in the World is Synergy/DE Now?
Supplying the foodservice industry with fine refrigerated food products

It all started during the height of the depression, when Dr. G. Frederick Smith and his brothers Allyne H. Smith and Clarence Smith brought aerosol whipped cream to market for the first time. Dr. Smith and his brother Allyne devised a system to take dairy cream; process, package, and pressurize it in returnable containers to produce Instantwhip whipped cream for use in restaurants, ice cream shops and soda fountains nationwide. The Smiths' returnable container and filling system made a process invented and patented by Dr. Charles A Goetz for whipping cream under pressure both economical and commercially viable.

Click to read the rest of the article

 

CTO Blog
Mapped drives and Synergy

Some recent posts on our synergy-l listserv made me realize there are still some misperceptions about Microsoft network shares (mapped drives), so I thought I would address those here.

 

Quiz
Synergy/DE pros, see if you can answer this question!

The S_BLD routine is unusual among Synergy routines in that it takes an unspecified number of arguments of various types. How can you wrap S_BLD with your own routine that takes the same arguments and passes them to S_BLD?

SPC 2011

Chicago, US :: May 24-26 | Oxford, UK :: June 14-16

SPC 2011: Realize your potential

 

Synergy/DE Tech Tip
"Routine not found in ELB" error on 64-bit system when routine is really there

Question:

I am on a 64-bit system and have both 64-bit and 32-bit Synergy installed. I've created a method, entered it into the MDU, and verified that all the information is correct, but after running genxml and gencs, when I tried to use the resulting DLL, I get the following error:

Exception was unhandled

Routine not found in ELB. Error occurred during lookup of external routine.

Routine name: myroutinename ELB name: myelbname XFPL Error:2012

I've checked, and the routine IS in the ELB and IS correctly entered in the MDU, but I'm still getting this error. What's wrong?

Click to find out the answer to this Tech Tip

 

Platform News
Read a selection of recent articles from around the web

 
Synergy .NET New Language Feature: Delegates
By James Sahaj, Sr. Systems Software Engineer, Synergy/DE

When Synergy .NET was released last November (with Synergy/DE 9.5), it introduced a number of new language features that are not present in traditional Synergy. One construct that is often used behind the scenes is delegates. Delegates allow you to pass methods, support callbacks, and support events in a type-safe manner.

A delegate defines a true .NET type that represents a functional declaration contract. It is similar to the C++ function pointers in that it indicates that a routine can be passed where a delegate type is declared. A delegate type declaration is similar to the prototype of a method declaration, as shown below:

delegate deleg1, void
    parm1, int
enddelegate

A delegate declaration includes its name, its return type, and zero or more parameter declarations. Note that a delegate has no procedure division.

It is possible to declare fields, parameters, return types, or anything that has a type as a delegate type. The dblnet compiler enforces the rule that only items of that delegate type or a routine with a matching signature may be assigned to that field or parameter; otherwise, a TYPMISMCH error is reported. In the example below, a field is declared as a delegate type, and then method meth1, which has the same signature as deleg1, is assigned to the field.

public static method meth1, void
    parm1, int
proc
end

main
record
        fld1, @deleg1
proc
    fld1 = meth1

In addition to assigning a field or parameter to a delegate, you can also execute a field or parameter of a delegate type. To do this, use the identifier of the field or parameter as a routine name and pass in the arguments required by the delegate. For example (using the code snippet above),

fld1(7)

would cause meth1, which was assigned to the field, to be executed with the number 7 passed as its argument value.

Using delegates enables you to take advantage of callback methods in your application design. Perhaps the most frequent use of delegates comes from their behind-the-scenes support of events, which are used throughout Windows Forms. Think of an event as a collection of delegates. When a method is added or removed from an event, the method is being added or removed from this delegate collection. When an event is raised, all delegates currently in that collection get executed. Events will be explored in more depth in a future article.

Delegates are a powerful new way of passing methods in .NET in a completely type-safe manner. We highly recommend that you try them out to see their benefits first-hand. To get you started, here’s the code in its entirety:

namespace ns1
public delegate deleg1, void
        parm1, int
enddelegate
class class1 
public static method meth1, void
    parm1, int
proc
        console.writeline(parm1)
end
endclass
endnamespace

main
record
    fld1, @deleg1
proc
    fld1 = ns1.class1.meth1
    fld1(7)
end

For more information about Synergy/DE 9.5, see our website.




Where in the World is Synergy/DE Now?
Supplying the foodservice industry with fine dairy and non-dairy refrigerated food products.

Supplying the foodservice industry with fine dairy and non-dairy refrigerated food products.

It all started during the height of the depression, when Dr. G. Frederick Smith and his brothers Allyne H. Smith and Clarence Smith brought aerosol whipped cream to market for the first time. Dr. Smith and his brother Allyne devised a system to take dairy cream; process, package, and pressurize it in returnable containers to produce Instantwhip whipped cream for use in restaurants, ice cream shops and soda fountains nationwide. The Smiths’ returnable container and filling system made a process invented and patented by Professor Dr. Charles A Goetz for whipping cream under pressure both economical and commercially viable.

Since 1933, distributors of Instantwhip Foods have grown to become international manufacturers and distributors of fine dairy and non-dairy refrigerated food products to the foodservice and bakery industry.

Instantwhip Foods' Synergy/DE-based manufacturing applications run all aspects of their business, from inventory to billing and distribution to payroll. For more information about Instantwhip, visit their Web site at http://www.instantwhip.com.




Synergy/DE Tech Tip
"Routine not found in ELB" error on 64-bit system when routine is really there

Question:

I am on a 64-bit system and have both 64- and 32-bit Synergy installed. I've created a method, entered it into the MDU, and verified that all the information is correct, but after running genxml and gencs, when I tried to use the resulting DLL, I get the following error:

Exception was unhandled

Routine not found in ELB. Error occurred during lookup of external routine.

Routine name: myroutinename ELB name: myelbname XFPL Error:2012

I've checked, and the routine IS in the ELB and IS correctly entered in the MDU, but I'm still getting this error. What's wrong?

Answer:

This may be caused by a 64-bit runtime trying to read a 32-bit ELB.
Verify the following :

  • You are running genxml and gencs in the correct environment (32- or 64-bit). Remember, if you are launching a command prompt from Workbench, that will be a 32-bit environment.
  • Your xfServerPlus service has DBLDIR pointed to the 32-bit version of Synergy.

In Synergy/DE 9.5 we improved xfServerPlus error reporting for problems with ELBs. For this case, xfServerPlus now reports an "ELB file built with opposite bit size" error.




Quiz
Synergy/DE pros, see if you can answer this question!

The S_BLD routine is unusual among Synergy routines in that it takes an unspecified number of arguments of various types. How can you wrap S_BLD with your own routine that takes the same arguments and passes them to S_BLD?

a.  You can't.
b.  Use an ArrayList for the arguments.
c.  Use the Synergy Routine Call Block API.
d.  Use ^VARARGARRAY.




SPC 2011
SPC 2011: Realize your potential

SPC 2011

Mark Your Calendars for SPC 2011
Chicago, US :: May 24-26 | Oxford, UK :: June 14-16

The Synergex Partner Conference (SPC) is your opportunity to learn about the latest important features in Synergy/DE and how you can take full advantage of them to make your applications more powerful and your developers more productive. Through a combination of informative technical sessions, comprehensive hands-on workshops, and valuable networking opportunities, you’ll discover what’s possible with today’s Synergy/DE and how incredibly far you can take your Synergy application — and your business along with it. Realize your potential at SPC 2011.

Mark your calendars:

Add SPC Chicago 2011 to my calendar*
*when the dialog box appears, click Open to add the event to your calendar

Add SPC Oxford 2011 to my calendar*
*when the dialog box appears, click Open to add the event to your calendar

Stay tuned to Synergy-e-News for more details about the conference, including registration information.