Assuming you are referring to the example code above, how did you get the source code into an applet?
To use the example, create a new applet in the Formativ editor, then copy and paste the source code above directly into the Formativ editor. (You cannot take source code and save it as a .VBF file. VBF files contain more than just source code).
If you still have problems after trying the above, please advise your GW version and the exact assert error message text.