Qbasicnews.com

Full Version: FBSL supports COM !
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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