Programming with LPL
Functions
22-14
Using the LI-6400
22
In-fix
Post-fix notation is an acquired taste, so for those people who do not like ac-
quiring tastes, and for those occasions when even tasteful people eschew
post-fix, there is an alternative: in-fix notation. LPL supports both within
function definitions.
Figure 22-3 illustrates the function MAIN from Listing 22-1 re-written using
in-fix notation. The magic symbol
$
toggles between in-fix and post-fix with-
in a function definition.
When writing in-fix, there are a couple of extra rules to keep in mind:
¥
Lines are important
Use one statement per line, or else use a semicolon (;) as a delimiter. Thus,
we could combine the first two statements of Figure 22-3 into
("Enter 2 values to average");
ENTER
(&y, &x, "%f %f")
¥
Spaces are not needed
When using post-fix notation, each item must be separated by white space
(spaces, tabs, or end of line characters). With in-fix, this is not necessary. Pa-
renthesis, square brackets, and math operators (+,-,/,*,^) can serve as delim-
iters between items. Thus, the post-fix sequence
1.23 x + &y =
can be written with no spaces as
y=x*1.23
Main
{
$
("Enter 2 values to average")
ENTER
(&y, &x, "%f %f")
((x+y)/2, y, x, "The avg of %f and %f is %f")
("\n\nPress Any Key")
GETKEY
DROP
}
Figure 22-3. The main function from Figure 22-1 on page 22-3 rewritten using
in-fix notation
Summary of Contents for LI-6400
Page 1: ...Using the LI 6400 Portable Photosynthesis System ...
Page 15: ...Part I The Basics ...
Page 16: ......
Page 174: ...Making Measurements Answers to Questions 4 56 Using the LI 6400 4 ...
Page 175: ...Part II Useful Details ...
Page 176: ......
Page 200: ...Standard Tools Power ON Hooks 5 24 Using the LI 6400 5 ...
Page 214: ...Real Time Data Real Time Graphics 6 14 Using the LI 6400 6 ...
Page 234: ...Environmental Control Light Control 7 20 Using the LI 6400 7 ...
Page 244: ...Light Sensor Considerations Gallium Arsenide Phosphide GaAsP Sensor 8 10 Using the LI 6400 8 ...
Page 288: ...Data Logging Making Your Own AutoPrograms 9 44 Using the LI 6400 9 ...
Page 289: ...Part III Working With Files ...
Page 290: ......
Page 312: ...The LPL File System Troubleshooting 10 22 Using the LI 6400 10 ...
Page 340: ...Downloading Files Using a Data Capture Program 11 28 Using the LI 6400 11 ...
Page 375: ...Part IV Configuration Issues ...
Page 376: ......
Page 420: ...Defining User Variables Old Style vs New Style 15 18 Using the LI 6400 15 ...
Page 454: ...Using an Energy Balance Further Reading 17 12 Using the LI 6400 17 ...
Page 455: ...Part V Maintenance Troubleshooting ...
Page 456: ......
Page 572: ...Troubleshooting Useful Information 20 46 Using the LI 6400 20 ...
Page 593: ...Part VI Programming ...
Page 594: ......
Page 622: ...Programming with LPL Compiler Directives 22 28 Using the LI 6400 22 ...
Page 846: ...Index I 16 Using the LI 6400 ...