Fcscript V1.0 Use Instructions Help file _ other

Source: Internet
Author: User

Fcscript is a scripting control supported by Forcal and mforcal, and therefore requires a certain understanding of the syntax of forcal. Fcscript only to forcal and mforcal packaging, so understand forcal, is to understand Fcscript.
1.1 Why Use Fcscript
Using scripts like VBScript, JScript, and so on is too slow to use fcscript. Forcal first-level functions are calculated at approximately (c + +) or Fortran speed of about 50%, the speed of the level two function is slightly reduced.
Browse the Web pages supported by Fcscript.
It is recommended that you use Fcscript when you want to design a COM component for scripting extensions such as VBScript, JScript, because it is easier to design a forcal extended dynamic library without reducing efficiency (calling a function in a COM component takes longer).
Fcscript provides high-speed scripting control and unlimited scalability for all host programs.
Can go to Sky software station or Chinese army Software Park download forcal, mforcal and OPENFC to further understand forcal.
1.2 How to register and unregister Fcscript
Download Fcscript
If the above site does not download normally, you can go to my blog1 my blog2 to find a suitable site to download.
Fcscript need to be registered in Windows before they can be used. Although fcscript can be placed anywhere on the disk, it is recommended that fcscript be placed in the folder "C:\FcDll" because fcscript automatically searches for dynamic libraries in that folder for loading. The following assumes that Fcscript and all related dynamic library files are in the folder "C:\FcDll".
Register FcScript.dll: "Start"-> "Run": regsvr32 c:\FcDll\FcScript.dll
Logoff FcScript.dll: "Start"-> "Run": regsvr32/u C:\FcDll\FcScript.dll
If you plan to stop using Fcscript, generally log off fcscript and then delete the folder "C:\FcDll". If you delete the folder "C:\FcDll" first, you need to use the Registry Cleanup tool to clean up the registry, do not clean it does not matter.
1.3 Access to Fcscript supported Web pages
Page 1 page 2 Page 3 page 4
1.4 Demo Fcscript using the VBS file
Save the following VBScript file as a VBS file for demonstration.
Set obj=createobject ("fcscript.vbmforcal")
Dim fcstr, Nmodule, hmodule, ERR1, ERR2, Ierrcode
Fcstr= "(: x) =fcget (&x), Fcset (x+11);" ' Forcal source program
MsgBox Fcstr
Ierrcode=obj. Vbcommodule (Fcstr, Nmodule, hmodule, ERR1, err2) ' Compile forcal source program as a module
If ierrcode=0 Then
err1=100.0
Ierrcode=obj. Vbset (ERR1) ' transmits the real parameter to the Fcscript
Call obj. Vbexemodule (hmodule, CLng (0), CLng (0), CLng (0)) ' Executes a module
Ierrcode=obj. Vbget (ERR1) ' obtains real parameters from Fcscript
MsgBox ERR1
Else
MsgBox Ierrcode
End If
Set obj=nothing
1.5 demo fcscript with Web page
Save the following page code as an HTM file for demonstration. You need to allow Web page access controls to demonstrate.
<HTML>
<HEAD><TITLE> a Fcscript Simple example </TITLE>
<script language= "VBScript" >
<!--
Sub button1_onclickset obj=createobject ("fcscript.vbmforcal")
Dim fcstr, Nmodule, hmodule, ERR1, ERR2, Ierrcode
Fcstr= "fcset{" +document. Form1.forstr.value+ "};" ' Forcal source program
MsgBox Fcstr
Ierrcode=obj. Vbcommodule (Fcstr, Nmodule, hmodule, ERR1, err2) ' Compile forcal source program as a module
If ierrcode=0 Then
err1=100.0
Ierrcode=obj. Vbset (ERR1) ' transmits the real parameter to the Fcscript
Call obj. Vbexemodule (hmodule, CLng (0), CLng (0), CLng (0)) ' Executes a module
Ierrcode=obj. Vbget (ERR1) ' obtains real parameters from Fcscript
MsgBox ERR1
Else
MsgBox Ierrcode
End If
Set obj=nothing
End Sub
-->
</SCRIPT>
</HEAD>
<BODY>
<H3> a Fcscript Simple example </H3><HR>
<form name= "Form1" method= "POST" action= "" >
<input type= "text" name= "Forstr" value= "2-cos (2.3) *sqrt[9]"/> <br> <br>
<input name= "Button1" type= "button" value= "Click here to demonstrate Fcscript" >
</FORM>
</BODY>
</HTML>
--------------------------------------------------------------------------------
2 Fcscript Language Reference [table of contents]
The following functions are implemented in the Vbmforcal interface. All interface parameters are variant types.
Functions implemented in the 2.1 vbmforcal interface
2.1.1 Request to enter or exit the Forcal workspace: vbuseforcal (Iuse)
This method cannot be used for a while. If you must use it, you can refer to the description of the function useforcal in mforcal.
2.1.2 Compiler Source: Vbcommodule (FCSTR,NMODULE,HMODULE,ERR1,ERR2)
Compiles an expression from the source program into one or more modules. #module# and #end# can be used to define a child module in the source program. That is, the expression between #module# and #end# is defined as a child module. In a module, an expression with a ~ is compiled into a positive module number expression that can be accessed by other modules, and the remaining expressions are compiled into negative module number expressions and other modules are inaccessible.
FCSTR: A string that points to the source program.
Nmodule: Returns the minimum module number for multiple modules. This parameter is generally not used. Must be a long integer!
Hmodule: Returns a handle to the module that is used to execute the module. Must be a long integer!
ERR1 and ERR2: Returns the location of the compile error. Must be a long integer! The current error location is not accurate: if the source code is all in English, the error location is accurate; If the source code has Chinese characters, the error location is not accurate.
The function returns the compiled code, which is compiled by 0. The return value is a long integer!
Please refer to the description of the function commodule in mforcal for details.
2.1.3 Execution Procedure: Vbexemodule (HMODULE,OUTL,OUTD,OUTC)
Hmodule: The handle of the module that was obtained when compiling the source program. Must be a long integer!
Outl, OUTD, OUTC: Generally these three parameters are set to 0, must be long integers!
Please refer to the description of the function exemodule in mforcal for details.
2.1.4 Delete module: Vbdeletemodule (hmodule)
Hmodule: The handle of the module that was obtained when compiling the source program. Must be a long integer!
Please refer to the description of the function exemodule in mforcal for details.
2.1.5 Load forcal Dynamic Library extension: Vbloaddll (str)
FCSTR: A string containing the name of the forcal extended dynamic library.
Fcscript allows you to load multiple forcal extended dynamic libraries. Forcal Extended Dynamic Library name to be placed between double quotes "...". Ignores forcal extended dynamic libraries within the angle bracket < "..." ...>.
For example: "FcData32", "D:\\FCDLL\\OFC32"
You need to be aware of the order in which forcal extends dynamic libraries.
The function automatically loads the dynamic library in the folder "C:\FcDll".
2.1.6 transmit data to the Fcscript buffer: Vbset (Val)
There is a buffer in the fcscript that VBScript and the buffer can transmit data to each other. This function can be used in VBScript to transfer Val data to the buffer, and the function returns the Operation state.
Currently, the function can only transmit a long integer or a double-precision real number to the buffer. Add data such as a transfer array or string later.
If Val is a long integer, it is routed to a long integer buffer, and if Val is a double-precision real number, it is routed to a double-precision real buffer, and so on. The function return value is currently the number of data transferred.
2.1.7 data from the Fcscript buffer: Vbget (Val)
There is a buffer in the fcscript that VBScript and the buffer can transmit data to each other. Use this function in VBScript to transfer data from the buffer into Val, and the function returns the Operation state.
Currently, the function can only transmit a long integer or double real number in the buffer to Val. Add data such as a transfer array or string later.
If Val is a long integer, the long integer data in the buffer is obtained, and if Val is a double-precision real number, it gets the double-precision real data in the buffer, and so on. The function return value is currently the number of data transferred.
2.1.8 reinitialization of Forcal:reinitforcal ()
Restores the forcal to its state when it was just loaded.
The function of forcal level two in 2.2 fcscript
2.2.1 Transmits data to fcscript buffer [integer function, real number function]:fcset (x1,x2,... ...)
There is a buffer in the fcscript, and the buffer and forcal can transmit data to each other. This function can be used in forcal to x1,x2 data,... ... To the buffer, the function always returns 0.
In an integer expression, the data is transferred to an integer buffer, and in a real expression, the data is transferred to the real buffer.
2.2.2 Obtains data from fcscript buffer [integer function, real number function]:fcset (&x1,&x2,... ...)
There is a buffer in the fcscript, and the buffer and forcal can transmit data to each other. Use this function in forcal to transfer data from the buffer to the x1,x2,... ..., you must use a reference parameter, and the function always returns 0.
In an integer expression, the data in the integer buffer is obtained, and the data in the real buffer is obtained in the real-expression.
--------------------------------------------------------------------------------
3 fcscript source code [directory]
Because the author of COM, ATL, the Web is not familiar with the maintenance of fcscript more difficult, if you are the expert in this area, you can download Fcscript source code to be maintained.
Download 1
If the above site does not download normally, you can go to my blog1 my blog2 to find a suitable site to download.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.