Page 224
Quick Nav Bar
<<   Previous Contents
Selection
Op Index
Parent User Notes
Index
Glossary
Next   >>


Scripting Problems

Function Won't Work

Sometimes a function just doesn't seem to work, though you've carefully checked the parameters. But - did you remember to assign the function to a value? All functions return a value, though most simply return zero. So if you write a line like this:

    10 ASTERIZE(0,255,0,0,20,0,4,0,1,1)

...you simply get an error, even though the function is set up right. You have to write it like this:

    10 p=ASTERIZE(0,255,0,0,20,0,4,0,1,1)

...so that the function has somewhere to put the returned value.

Now, commands don't return a value. How do you tell the difference? Easy: Commands don't use parenthesis to contain the parameters, if there are any parameters. This is a command:

    10 WONK

...and so is this:

    10 PRINT "Hello from the script!"

...but this is a function:

    10 b=SWIRL(180)

...and because it is a function, you must assign the result to a value.


Loops have a "Jerk" in them

This usually happens because values you intended to make a complete loop were calculated using TPOS() instead of TLPOS().

TLPOS() is designed to generate values that almost loop; you don't really want the last frame to be the same as the first frame, you just want it to be almost the same so that when the first frame comes around again, it'll naturally follow the last frame. If the last frame is the same as the first frame (which is what happens with a rotation of 360 and 0, for instance), then all frames are different except those two - so one frame appears for twice the time you expect, and you get a "jerk". Just use TLPOS(360) instead of TPOS(360)and the last frame will be just what you want.


Variables aren't set the way they should be

This:

    10 A=5
    20 B=4
    30 C=A+b
    40 PRINT C

...results in "5", instead of "9".

That's because although commands and functions are not case-sensitive, variable names are. "A" is not the same as "a"! You have to write it like this:

    10 A=5
    20 B=4
    30 C=A+B
    40 PRINT C

...or maybe like this:

    10 A=5
    20 b=4
    30 C=A+b
    40 PRINT C

...or this:

    10 a=5
    20 B=4
    30 c=a+B
    40 PRINT c


Quick Nav Bar
<<   Previous Contents
Selection
Op Index
Parent User Notes
Index
Glossary
Next   >>
Page 224

WinImages F/x, WinImages Morph and all associated documentation
Copyright © 1992-2007 Black Belt Systems ALL RIGHTS RESERVED Under the Pan-American Conventions

WinImages F/x Manual Version 7, Revision 5, Level B

HTML Documentation Management System © 1992-2007 Black Belt Systems