Scientific Calculator Plus Help : Deploy user defined functions
In order to implement and run user's own function(s), the following steps are required:
1. Start Scientific Calculator Plus;
2. Open Script Editor and type your program and save.
Clearly, it is not an easy thing to type in a mobile phone. So what user can do is
1. Connect your mobile device to a PC via an USB cord;
2. Enable write-access to your mobile device's internal storage and/or SD card;
3. Find your mobile storage (either internal storage or SD card) in PC, find AnMath folder. AnMath folder should be located in your Android device storage's Android/data/com.cyzapps.AnMath/files folder. You can also find the path of AnMath in Scientific Calculator Plus's settings tool by tapping Settings icon and then choosing Storage Settings item. Navigate to AnMath/scripts. In this folder, create a new .mfps file, say my_prog.mfps.
4. Edit my_prog.mfps use any text editor in PC. An example function would be like:
Function MyFunc(Number_value1, Number_value2,Number_value3, Number_value4) Variable avg_value avg_value = (Number_value3-Number_value1)-(Number_value4-Number_value2) Return avg_value Endf
then save the file. Then disconnect your mobile from PC.
5. Open Scientific Calculator Plus;
6. Start command line, type
myfunc(1,2,3,4)
then type enter, result which is 0 will be shown.
Please note that
1. If input user defined function from PC, user may need to restart Scientific Calculator Plus after disconnected from PC. Otherwise, Scientific Calculator Plus may not load your new function.
2. Function title must be declared, i.e.
Function XXXX(...) Endf
is needed. A script without function declaration is not supported.
3. Ensure that different functions do not share the same name. Ensure that user defined function name is different from predefined or build-in functions. We suggest user always declares function name with initial MyF*****.
4. Some mobiles, e.g. Sumsang Galaxy Express, do not allow user to create a new file from SD card or phone's internal storage after the phone is connected to PC. This prevents virus to transfer from phone to PC or vice versa and ensures the security of both phone and PC. However, this feature makes some small troubles when user wants to create his/her own functions. A work around is to copy the whole AnMath folder to a read-write enabled folder in PC, add new .mfps files there and debug them using JAVA based Scientific Calculator Plus there. Then copy the whole AnMath folder back and replace the old AnMath folder in SD Card.