Error C016: Method 'Controls.SetPosition' takes 4 param(s) : 1 specified
Previous Topic  Next Topic 

Problem:        Error C016: Method "Controls.SetPosition" takes 4 param(s) : 1 specified


Solution:        This error message may appear when compiling an application using Satellite Forms 7, even if the same application compiled okay under Satellite Forms 6.  The problem stems from a conflict between an extension that includes a SetPosition method and the new .SetPosition method for standard form controls introduced with SatForms 7.


The Slider and Color Slider controls included with Satellite Forms include SetPosition and GetPosition control methods.  We have modified the extension INF files for Slider and Color Slider to rename those methods with SatForms 7.  They have been renamed SldSetPosition and SldGetPosition, and the SetMinMax function was renamed to SldSetMinMax as well.  If your application uses the Slider or Color Slider controls, you will need to perform a find and replace operation on your script code, to use the updated extension function names.  That will eliminate the compiler error as described above.


  1. With your application opened in App Designer, go to the Scripts tab, open the Global section (by clicking on the + character), then select Variables.  The script edit window should open.  It does not matter if the global variables section is blank or not.
  2. Select Edit | Replace from the menu, or press the CTRL-H hotkey, to bring up the Find & Replace dialog.  In the Find What: field, enter SetPosition, and in the Replace With: field enter SldSetPosition.  Click the Entire Project option in the Replace In selection, and then click on the Replace All button. 



All instances of SetPosition in your script code will be replaced with SldSetPosition.


  1. Repeat the process to replace GetPosition with SldGetPosition.  Repeat also to replace SetMinMax with SldSetMinMax.


You should now be able to compile your application that uses the Slider or Color Slider control, without generating the compiler error complaining about the SetPosition taking a different number of parameters.


Attention LSListBox Control Users


The LSListBox custom control from PalmDataPro also includes a function named SetPosition, and will therefore generate the same error when you compile that application that uses LSListBox under Satellite Forms 7.  To solve this problem you must modify both the extension INF file and update your script code.  Perform the following steps to make the changes so that the application compiles under SatForms 7 with the LSListBox control.


  1. Close App Designer.  Modifications to extension INF files must be done while App Designer is closed, or it will not see the changes.
  2. Locate the LSListBox.inf file in the \Satellite Forms 7\Extensions\{manufacturer} folder, for example \Satellite Forms 7\Extensions\PalmDataPro.  Open the INF file in a text editor (such as Notepad).
  3. Scroll down to the list of extension methods, and edit the name of the SetPosition function to be LSLSetPosition.  Save and close the LSListBox.INF file.
  4. Restart App Designer, and reload your application project.
  5. Go to the Scripts tab, open the Global section (by clicking on the + character), then select Variables.  The script edit window should open.  It does not matter if the global variables section is blank or not.
  6. Select Edit | Replace from the menu, or press the CTRL-H hotkey, to bring up the Find & Replace dialog.  In the Find What: field, enter SetPosition, and in the Replace With: field enter LSLSetPosition.  Click the Entire Project option in the Replace In selection, and then click on the Replace All button.  All instances of SetPosition in your script code will be replaced with LSLSetPosition.


You should now be able to compile your application that uses the LSListBox control in Satellite Forms 7.


Note that if your application uses both the Slider/Color Slider control and the LSListBox control, you should use the Replace button in the Find & Replace dialog, instead of Replace All.  That will enable you to search through your code and replace the Slider calls with SldSetPosition, and skip the LSListBox calls.  You can then go back and run the replace operation again replacing the LSListBox SetPosition calls with LSLSetPosition.  Note that with LSListBox V2.2 and higher the necessary changes have been made to the INF file.


Keywords:        error, C016, SetPosition, GetPosition, Slider, LSListBox


KB ID: 10040 

Updated: 2007-07-11


Satellite Forms KnowledgeBase Online

Satellite Forms Website Home