If you want to share Magic
resources with others Magicians,
(a few samples : calendar, tool to help interpreting
the profiler result, game, calldll samples,
demonstration of advanced Magic, DLL, Microsoft VC++/Borland
C++ project sample, validation of bank card number, of SS number,
cool graphics ...).
a mail, with description (or an html page, so you can have
longer description, a counter, your logo, ...), and your contribution
for the Magic RAD developers.
Other valuable magicwares are available on this places :
This ftp program
shows how to add MGET and MPUT
functions to NETGET.DLL and GET.DLL.
Kevin Collins also
ask me for visual progression of ftp GET/PUT commands.
(for Magic V7 or Magic V8) is a must have ; I use it intensively, as a break point
or triggered by an application event, so you can see (and modify)
your fields at runtime.
Thanks to Demjanenko Gennadi
for publishing this tool, that has as a big advantage to other
similar tools that it doesn't use a DB file. Highly recommended.
(for Magic V8)
allows to find in your Magic application all Tasks (not
Programs from the Program Table!) that either are not called (by Event or
Call_Task operator) or being called by Call_Task have Cnd=No or are
placed within Block operator with Cnd=No. It's a good sample of the
power of the export document feature (note that
Magic crashes if
GET.DLL is loaded and that you use the export document function).
(Demjanenko Gennadi - 04/05/2000)
program takes as parameter
2 at 5 exported programs, and make a magic program
(look at PREF()&'_join.'&STR(TERM (),'3P0Z0')), with this
programs as subtasks.
Another tool from Demjanenko Gennadi.
This program is for Magic 8, but you can use it to join older exports
of Magic programs. You can now Mark/Copy then Paste
magic tasks between programs.
Delete empty files
A sample of a Magic (7)
program without any field or file, but that
actually does something : it delete all files that are empty.
Convert from number to string
A Magic 7 task to convert from
a number (183) to a string (a hundred eighty three).
Designed primary for
French (and for Belgium, as I think the Belgian way is better !),
I also try it for English, as it's based
on a table, but I'm not sure it's really the strict spelling.
Set a date to today
This Magic 7 task need to be called by
a CTL event (say CTRL-J). When the focus is on a date field, and
that you type the shortcut, then the date field will be set to
today. (A tip published on the
Magic User List,
but I lost the mail so I can't give credit here) (11/16/99)
1 to n relation
This samples demonstrate
various programming techniques, in C/S or Web mode.
(email@example.com - 10/30/99).
This Magic Application show a matrix like
application. Another contribution from
DLLs and tools
Comdrivr.dll is a tool that allow Magic to use
(read/write) a COM port. It's available at
magicu-l shared folder or at this mirror :
Free without support, other versions are available for older Magic.
Magic Date Utilities
MGDATUTL is a
UDF Date Extensions for Magic RAD software.
A complete description
Winkbd 1.0 : it's a 32 bits
console program that generate (win_kbd > win_kbd.lng) a
file you can use as a Gui Translation File
([MAGIC_ENV]GuiTranslationFile) ; it calls the standard
win32 API. I tried it on my system and found the same file
than the win_kbd.fre supplied with Magic.
Resdll 1.0 : it's an example of a
resource only DLL, that can be used to store in a single
place (and only one read on disk) BMP for your Magic
application (the format is @"name of DLL"."Name of image").
Just modify the res.rc to add/remove bitmap in the DLL,
then type make. A Magic interface is included in GET.DLL.
Cursor 1.0 : change the cursor to
"Wait" style, ... A sample Magic DLL with source code and makefile for
LCC-Win32. (Enhanced function also included in
GET.DLL and almost any Magic DLLs, but
MSE now implements it in Magic V8,
but with a different way)
Magic DLL and compilers
DLL calls since Magic 8.2
I have extracted
from the GET.DLL demo the wrappers where use of the Magic V8.2 functions
(calldll function and Call UDP operation with the @ prefix)
can be used in place of GET.DLL functions. (15/11/99)
Send email with Outlook trough OLE Automation
EMail from Magic is available at magicu-l shared folder
This application (Magic V7) uses
DDE to interface with Excel.
(firstname.lastname@example.org - 06/19/2000).
Some considerations about international
settings and problems with exported CTLs. (updated 11/22/99)
A new (and better) behavior for dates : since version 8.2
(at least), when you put a 2 digits year in a 4 digits picture, then
the 2 missing digits are set according to the [MAGIC_ENV]Century setting.
So in 1999, you just have to put 99, and in 2000 you won't need at all
to put the year, in 2001, 1 will be enough. The previous behavior was
to pad with 0 the year. (11/16/99)
How to choose the printer dynamically and
by code. (11/17/99)
How to make a modal dialog box ? (updated 27/07/2002)
If you want to use the INIPUT function to change a logical name,
you lost the '\' : the solution is to use an '*' after the
'=' or to use '\\'.
will save 'C:TEMP', but INIPUT('[MAGIC_LOGICAL_NAMES]TEMP=*C:\TEMP')
will save 'C:\TEMP'. (11/17/99)
You can fill dynamically a combo or list box, just use an expression at
Control Properties/Details/Label, and put a dummy label (1,2 for instance).
The expression is usually a big string virtual field, you have
initialized by the name from a small file (more than 20 token is not
a good idea).
Remember there are special characters : the ',' (the list separator), the
'-', and the '\'. So the label 1\,2,3\-5,6\\7 will display 3
tokens : 1,2, 3-5 and 6\7. GET.DLL provides
functions to deal with lists, as well as several functions that returns
such lists (printers list, disk list, ...). (11/17/99).
Jump to row : use CTRL-J to activate this window in toolkit mode, then
you can put a value, and go there. Very useful when switching between
You can replace the Magic
splash screen and the Magic
main window title, but only with the runtime engine, it won't
work with the toolkit engine. Look at the
[MAGIC_ENV]CopyrightMessages (to remove MSE Copyright messages),
[MAGIC_ENV]LogoFile (to precise a custom splash screen, actually
a .bmp file), [MAGIC_ENV]RTUserCopyright (to change the Magic title).
An interesting file in your Magic folder : ddfa is an export
of the files definition of DDF files (DDF files is the Btrieve
way to describe the structure of btrieve files).
This technote explains what is and how to use the
Magic Profiler. (12/19/99)
Some precisions about the
Magic "Exit" Operation
and using DOS commands reliably in all Windows OS and
import a tabulation-delimited file ?
How to use the Magic
command line options. (04/26/00)
If you use the PDlg (Printer Dialog) option in the I/O table
when printing GUI, then you should add in the End task expression :
EOF(0,1), so the task will not execute if the user has chosen the
You can use a different file/table name than the original one :
specify it in the expression of the DB Files tables at task
level. But as you can specify only once the file, you can't
open 2 different files if you don't have it twice in the
You can use as SQRT function (square root function) the
power of 0.5 (in Magic 4 ^ 0.5 will evaluate as 2).
The math equation is :
How to send or retrieve an email from Magic ?
If a screen does not correctly refresh, try to put a delai(0) after
How to call DLL from Magic ?
Printer command and translation files
This document (From HP) describes the PCL commands.
PCL is the language of laserjet compatible printers.
You'll find at Epson
informations about Dot Matrix printers.
Cheese Terminator is a Magic
game (and the same as a Turbo Pascal source !).
(email@example.com - 12/19/2000).
MagTris is a Magic-only Tetris
The Magic Quest
The Magic Quest is a game realized in
Magic 8.3 by Charles Gatenby (sources included).
Send me your best-looking screens (as a screen capture) !
has been scanned from a Magic 3.5 book.
Work your Magic
I have compressed a CD single from MSE (distributed at a Magic
"Work Your Magic"
(MP3 3MB) and Lyrics.
Magic CNN video
I have uploaded the
CNN ad from MSE Site
as it's now 300K (you'll need the
Buttons in a Resource-only DLL
It's a demonstration
of the result you can get in a few minutes
with 2 tools from GET.DLL. The first
make easy the creation of the four states bitmap used for Magic image
buttons, the second lets you put in a DLL all your bitmaps (for
better performances and deployment). You'll also need a tool
to create icons
(Icon Forge for instance),
tool to reduce colors and have the bitmap in "RLE BMP"
Paint Shop Pro and Jasc Image Robot),
and LCC-Win32 to
compile the resources.
To install this 17 common buttons, decompress the
in a folder, then copy the buttons.dll in your Magic folder, import
btA in a CTL and run the demo program.
GET.DLL can also dynamically make images buttons, that have over the Magic
way several advantages : you can assign mnemonics, the buttons colors match
the user ones, greater flexibility (you can go back to normal buttons
easily, or change to any other of the proposed styles), it's easy
(you just have to make a file that associates buttons titles to
their icon, then launch a call in your startup program), you can
do MLS, and the button size is not fixed (so better results for
an application that displays in several resolutions). (11/16/99)
The Magic Egg
This hidden demo (posted on the
Magic User List)
since Magic 8.2 lets you look at the MSE peoples.
(This is an "Easter Egg")