Allegro SKILL Tutorial | Forms

In most situations you may need to create a form. The form then, in turn have check boxes and button which will trigger some action. In this tutorial we will create a simple "Hello" word form.

Copy the following code in a file and save it in the directory C:/cadence/setup/skill (or the directory that allegro.ilinit points to).

axlCmdRegister( "helloform" `helloform)
; -----------------------------------------------------------------
; allegro skill tutorial
; creates a simple "hello world form"
; -----------------------------------------------------------------

procedure( helloform()
	hello_form = axlFormCreate( (gensym) "helloworld.form" nil nil t)

); end of procedure
; -----------------------------------------------------------------

What does this skill code do

The line

axlCmdRegister( "helloform" `helloform)
registers the command helloform ( as defined by the first argument. The second argument of the axlCmdRegister, also helloform tells the procedure that needs to be called when the command is given.

Look at the code

hello_form = axlFormCreate( (gensym) "helloworld.form" nil nil t) axlFormDisplay(hello_form)
The axlFormCreate creates a form defined in the helloworld.form and axlFormDisplay displayes it. Now you need to create another file - called helloworld.form with the following content.
PORT 40 40
HEADER "Learning Form"


TEXT "Hello World ! - skill is easy with"
TLOC 1 1



Save the file in the same directory as you brd file. Assuming everything is right you can just type hello form at the Command and it will pop up a form.


Change the line
PORT 40 40
PORT 60 40
and check that the width of the form increases.
Of course this form does not do any function. But it got you started on learning. In the next few pages we will be creating someting useful with the form.