Vol. 4, No. 1
Trillium Up Services Products Third Party About Trillium

Seattle Magic Users Group Newsletter
February 12, 1996

Conjurings is printed and edited by Heidi Schuppenhauer of Trillium Custom Software, Inc.
Ads and other material are always welcomed.

INSIDE

Next Meeting: Feb 14
Last Meeting
Conversion to Magic 6.0 Class
MSE Changes
Electronic Addresses
DOS Env Variables
Humor.Com
Temp File Contention
How Many Users?
Map to Aim Aviation

Next Meeting: Feb 14

Next Meeting will be hosted by AIM Aviation in Renton (for all you lucky Renton and Tacoma people!). See the map later in this newsletter.

Dale Schuppenhauer will be presenting some tricks he's found for printing in Magic 6.0, and for those of you on Magic 5.7, Heidi will be presenting some methods for printing in DOS, and hopefully everyone else can share their ideas also.

There will also be a tour of AIM's site, showing how they use Magic on their LAN.

Last Meeting

Our last meeting was also hosted by AIM Aviation. We discussed some things that people like and don't like about the meetings. In general, people like the current setup of meeting in conference rooms, hosted by a user, and with lunch being served (with a note that the restaurant idea didn't work too well). People like learning Tips and Tricks, and having demos of other peoples code, and problem discussions.

For the future, it was suggested that we do more in the way of facility tours to see how Magic is being used by our members, and in particular the LAN/network setup. Also, that it would be nice to get hold of other usergroup's newsletters to share. Another good idea was that we occasionally do a digest of tips that were on E-MAIL and bring that to the meeting.

Conversion to Magic 6.0 Class

By Heidi Schuppenhauer

The Conversion to Magic 6.0 class has been scheduled for February 28, 1996, at SUPERVALU INTERNATIONAL in Tacoma.
The conversion to 6.0 class shows you how to change your 5.7 programs and change parameters in 6.0 so the programs import very quickly into Magic 6.0. The concept works very well: it was used by the top GUI entry at the Droege Competition, which was actually written in 5.7 and ported to 6.0 in the last 40 minutes with virtually no changes. The class also covers GUI design techniques.

For those of you who haven't registered , give me a call at (360) 568-9054. The charge is $275 per person.

MSE Changes

For those of you not following David Webber's discussion group, Bruce Lamasky has left MSE to become his own consultant (using Magic). Also, James Holcomb, winner of the 1995 Droege competition, has left MSE to work for a company in Tampa, Florida as the project manager of an AS400 Magic project.

Electronic Addresses

Since E-Mail seems to be the way of the world now, I'm including a section re-iterating the various E-Mail addresses for those who don't yet use them, including the addresses of some of our users.

MSE:        http://www.magic-sw.com

Tech Support:     msetech@earthlink.net

Sales:     sales@mse.mhs.compuserve.com

Magic BBS: User your modem communication software to call (714) 250-8945.

FAX on Demand:    Call (800) 697-1414

Magic Users:

{Original address list not included in WWW version}

 

DOS Env Variables

John Cole

The following code should lead you to see how to copy the DOS environment into Magic where it can be accessed through INIGET's. It should not be copied directly into your magic batch file:

SET>%USER%\ENV.TXT
ECHO [MAGIC_ENV]USER=>>%USER%\ENV.TXT
ECHO [MAGIC_LOGICAL_NAMES]USER='%USER%'>>%USER%\ENV.TXT
ECHO [MAGIC_ENV]COMMANDPROCESSOR='%COMSPEC%'>>%USER%\ENV.TXT
%ROOT%\%MGPROG% @%USER%\ENV.TXT

Humor.Com

From: Erez Levin (Magic International Users Group)
Top 10 Ways Microsoft Would Change The Auto Business:
-------------------------------------------------
10. New seats would require everyone to have the same butt size.
9. We would all have to switch to Microsoft Gas.
8. The U.S. government would be forced to rebuild all of the roads for Microsoft cars; they will drive on the old roads, but they run very slowly.
7. The oil, alternator, gas and engine warning lights would be replaced by a single 'General Car Fault' warning light.
6. Sun MotorSystems would make a car that was solar-powered, twice as reliable and five times as fast, but would run on only 5% of the roads.
5. You would be constantly pressured to upgrade your car.
4. You could have only one person in the car at a time, unless you bought a Car95 or CarNT but then you would have to buy ten more seats and a new engine.
3. Occasionally, your car would die for NO apparent reason and you would have to restart it. Strangely, you would just accept this as normal.
2. Every time the lines of the road were repainted, you would have to buy a new car.
1. People would get excited about the new features of the latest Microsoft cars, forgetting that these same features had been available from other car makers for years!

Temp File Contention

When you are writing some of the bigger reports, you will often run into a situation where you need to put data in a temporary file. For instance, the user wants a spreadsheet style report, where each column represents the sum of sales for one month.

If you've been using Magic for awhile, you probably know how to use a temporary file for gathering that information, and how to write a report from the temporary file. You create a file in your File Dictionary, give it a name, like Month.TMP, then:

1. Delete the old .TMP file before running.
2. Fill the .TMP file with data in a batch job.
3. Print the .TMP file.

So far so good. The problem comes in when more than two users try to run the report at the same time: the first one runs, the second one gets locked out.

There are several options for fixing this problem.

1. Override the .TMP file name at run time, using a random file name. (I have a random file name generator, if anyone needs one). This is the same approach Magic uses for their SORT files. Advantage: It's very safe. Disadvantage: You have to keep track of the random name in the program. If the program crashes, a lot of random named files can be left on the network.

2. Set up a short logical name called something like WS (for Workstation). When the user starts the application, always have one Startup program (also useful for How Many Users below). The Startup program does at least one thing:

INIPUT('[MAGIC_LOGICAL_NAMES]WS=' & STR(TERM(),'2P0Z0')

In other words, convert the Terminal ID (guaranteed to be unique for every user) into a string, and store it in the logical name %WS%.

In your Magic.INI file, set Resident Magic.INI to YES. Now the INI file will be in memory only, and not rewritten to disk. That way, your INIPUT will only be in effect for this one user.

Now, when you declare your file in the Magic File Dictionary, give it a name like Month%WS%.TMP. The user with Terminal=1 will get MONTH01.TMP, Terminal=2 will get MONTH02.TMP, etc.

One note: If you are running in an environment that allows a Magic user to have multiple sessions, the user will not be able to run the same report in two windows at the same time. I think in most cases this will be acceptable: but if not, you might want to use your startup routine to keep track of how many sessions this user has open, and set a sub-variable Logical name, so the user could have MONTH01a.TMP, MONTH01b.TMP, etc.

This method seems to work well for me and takes a minimum of extra coding. All the work is done in one startup program and your file dictionary.

How Many Users?

In the Magic International User Group dialogue, someone asked if there was a function to tell how many users are logged on to a CTL file.

There isn't, as far as I know, a function in Magic to do this, even though the engine keeps track of how many users are logged on for licensing purposes. However, you can use your Startup program to keep track of not only how many users are logged in, but who they are.

First, you create a program that will be called for every user when they log in to the CTL file. This program does a LINK WRITE to create one record for this user (by USER(0) or TERM()). When the program runs, it creates this user record, and records log on time, last update time, and maybe some other data about this session. In your Magic.INI file or Ctrl Properties, call this program as a STARTUP program.

Next, in your Ctrl Events table, call a program that updates this record, update the last updated field with the current time. This program also deletes all user records that haven't been updated in half an hour or so.

Finally, create another program that deletes the user record. Call this program in the Magic.INI file or Ctrl Properties as an END Program.

Now, when the user logs into Magic, a record will be created for that user. If the user logs out, the record gets deleted. If they crash out, the record doesn't get updated, and the record will get deleted if any other user is logged on. So, if you list this user file during the day, you should get a list of all the users currently on the system.

Map To AIM Aviation

{Original map to AIM not included in WWW version}

For information about the Seattle Magic Users Group, please send snail mail requests to:
Conjurings C/O Trillium Custom Software, Inc.
PO BOX 609
Lake Stevens, WA 98258

 

Send Questions or Comments about this website to our webmaster
© 2000-04 Trillium Custom Software Incorporated. All Rights Reserved. Terms of Use.
This page was last revised on February 25, 1999