Messages - Gerome [ switch to compact view ]

Pages: prev1 ... 16 17 18 19 20 [21] 22 23 24 25 26 ... 31next
101
Developer's Corner / Re: Farr's ADDNOTE
« on: March 13, 2006, 04:23 AM »
Hi mouser,

Yes, all is possible in FBSL!

1) To get Commandlines ytou can use this :

For i = 0 to CommandCount()
  szCmd = Command(i)
Next i

And then you can parse each one starting with wanted keywords and so on...

2) no problem, you have to document it :)

3) just do this mod :
instead of :
szCmdFull = Replace(szCmdFull, "_", CRLF)

type this :
szCmdFull = Replace(szCmdFull, "\n", CRLF)

But, actually i'm at office... so i have to work before playing, but you can add these mods yourself ;)

102
Developer's Corner / FBSL - A simple Web browser
« on: March 12, 2006, 04:20 PM »
Hello,

A simple web browser with a mutex that allows to execute more than one instance at a time :)

#Option Explicit

#DllDeclare atl.AtlAxWinInit
Dim %hMutex, $URL, %hDisplay

' // Create a Mutex : only ONE instance is allowed !!
hMutex = ApiCall("CreateMutex", "kernel32", 0, 1, "__MUTEX__Browser__")
If GetLastError() = 183 Then ExitProgram(-1)

Fbsl_SetText(ME, "==FBSL Basic Web Browser==")
Resize(ME, 0, 0, 600, 500)
Center(ME)

Const hURL = Fbsl_Control("Edit", ME, "http://www.fbsl.net", 0, 10, 3, 368, 23, _
WS_CHILD + WS_VISIBLE + WS_TABSTOP + ES_AUTOHSCROLL, WS_EX_CLIENTEDGE)
Const IDB_Go = 1000
Fbsl_Control("Button", ME, "Go", IDB_Go, 380, 3, 75, 23, WS_CHILD + WS_VISIBLE + WS_TABSTOP, 0)
AtlAxWinInit(0)
hDisplay = Fbsl_Control("AtlAxWin", ME, "MSHTML:<HTML></HTML>", _
0, 0, 30, 600, 460, WS_CHILD + WS_VISIBLE, WS_EX_CLIENTEDGE)
Show(ME)
RefreshMe()

Begin Events
    Select Case CBMSG
        Case WM_SIZE
            RefreshMe()
        Case WM_CLOSE
            ExitProgram(0)
        Case WM_COMMAND
            If CBCTL = IDB_Go Then EventGo()
    End Select
End Events

Sub EventGo()
    Fbsl_GetText(hURL, URL)
    If URL = "" Then Return
    If (hDisplay <> 0) Then Destroy(hDisplay)
    hDisplay = Fbsl_Control("AtlAxWin", ME, URL, 0, 0, 30, 600, 460, _
    WS_CHILD + WS_VISIBLE + WS_VSCROLL + WS_HSCROLL, WS_EX_CLIENTEDGE)
    RefreshMe()
End Sub

Sub RefreshMe()
    Dim %Lefti, %Topi, %Righti, %Bottomi
    GetClientRect(ME, Lefti, Topi, Righti, Bottomi)
    Resize(hDisplay, 10, 30, Righti - 25, Bottomi - 70)
End Sub

103
Developer's Corner / Farr's ADDNOTE
« on: March 12, 2006, 03:57 PM »
Hello,

Mouser asked me an addnote tool for his Farr tool...
Here's the beast that can be compiled there : http://gedd123.free.fr/studio/fbsl2exe.php

' // ------------------------------------------------------------------
' // Addnote -clip|-timestamp|-top YOURMESSAGE_UNDERSCORES_MEAN_CRLF :)
' // ------------------------------------------------------------------

Dim $szCmd1, $szCmdFull, %fp, $szTemp
Begin Const
    file = ".\addnote.txt"
    sepa = "------------------------------------"
End Const

If STANDALONE = TRUE Then
    szCmd1 = LCase(Command(1))
    szCmdFull = Remove(Command(-1), szCmd1)
    szCmdFull = Replace(szCmdFull, "_", CRLF)
    szCmdFull = Trim(szCmdFull)
   
    szCmdFull = Replace(szCmdFull, ch34 & ch34, "")
    If Left(szCmdFull, 1) = ch34 AndAlso Right(szCmdFull, 1) = ch34 Then szCmdFull = Mid(szCmdFull, 2, StrLen(szCmdFull) - 2)
    szCmdFull = Trim(szCmdFull)
    If StrLen(szCmdFull) = 0 Then ExitProgram(-1)
   
    Select Case szCmd1
        Case "-clip"
            fp = FileOpen(file, APPEND)
            FilePrint(fp, szCmdFull)
            FilePrint(fp, sepa)
            ClipboardSetText(szCmdFull)
            FileClose(fp)
        Case "-timestamp"
            'March 12, 2006 - 19:35:27 PM
            fp = FileOpen(file, APPEND)
            FilePrint(fp, GetMonth(Time(6)) & " " & Time(7) & ", " & Time(5) & " - " & _
            Time(1) & ":" & Time(2) & ":" & Time(3) & " " & Time(4))
            FilePrint(fp, szCmdFull)
            FilePrint(fp, sepa)
            FileClose(fp)
        Case "-top"
            fp = FileOpen(file, BINARY_INPUT)
            szTemp = FileGet(fp, FileLen(file))
            FileClose(fp)
            fp = FileOpen(file, OUTPUT)
            FilePrint(fp, szCmdFull)
            FilePrint(fp, sepa)
            FilePrint(fp, szTemp)
            FileClose(fp)
    End Select
End If

Function  $GetMonth(ByVal  %iMonth)
    Select Case iMonth
        Case 1
            Return "January"
        Case 2
            Return "February"
        Case 3
            Return "March"
        Case 4
            Return "April"
        Case 5
            Return "May"
        Case 6
            Return "June"
        Case 7
            Return "July"
        Case 8
            Return "August"
        Case 9
            Return "September"
        Case 10
            Return "October"
        Case 11
            Return "November"
        Case 12
            Return "December"
    End Select
End Function

So mouser?

104
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)

105
General Software Discussion / Re: Free Visual Studio 2005
« on: March 11, 2006, 08:28 AM »
Hi,

I did not know that $400 was 'free'... ^^

Pages: prev1 ... 16 17 18 19 20 [21] 22 23 24 25 26 ... 31next
Go to full version