ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Farr's 'Calc' program completely revisited!

(1/2) > >>

Gerome:
Hello!

Mouser can now execute this Fbsl script that is a complete replacement of his 'Calc' tool integrated into his nice Farr program!

With this version you can now use Farr like this :

Calc 1+1
and then it'll give '2' as result : ok classical and same like before...

But, one can also type this :
Calc apicall( "MessageBox", "user32", null, "Fbsl & Farr powah!", "Mouser!", MB_OK )

And then the complete expression will be executed and a messagebox will tell you "Fbsl & Farr powah!"
That is to say that this single executable allows you not only to execute common maths tasks, but you can also execute the whole things that Fbsl allows you to do aka : API, COM, REGEX, MATHS and more than 300 inner functions + your own ones at runtime via Farr!


--- ---$AppType GUI
' // GEG 07 March 2006
if standalone = false then
fbsl2exe(command(1))
ExitProgram(0)
end if
Dim $cmd = Remove(command(-1), APPEXEPATH & APPEXENAME)
if cmd = "" Then
Msgbox(Null, "You need to specify an expression to evaluate, like 2+2.", "Freestyle Basic Script Langage (FBSL) Calculator:", MB_OK)
ExitProgram(1)
End If
Dim $code = "Dim $result = " & cmd & " : Return result"'
Dim $resulttext = cmd & " = " & Execline(code)
ClipBoardSetText( $resulttext)
Msgbox(Null, $resulttext, "Freestyle Basic Script Langage (FBSL) Calculator / Executor:", MB_OK)

Complete compiled program is located there :
http://gedd123.free.fr/Fbsl/FBSLCalc.zip

And then replace your actual FBSLCalc.exe located into \Program Files\FindAndRunRobot\Scripts
with this brand new one!


Enjoy!
Feedback appreciated ;)

mouser:
nice! when you combine this with the regular expression support in farr it should let you do some powerful stuff!

Gerome:
Hi,

nice! when you combine this with the regular expression support in farr it should let you do some powerful stuff!
-mouser (March 07, 2006, 08:46 PM)
--- End quote ---

In fact one can imagine this :
imagine some datas containing code into the Clipboard...
If you type this with my revisited code :
Calc ClipboardGetText()
then the content will be read and executed directly :)
we can imagine tons of nice code like that... the limitations are just given by your ideas... :)

Gerome:
Hi,

Get this one and compile it as 'FBSLCalc.exe' and replace the actual 'FBSLCalc.exe' from the
D:\Program Files\FindAndRunRobot\Scripts\
directory, and enjoy the newest interpreter !

Example :
Calc msgbox( 0, "hello", "title", MB_OK )
Calc "2+2*5"

With OR without "", it'll work same way ;)


--- ---'$AppType GUI
' // GEG 12 March 2006
If STANDALONE = FALSE Then
    Fbsl2Exe(Command(1))
    ExitProgram(0)
End If
Dim $cmd = Command(-1), ch34 = Chr(34), ch92 = Chr(92)
If cmd = "" Then
    MsgBox(NULL, "You need to specify an expression to evaluate, like 2+2.", "Freestyle Basic Script Langage (FBSL) Calculator:", MB_OK)
    ExitProgram(1)
End If

cmd = Replace(cmd, ch34 & ch34, "")
If Left(cmd, 1) = ch34 AndAlso Right(cmd, 1) = ch34 Then cmd = Mid(cmd, 2, StrLen(cmd) - 2)
Dim $code = "Dim $result = " & cmd & " : Return result"
cmd = Trim(cmd)
If StrLen(cmd) = 0 Then ExitProgram(-1)

Dim $resulttext = cmd & " = " & ExecLine(code)
ClipboardSetText($resulttext)
MsgBox(NULL, $resulttext, "Freestyle Basic Script Langage (FBSL) Calculator / Executor:", MB_OK)

jgpaiva:
This is the best completion for farr.
As I use farr all the time, and need to make fast calculations, there is nothing better than having "calc.exe" in farr!

Thanks Gerome!  :Thmbsup: :Thmbsup:

Navigation

[0] Message Index

[#] Next page

Go to full version