Clarion - Windows 7 - Alt-Key fix

by marc walgren3. December 2013 05:19

Marius van den Berg built a template to solve the Alt-key lockup problem in Clarion apps on Windows 7. Here is the notes from the legacy template.

Fixes the bug where the alt button hangs an application

If a window is open in an application in windows 7, the app will freeze up if the user presses alt to access the file menu 

The problem occurs if the ALt/F10 was only pressed without any hot keys. So basically all the template does is, if only ALT was pressed when any windows in the app are open I capture the KeyCode - event and do nothing

If no windows are open however, the app will call the menupress manually. 

 

Note: Notes indicate this problem is solved in Clarion 7.1 but recheck at that point

 

I adapted the code into a legacy extension template and have attached it to this post.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Win7AltKeyLegacy.zip (910.00 bytes)

Tags:

Web Application - iPad development resources

by marc walgren23. April 2013 05:16

We recently developed  a couple of warehouse support applications for a client. Not only was the application used in a regular desktop browser, but the warehouse personnel also accessed the application on an iPad out in the warehouse. The iPads were mounted on forklifts and connect to the internal network.

Several key resources we used include this article from the Safari Developers library:

https://developer.apple.com/library/safari/#technotes/tn2010/tn2262/index.html

We also tried these iPad simulators:

http://ipadpeek.com/

http://ipad-emulator.org/

We successfully overcame the challenge to balance the size of the controls and positioning on both browsing platforms.

Tags:

.NET | Development | General

Save Hundreds of Dollars Each Year On Phone Costs

by jim morgan26. March 2013 09:52

BTW. I have no financial interest in this advise....Smile

Get rid of your expensive land line and long distance charges. If you spend $30 on a phone line, $10 on taxes and $20 on long distance each month, you can save $720 a year by adding one $50 box to your Internet connection with no monthly charges.  Here's how...

  • Buy an OBi110 Voice Service Bridge and VoIP Telephone Adapter for a single line ($50), or OBI 220 for a doule line or advanced fax support ($72).  Readily available on Amazon. This converts the IP phone traffic to a conventional analog phone system. Hook it up to a power source, your Internet and your phone line.
  • Setup a Google Voice Account. Google voice is free and has many nice features:
    • It calls your OBI (it looks like a chat account from the Web Browser).
    • It will forward to multiple phones.
    • It has voice mail.
    • It will text you when you have a new message.
    • It has free unlimited calling in the U.S. and Canada. International rates are cheap.
    • And much more like call screening, do not disturb.
  • Optional, port your old land line number to Google Voice. Note: you can port cellular number to Google Voice, not Land Lines. You must first port your land line to a cellular line. You can do this with a $0.99 prepaid celluar Simm card and an old TMobile or AT&T phone. As soon as the number as ported to the cell phone, you flip it to Google Voice. Google Voice charges $20 to port.

For more information see http://www.obihai.com/porttutorial.html

  • Link your OBI with your Google Voice Account. This takes 10-15 minutes the first time to get it right. A pro can do it in under five minutes. It involves calling out on a special number with your phone and to getyour OBI Box ID, registering on the OBI network and associating it with your Google Voice Account.

 http://www.obihai.com/googlevoice.html

  • Enjoy free inbound and outbound calling over your Internet connection.

Sept 26, 2014 Update...Google has changed their earlier position on Google Voice. Google Voice is now Officially Supported on OBi VoIP devices.
I've used it for two years and had almost no problem. I keep my OBI and Internet modem on a UPS so the phone works if the power goes out. The call quality is almost always as good as a land line and better than almost any cellular call. I've had occasional busy signals or poor quality, but it's rare and a redial almost always fixes the problem. The biggest negative is that you lose your Caller ID Name, only the Caller ID Phone number on outgoing calls. This can be fixed if you sign up with one on the low-cost providers like Anveo that also provide 911 calling. You get Caller ID Name on incoming calls regardless. I've  connected a security system and fax and they always take or make the call.

Here's some useful links.

Note that you will not be able to 911 emergency calling without a service. Here's an inexpensive 911 service - about $10 per year. http://www.bulk911.com/

OBI tutorials. http://blog.obihai.com/2011/11/calling-911-with-obi-devices.html     http://www.obihai.com/tutorial1.html

Google Voice is now Officially Supported on OBi VoIP devices.
http://blog.obihai.com/2014/09/google-voice-and-obihai-update.html


Obihai is excited to announce official support for Google Voice. With a Google Voice account and a companion OBi device you can make and receive VoIP calls on a regular telephone. To get started, just login to the OBiTALK website, add your OBi device and select Google Voice as your service. You’ll then confirm your account with Google, and within minutes, you will be making and receiving calls from the comfort and convenience of your home phone. “With a Google Voice account configured on an OBi device, users will not only get all the great collaboration tools and app integration with Google Voice, they will also be able to enjoy many premium calling features, free calling within the U.S. and Canada and super-low cost international calling – all from the comfort of their home phone," said Jan Fandrianto, President and CEO of Obihai.

Ring Multiple OBi Devices Configured with a Single Google Voice Account
http://blog.obihai.com/

 

Tags:

General

Use equates to fill a Clarion Drop List Control

by marc walgren26. March 2013 05:08

Drop Lists work well with a short list of choices, say 3-10. In the Clarion dictionary offers "Must be in List" on the validation tab. There are two parts to the list "Choices" and "Values". The list elements are entered and must be separated by the Pipe character (|).

The approach I favor is to use equates to build the choices/value lists and reference the equate from the particular control. Updating an equate does not require a full application rebuild (handy when developing a multi-dll app) and adding another value is really quick and easy.

Ok. A trival example. We have a system with a User table and each has a Type. (I these standards for the equates

! Equate Prefix: e_   "Equate"  -- Usually For Displaying
! Equate Prefix: v_   "Value"   -- Usually For "Value" stored In DB, like 1,2,3,ENG,SPA
! Equate Prefix: d_   "Default" -- Usually Default "Value"
! Equate Prefix: l_   "List"    -- Usually for Dropdown List

We define four user types and their associated values: (Notice the values are equated strings)

e_UserType_Standard    Equate('Standard')

v_UserType_Standard    Equate('1')

e_UserType_Manager     Equate('Manager')

v_UserType_Manager     Equate('2')

e_UserType_Admin     Equate('Admin')

v_UserType_Admin     Equate('3')

 

Let's equate the separator characters too.

e_bar             Equate('|')

e_hash            Equate('#')

e_BarHash         Equate(e_bar & e_hash)

Now build the equate for the drop list

l_UserType_opts     Equate(e_UserType_Standard & e_BarHash & v_UserType_Standard & e_Bar & |

                                        e_UserType_Manager & e_BarHash & v_UserType_Manager & e_Bar & |

                                        e_UserType_Admin & e_BarHash & v_UserType_Admin)

 

Reference the list equate in the From property of the list control.

LIST,AT(254,40,99,11),USE(Usr:UserType),DROP(10),FROM(l_UserType_opts)

 

Works really well.

 

Additions to the list are trivial. Add a couple equates and update the list equate and recompile.

Tags:

Clarion | Development

Document Template Usage in Applications - Free to Use

by jim morgan1. March 2013 13:15

Is Clarion running slow because of the number of template that you have installed?

Is your Clarion TRF excessively large, over 5MB?

Do you know what templates are actually used in your application?

Template Finder goes through your applications and develops a list of template chains actually used in a set of applications. Use the results to reconstruct your template registry to optimize Clarion performance. Build a document that shows the templates used by procedure and application.

Two basic modes.

- Unique Templates (sorted by template chain / name)

- Unique Template chains

Click this Link for more information. 

Tags:

Clarion

Alternate for nbsp; when loading an xml file into a C# Xml Document

by marc walgren25. February 2013 07:41

I created an XML file to use as a template for building a page response for ASP.NET app we use internally. One of the requirements was to have an empty table cell  ("<td></td>"). The wrench in the works was the cell need to be underlined. As I modified the XML to include a "&nbsp;", visual studio displayed and error - "Entity nbsp not defined".

The first alternate I replace the "&nbsp;" with "&#160;" - the corresponding numeric value. Visual studio was happy but when I viewed the page response built with my template I discovered "Â " displayed.

To solve the "wrong" character display I need to force the character set as well. I had to add a meta tag into the head section of my XML

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

 

That did the trick for me.

 

Tags: , ,

.NET

Customize the Windows Remote Desktop Port

by marc walgren12. February 2013 05:30

Remote Desktop connectivity is a powerful and vital part of application development. Whether connecting to your servers in the office, or to a build machine at a client's office across the country, the ability to connect to "your" machine from anywhere creates effeciency.

There is a hurdle to clear when trying to connect to your office machine from outside the firewall. Particularly if you have multiple people needing to connect to their own machine. How can the firewall know which machine is the target of the connection?

The solution is to use a custom port and to have your firewall redirect each port instead of using the default port (3389) for Windows Remote Desktop.

Here is how to do it:

1) Select a conventional port range like 33000. Include the workstations IP address to produce the custom port number. For workstation address 10.1.1.15 use port 33015. Or for 10.1.1.225, use Port 33225.

2) Override the RDP Port setting in the Windows registry.

\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

Edit PortNumber entry 

Click ok to save the change. Exit the registry editor. A reboot is required for the port change to take effect.

3) Change your firewall settings. Most firewalls will need two changes, a service addition to "open" the port and rule addition to redirect the external port traffic to the internal workstation.

Define the port service (SonicWall example). 

 

Define the redirection (SonicWall Example)

 

 

Save the configuration.

 

4) Connecting to your workstation. Add an explicit port to the Remote Desktop connection properties and connect to the workstation.

 

 

 

To wrap up, follow this procedure for each workstations that needs remote access. Remember to use a unique port so the firewall redirects the traffic to the proper machine.

 

Tags:

Paging through a SQL result set

by jim morgan26. January 2013 14:38

For an application to browse a large dataset, you need to set a limit to the number of rows returned. As users page up and down through the results, the application needs to return the next block of results. This can be done with a Select with a Subquery. The Subquery have virtually no performance penalties over a straight query. The advantage is that you can use the TOP function to get the next block in the subquery, but return the results in a different order.

The key concepts here are:

1. Save the identifiers to the first and last row of the block for pagination.

2. To get the last or previous block, toggle the ASC/DESC on each element of the original order by.

3. To get the previous block, toggle the booleans <> in the Where Clause.

Examples of 30 row page blocks sorted by LastName, FirstName and SysID (to force uniqueness)

Last Page

SELECT * FROM (
    SELECT TOP (30) LastName, FirstName, SysID
    FROM YourTable
    ORDER BY LastName DESC, FirstName Desc, SysID Desc) A
ORDER BY LastName ASC, FirstName ASC, SysID ASC

First Page

SELECT * FROM (
    SELECT TOP (30) LastName, FirstName, SysID
    FROM YourTable
    ORDER BY LastName ASC, FirstName ASC, SysID ASC) A
ORDER BY LastName ASC, FirstName ASC, SysID ASC

Next Page

DECLARE 	@HighLastName varchar(30) = 'MidLN',
    @HighFirstName varchar(30) = 'MidFN',
    @HighSysID int = 1000;
SELECT * FROM (
    SELECT TOP (30) LastName, FirstName, SysID
    FROM YourTable
    WHERE LastName > @HighLastName
        OR (LastName = @HighLastName AND FirstName > @HighFirstName)
        OR (LastName = @HighLastName AND FirstName = @HighFirstName AND SysID > @HighSysID)
    ORDER BY LastName ASC, FirstName ASC, SysID ASC) A
ORDER BY LastName ASC, FirstName ASC, SysID ASC

Previous Page

DECLARE 	@LowLastName varchar(30) = 'MidLN',
    @LowFirstName varchar(30) = 'MidFN',
    @LowSysID int = 1000;
SELECT * FROM (
    SELECT TOP (30) LastName, FirstName, SysID
    FROM YourTable
    WHERE LastName < @LowLastName
        OR (LastName = @LowLastName AND FirstName < @LowFirstName)
        OR (LastName = @LowLastName AND FirstName = @LowFirstName AND SysID < @LowSysID)
    ORDER BY LastName DESC, FirstName DESC, SysID DESC) A
ORDER BY LastName ASC, FirstName ASC, SysID ASC

Summary
While you could certainly reduce these statements in verboseness, the optimization on the backend is negligible.
This patterns allows for a generic pagination function to be developed with nirtualy no added overhead.

Tags:

.NET | Development | General | SQL

Time Management and Interruptions

by jim morgan23. January 2013 06:45

I think Chris Parnin did a good job describing the issues in programmer productivity in his blog, "Programmer Interrupted". Interruptions kill concentration.

Pomodoro is interesting way to manage your time. Personally, I don't set a timer. However, the notion of focused activity for about 25 minutes rewarded with a brief break makes sense.

He discusses headphones which I use in noisy environments when I need focused attention. However, normally I have music in the background playing over basic speakers. The music is there as white noise so unusual noises don't distract me. I've always thought the type of music is not important as long as it doesn't generate added interruptions.

 

Tags:

Development | General

Use T-SQL ISDATE() function with care

by marc walgren14. January 2013 07:18

I have used the T-SQL function ISDATE() function in many places in my client projects. I came across an interesting behavior that caught me off guard. Try the following T-SQL:


declare @seedDate varchar(20) = '9966'
if isdate(@seedDate) = 1
 Print 'Good Date ' + @seedDate
else
 Print 'Invalid Date ' + @seedDate


declare @myDate Date
select @myDate = @seedDate
print @myDate

 

Running this bit of code produces this result:

Good Date 9966
9966-01-01

Notice that the "9966" value is implicitly converts to Jan. 1, 1996. This implicit conversion produces a valid date and ISDATE returns 1.

Here is a link to the ISDATE documentation from Microsoft.

http://msdn.microsoft.com/en-us/library/ms187347(SQL.105).aspx

Watch out for this situation. Validating with ISDATE without checking the length of the date leaves a hole in the validation.

 

Tags:

Development | SQL

Contact Us  Consulting  Web Development  Data Collection  Flexible Web Lists  Clarion Products  Downloads  How To Order  Site Map  Store  Home
Copyright (c) 1989-2013 Mitten Software Inc., All rights reserved.

Month List