Page 1
Page 2
Macro Programming with Visual CE
In traditional development tools, if
you wanted to write some code, you would open up some sort
of text editor and type in some sort of code. For example,
to open a serial port and read a GPS signal, you might write
something like:
OPEN("COM1:9600,8,ODD,1,XON")
TEMP = INPUT ("COM1:")
LAT = SUBSTRING(TEMP, 8, 9)
LONG = SUBSTRING(TEMP, 20, 10)
CLOSE("COM1:")
One of Visual CE's goals is to allow
non-programmers to build forms. Consequently, Visual CE
does not have a traditional programming capability. Instead,
the user creates "buttons." Each button corresponds,
roughly, to a line a code. A sequence of buttons is a macro
program. The program above could be done with five Visual
CE buttons, each button being one step in the program:

When the form
is run, the user would click on the first button. This would
open the serial port. Since the continue property was set,
the next button would be automatically "pressed"
when the first operation is completed. This would read the
GPS signal. Each button would "press" the next
button until it reaches a button whose continue property
is not set (or if there is not another button in the sequence).
Visual CE provides a large variety of
buttons that can be used in a macro program. A button can:
- Perform any menu command
- Move to another region of the form
- Run a third-party application
- Jump to a related record in another
form
- Run a Report CE report
- Read/write text to a serial port
- Read GPS information
- Control an mEnable wireless connection
- Record the current date and time
- Change the order of the records
- Assign the result of an expression
to a column or variable
- Pause for a specified number of seconds
- Put up a message box
In addition, there is also a button
to skip forwards or backwards in the sequence. The number
of buttons to skip can be the results of an "if
then
else"
expression, so it is possible to do conditional tests (for
example "if NAME = '' then 0 else 1" would skip
the next button if the name is not blank).
Visit
SYWARE's Visual CE download page.
Previous Page