Qbasicnews.com
February 28, 2020, 04:41:54 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: FBSL supports COM !  (Read 1858 times)
Gerome
Member
*
Posts: 27



« on: April 09, 2005, 09:40:02 PM »

Hello,

FBSL version 3 dated from 10th of April 2005 now fully supports COM !
Samples + HTML doc comes to show you how to use ActiveX or COM objects with it !

Here is a simple sample that shows how to execute JavaScript via FBSL :

Code:

Const szScript = "Math.pow(5, 2) * Math.PI"
Dim %scrCtl, %pResult, !fltResult

  scrCtl = CreateObject( "MSScriptControl.ScriptControl", "" )

  If scrCtl <> 0 and PutValue( scrCtl, ".Language = %s", "JScript" ) = 0 Then
    PutValue( scrCtl, ".AllowUI = %b", TRUE)
    PutValue( scrCtl, ".UseSafeSubset = %b", FALSE)

    pResult = GetIntValue( scrCtl, ".Eval(%s)", "Math.round(" & szScript & ")" )

    fltResult = GetDblValue( scrCtl, ".Eval(%s)", szScript)
    ? "(integer)JavaScript Math Round Code of (5*5)*PI returned value : " & pResult

    ? "(double)JavaScript Math Code of (5*5)*PI returned value : " & fltResult
  End If
  ReleaseObject( scrCtl )

Pause
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!