Welcome Guest.   Make a donation to an author on the site October 26, 2014, 02:42:37 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2011! Download 30+ custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: [FBSL] FARR's Calc tool updated!  (Read 2325 times)
Gerome
Charter Honorary Member
***
Posts: 154


View Profile WWW Give some DonationCredits to this forum member
« on: September 26, 2006, 04:25:32 AM »

Hello,

I've improved my FARR's calculator!

Here's the link : http://gedd123.free.fr/Fbsl/DC/FBSLCalc_16-09.zip

How to install Fbslcalc.fbs into FARR ?
-1- Copy FBSLCalc.exe into \FindAndRunRobot\Scripts\
-2- Open FARR and edit Option, select the 'calc'item,and replace its regex config with this one :
calc $$1 | Scripts/FBSLCalc.exe "$$1"
-3- Save

That'all folks!
Now you can play with the newest calc smiley

Usage : FBSLCalc.exe expression

Examples :
basic sample :
Calc 2+2
It'll return '4'

graphical sample :
calc /code=FBSL_Control("Button", Me, "Hello", 1000, 10, 10, 75, 23, 0, 0):show(me):begin events:If CBMsg = WM_COMMAND And CBCTL =1000 then msgbox(0, "Button clicked!", "yoo", 0):end events
it'll afx a form with a button, then just click onto the button... smiley

sample sample :
calc /code=ExecLine(FileLoad("./PMem.fbs"))

Enjoy!

Here is the source of the newest FARR's calc :
Formatted for UNKNOWN with the GeSHI Syntax Highlighter [copy or print]
  1. #Option Explicit
  2. '#AppType Console
  3.  
  4. If Not STANDALONE Then
  5.    Fbsl2Exe( Command(1) ): ExitProgram(0)
  6. End If
  7.  
  8. '// -----------------------------------------------------------------
  9. '// GEG 26 September 2006
  10. '// FBSLCALC.EXE 2.5/56*PI
  11. '// FBSLCALC.EXE /code=msgbox(Null,"Hello","Test",MB_ICONINFORMATION)
  12. '// -----------------------------------------------------------------
  13. Static $code, $resulttext, $result, $cmd = Command(-1), ch34 = Chr(34), ch92 = Chr(92)
  14. If cmd = "" Then
  15.    MsgBox(NULL, "You need to specify an expression to evaluate, like 2+2." & crlf & _
  16.                "If you encounter any problems, tell'em there : " & crlf & _
  17.                "http://www.fbsl.net/phpbb2/index.php", _
  18.                "Freestyle Basic Script Langage (FBSL) Calculator:", MB_OK +MB_ICONINFORMATION)
  19.    ExitProgram(1)
  20. End If
  21.  
  22. cmd = Replace(cmd, ch34 & ch34, "")
  23. If Left(cmd, 1) = ch34 AndAlso Right(cmd, 1) = ch34 Then
  24.    cmd = Mid(cmd, 2, StrLen(cmd) - 2)
  25. End If
  26.  
  27. If Instr(cmd,"/code=") Then
  28.    cmd = Remove(Trim(cmd), "/code=")
  29.    code = "result = " & cmd & " : Return result"
  30.    resulttext = cmd & " = " & ExecLine(code)
  31. Else
  32.    cmd = Replace(Trim(cmd), ",", ".")
  33.    code = "result = " & cmd & " : Return result"
  34.    ExecLine(code)
  35.    result = Replace(result, ".", GetLocalSeparator())
  36.    resulttext = cmd & " = " & result
  37. End If
  38.  
  39. If StrLen(cmd) = 0 Then ExitProgram(-1)
  40.  
  41. ClipboardSetText(result)'resulttext)
  42. MsgBox(NULL, resulttext, "Freestyle Basic Script Langage (FBSL) Calculator / Executor:", _
  43.       MB_OK+MB_ICONINFORMATION)
  44.  
  45. Function GetLocalSeparator()
  46.    Dim $Buffer * 4
  47.    ApiCall( "GetNumberFormat", "kernel32", 0, 0, "1.1", 0, @Buffer, Len(Buffer) )
  48.    Return Mid(Buffer,2,1)
  49. End Function
Logged

Yours,
(¯`·._.FBSL Help file]
(¯`·._.
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: September 26, 2006, 09:19:39 AM »

And here's the regex i use: (notice that it only works for the calculator itself)

[copy or print]
(.*\+.*|.*\-.*|.*\*.*|.*\/.*)
this expression will match anything that includes a *, +, / or -, which means you are able to do maths only by typing it in farr instead of having to prepend "calc".

(i know, it's not a very good expression since it uses the . aka dot)
Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.031s | Server load: 0.03 ]