FcScript V1.0 Help File

Source: Internet
Author: User

FcScript is a script control supported by Forcal and MForcal. Therefore, you must have a certain understanding of the Forcal syntax. FcScript only packs Forcal and MForcal. Therefore, to understand Forcal is to understand FcScript.
1.1 why FcScript
FcScript is required when VBScript, JScript, and other scripts are too slow. Forcal level-1 functions have a computing speed of about 50% (C/C ++) or FORTRAN, and the speed of level-2 functions is slightly reduced.
Browse the Web pages supported by FcScript.
FcScript is recommended when you want to design COM components to expand the functions of VBScript, JScript, and other scripts, because it is easier to design a Forcal dynamic extension library, it does not reduce the efficiency (it takes a long time to call functions in the COM component ).
FcScript provides high-speed script control and unlimited scalability for all host programs.
You can download Forcal, MForcal, and OpenFc from the sky software station or huajun Software Park to learn more about Forcal.
1.2 How to register and deregister FcScript
Download FcScript
If the above sites cannot be downloaded normally, you can go to my blog1 and my blog2 to find a suitable site for download.
FcScript must be registered in windows before it can be used. Although FcScript can be stored anywhere on the disk, it is recommended to place FcScript in the folder "c: \ FcDll" because FcScript will automatically search for dynamic libraries in the folder for loading. Assume that FcScript and all related dynamic library files are in the "c: \ FcDll" folder.
Register FcScript. dll: "START"-> "run": regsvr32 c: \ FcDll \ FcScript. dll
Fc script. dll: "START"-> "run": regsvr32/u c: \ FcDll \ FcScript. dll
If you do not want to use FcScript any more, log out of FcScript and delete the folder "c: \ FcDll ". If the folder "c: \ FcDll" is deleted first, use the registry cleanup tool to clear the registry.
1.3 access the website supported by FcScript
Webpage 1 webpage 2 webpage 3 webpage 4
1.4 Use a vbs file to demonstrate FcScript
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 the Forcal source program into a module.
If iErrCode = 0 Then
Err1 = 100.0
IErrCode = obj. VBSet (err1) 'transfers the real number parameter to FcScript
Call obj. VBExeModule (hModule, CLng (0), CLng (0), CLng (0) 'executes a module
IErrCode = obj. VBGet (err1) 'get the real number parameter from FcScript
MsgBox err1
Else
MsgBox iErrCode
End If
Set obj = Nothing
1.5 Use a webpage to demonstrate FcScript
Save the following webpage code as an htm file for demonstration. You must allow web pages to access controls for demonstration.
<HTML>
<HEAD> <TITLE> A simple FcScript 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 the Forcal source program into a module.
If iErrCode = 0 Then
Err1 = 100.0
IErrCode = obj. VBSet (err1) 'transfers the real number parameter to FcScript
Call obj. VBExeModule (hModule, CLng (0), CLng (0), CLng (0) 'executes a module
IErrCode = obj. VBGet (err1) 'get the real number parameter from FcScript
MsgBox err1
Else
MsgBox iErrCode
End If
Set obj = Nothing
End Sub
-->
</SCRIPT>
</HEAD>
<BODY>
<H3> A simple FcScript example </H3> <HR>
<FORM name = "Form1" method = "post" action = "">
<Input type = "text" name = "ForStr" value = "2-cos (2.3) * sqrt [9]"/> <br>
<Input name = "Button1" TYPE = "BUTTON" VALUE = "Click here to demonstrate FcScript">
</FORM>
</BODY>
</HTML>
--------------------------------------------------------------------------------
2 FcScript Language Reference [Directory]
The following are the functions implemented in the VBMForcal interface. All interface parameters are of the VARIANT type.
2.1 functions implemented in the VBMForcal Interface
2.1.1 apply to enter or exit the Forcal Workspace: VBUseForcal (iUse)
This method is temporarily unavailable. For more information, see the description of the UseForcal function in MForcal.
2.1.2 source program Compilation: VBComModule (FcStr, nModule, hModule, err1, err2)
Compile the expressions in the source program into one or more modules. You can use # MODULE # And # END # To define a submodule in the source program. The expressions between # MODULE # And # END # are defined as submodules. In the module ~ The expression at the beginning is compiled into a module number expression and can be accessed by other modules. Other expressions are compiled into a negative module number expression and cannot be accessed by other modules.
FcStr: String pointing to the source program.
NModule: returns the minimum module number of multiple modules. This parameter is generally not used. Must be a long integer!
HModule: the handle of the return module. It is used to execute this module. Must be a long integer!
Err1 and err2: return the compilation error location. Must be a long integer! Currently, the error location is not accurate: if the source code is all in English, the error location is accurate. If the source code contains Chinese characters, the error location is inaccurate.
This function returns the compilation code. If it is 0, the compilation is successful. The returned value is a long integer!
For details, refer to the description of the function ComModule in MForcal.
2.1.3 execution program: VBExeModule (hModule, outl, outd, outc)
HModule: the handle of the module obtained when the source program is compiled. Must be a long integer!
Outl, outd, and outc: Generally, these three parameters are set to 0 and must be long integers!
For details, refer to the description of the function ExeModule in MForcal.
2.1.4 Delete module: VBDeleteModule (hModule)
HModule: the handle of the module obtained when the source program is compiled. Must be a long integer!
For details, refer to the description of the function ExeModule in MForcal.
2.1.5 load the Forcal dynamic Library Extension: VBLoadDll (str)
FcStr: a string containing the Forcal extension dynamic library name.
FcScript allows loading multiple Forcal extended dynamic libraries. Forcal extension dynamic library names should be placed between double quotation marks. Ignore the Forcal extension dynamic library in the angle brackets <"..."...>.
Example: "FcData32", "d :\\ FcDll \ ofc32"
Pay attention to the loading sequence of the Forcal extended dynamic library.
This function automatically loads the dynamic library in the "c: \ FcDll" folder.
2.1.6 transmit data to the FcScript Buffer: VBSet (Val)
FcScript has a buffer. VBScript and the buffer can transmit data to each other. This function can be used in VBScript to transmit Val data to this buffer zone, and the function returns the operation status.
Currently, this function can only transmit one long integer or double-precision real number to the buffer zone. In the future, data such as the transmitted array or string will be added.
If Val is a long integer, it is transmitted to the long integer buffer; if Val is a double-precision real number, it is transmitted to the double-precision real buffer, and so on. The function return value is currently the number of transmitted data.
2.1.7 obtain data from the FcScript Buffer: VBGet (Val)
FcScript has a buffer. VBScript and the buffer can transmit data to each other. You can use this function in VBScript to transfer data in the buffer to Val. The function returns the operation status.
Currently, this function can only transmit one long integer or double-precision real number in the buffer to Val. In the future, data such as the transmitted array or string will be added.
If Val is a long integer, the long integer data in the buffer is obtained. If Val is a double-precision real number, the double-precision real data in the buffer is obtained, and so on. The function return value is currently the number of transmitted data.
2.1.8 re-Initialize Forcal: ReInitForcal ()
Restore Forcal to the status when loading.
2.2 Forcal second-level functions in FcScript
2.2.1 transmit data to the FcScript buffer [integer function, real number function]: FcSet (x1, x2 ,......)
FcScript has a buffer. The buffer and Forcal can transmit data to each other. You can use this function in Forcal to transmit data x1, x2,... to the buffer. The function always returns 0.
In an integer expression, data is transmitted to the integer buffer; in a real expression, data is transmitted to the real buffer.
2.2.2 obtain data from the FcScript buffer [integer function, real number function]: FcSet (& x1, & x2 ,......)
FcScript has a buffer. The buffer and Forcal can transmit data to each other. Use this function in Forcal to transmit data in the buffer zone to x1, x2,.... Reference parameters must be used, and the function always returns 0.
In an integer expression, data in the integer buffer is obtained. In a real expression, data in the real buffer is obtained.
--------------------------------------------------------------------------------
3 FcScript source code [Directory]
Since the author is unfamiliar with com, atl, and web, it is difficult to maintain FcScript. If you are a master in this field, you can download the source code of FcScript for maintenance.
Download 1
If the above sites cannot be downloaded normally, you can go to my blog1 and my blog2 to find a suitable site for 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.