orange has asked for the wisdom of the Perl Monks concerning the following question:
it takes about 65 seconds to give the result 5.00000005e+015 = 5000000050000000my $a; for( $a=1; $a<100000001; $a=$a+1 ) { $t = $t + $a; } print $t;
second: i have write in a form the following code:Declare Sub o2_asmo Lib "thinbasic_oxygen.dll" (ByVal s As String) Declare Sub o2_basic Lib "thinbasic_oxygen.dll" (ByVal s As String) Declare Function o2_buf Lib "thinbasic_oxygen.dll" (ByVal n As Long) A +s Long Declare Function o2_error Lib "thinbasic_oxygen.dll" () As String Declare Function o2_exec Lib "thinbasic_oxygen.dll" (Optional ByVal p +As Long) As Long Declare Function o2_get Lib "thinbasic_oxygen.dll" Alias "o2_buf" () A +s String Declare Function o2_len Lib "thinbasic_oxygen.dll" () As Long Declare Function o2_prep Lib "thinbasic_oxygen.dll" (ByVal srcBSTR As +String) As String Declare Sub o2_put Lib "thinbasic_oxygen.dll" Alias "o2_buf" (ByVal c +As String) Declare Function o2_view Lib "thinbasic_oxygen.dll" (ByVal srcBSTR As +String) As String
just compile the code first and run the compiled codePrivate Sub Command1_Click() Dim src As String src = " dim a as quad : dim i as long: for i=1 to 100000000: a=a+i : n +ext i: Print str a: mov eax,a :terminate " o2_basic src o2_exec End Sub
to execute the function o2basic it gives an error, try it please. ps.. the instruction mov eax,a are not used here but it is to make it possible to pass the result to vb6 variable such as v = o2exec thanks#! perl -slw use Win32::API; my $o2basic = new Win32::API( "thinBasic_Oxygen.dll","o2_basic", [P], +P ); my $o2exec = new Win32::API( "thinBasic_Oxygen.dll","o2_exec", [P] ); my $src = " dim a as quad : dim i as long: for i=1 to 100000000: a=a+i + : next i: Print str a: mov eax,a :terminate "; $o2basic->Call( $src ); #gives an error here #what should i do here with o2exec ??: #$o2exec->??;
|
|---|