Open Forum > What's New
Script BASIC project site upgrade
Support:
I was able to build the Windows 64 bit version of the Script BASIC GFX extension module.
Note: These examples are using the same Script BASIC GFX scripts that were used for the Linux 64 bit and Windows XP 32 bit examples.
Support:
I was able to get the Windows 64 bit version of IUP working with the Script BASIC IUP extension module interface. I still need to get the manifest issue resolved but everything else looks fine.
I got the scribaw.exe version of Script BASIC built which is a Windows application and not a console app. It also includes what is needed for theming controls. Using the following command will generate a standalone Windows (no console support) version of your SB IUP app.
scribaw -Eo myapp.exe myapp.sb
Update: I have recompiled the 64 bit scriba.exe console interpreter to support IUP/GUI control theming. This will be a good way to debug your SB scripts and when your ready to release, use scribaw.exe which has no startup console support. (true Windows app)
Here is one of the first GUI programs I got running under Script BASIC back in 2006 using GTK-Server. I wanted to test the socket support under 64 bit Windows and this program example seem like good candidate. This shows an attempt I made at wrapping the IUP functions in high level SB functions to try and make working with IUP even easier.
--- Code: ---' SBx Online Dictionary
servers[0]="dict.org"
servers[1]="dict1.us.dict.org"
servers[2]="all.dict.org"
about="""This is a Demo
of the IUP GUI Binding
for Scriptbasic"""
INCLUDE "SBx"
' Create main window
win = DIALOG()
SETPROPERTIES win, "TITLE=\"SBx Dictionary\", SIZE = 500x300"
SETEVENT win, "CLOSE_CB", ADDRESS(Win_exit())
' Create container to house ALL GUI objects
vbx = VBOX()
SETPROPERTIES vbx, "MARGIN=10x10"
' Create server panel
topBox = HBOX()
SETPROPERTIES topBox, "GAP=10"
APPEND vbx, topBox
serverFrame = FRAME()
SETPROPERTIES serverFrame, "TITLE=Servers, EXPAND=YES"
APPEND topBox, serverFrame
serverBox = HBOX()
SETPROPERTIES serverBox, "GAP=5"
APPEND serverFrame, serverBox
serverCombo = LIST()
SETPROPERTIES serverCombo, "DROPDOWN=YES, SIZE=120x, EXPAND=HORIZONTAL, VALUE=1"
APPEND serverBox, serverCombo
SETEVENT serverCombo, "ACTION", ADDRESS(serverCombo_selected())
btnFetch = BUTTON()
SETPROPERTIES btnFetch, "TITLE=Fetch, SIZE = 50x"
APPEND serverBox, btnFetch
SETEVENT btnFetch, "ACTION", ADDRESS(btnFetch_clicked())
' Create control panel
controlFrame = FRAME()
SETPROPERTIES controlFrame, "TITLE=Controls"
APPEND topBox, controlFrame
controlBox = HBOX()
SETPROPERTIES controlBox, "GAP=5"
APPEND controlFrame, controlBox
btnAbout = BUTTON()
SETPROPERTIES btnAbout, "TITLE=About, SIZE = 50x"
APPEND controlBox, btnAbout
SETEVENT btnAbout, "ACTION", ADDRESS(btnAbout_clicked())
btnClear = BUTTON()
SETPROPERTIES btnClear, "TITLE=Clear, SIZE = 50x"
APPEND controlBox, btnClear
SETEVENT btnClear, "ACTION", ADDRESS(btnClear_clicked())
btnExit = BUTTON()
SETPROPERTIES btnExit, "TITLE=Exit, SIZE = 50x"
APPEND controlBox, btnExit
SETEVENT btnExit,"ACTION",ADDRESS(Win_exit())
' Create dictionary panel
dictFrame = FRAME()
SETPROPERTIES dictFrame, "TITLE=\"Dictionaries\""
APPEND vbx, dictFrame
serverList = LIST()
SETPROPERTIES serverList, "EXPAND=YES, VISIBLELINES=1"
APPEND dictFrame, serverList
SETEVENT serverList, "ACTION", ADDRESS(serverList_selected())
' Create text part
transFrame = FRAME()
SETPROPERTIES transFrame, "TITLE=\"Translation\""
APPEND vbx, transFrame
txt = TEXT()
SETPROPERTIES txt, "MULTILINE=YES, EXPAND=YES"
APPEND transFrame, txt
' Create entry and search button
bottomBox = HBOX()
SETPROPERTIES bottomBox, "GAP=10"
APPEND vbx, bottomBox
lbl = LABEL()
SETPROPERTIES lbl, "TITLE=\"Enter Word to Search For:\", SIZE=x12"
APPEND bottomBox, lbl
entry = TEXT()
SETPROPERTIES entry, "EXPAND=HORIZONTAL"
APPEND bottomBox, entry
btnSearch = BUTTON()
SETPROPERTIES btnSearch,"TITLE=Search, SIZE=50x"
APPEND bottomBox, btnSearch
SETEVENT btnSearch, "ACTION", ADDRESS(btnSearch_clicked())
chkAll = TOGGLE()
SETPROPERTIES chkAll, "TITLE=ALL, SIZE=x12"
APPEND bottomBox, chkAll
chkUTF = TOGGLE()
SETPROPERTIES chkUTF, "TITLE=UTF-8, SIZE=x12"
APPEND bottomBox, chkUTF
' Add the main GUI container to the Window
APPEND win, vbx
' Setup dialog defaults
SHOW win
FOCUS btnFetch
FOR i = 0 TO UBOUND(servers)
SETPROPERTY serverCombo, "APPENDITEM", servers[i]
NEXT
SETPROPERTY serverCombo, "VALUE", "1"
UPDATE serverCombo
server_selection = servers[0]
GETEVENT()
END
' Callback routines
SUB Win_exit
Iup::ExitLoop = TRUE
END SUB
SUB btnAbout_clicked
MESSAGE "ABOUT", about
END SUB
SUB serverCombo_selected
server_selection = GETITEM()
END SUB
SUB serverList_selected
whichDictionary = GETITEM()
END SUB
SUB btnFetch_clicked
LOCAL dat, total, count
ON ERROR GOTO G_NetError
OPEN server_selection & ":2628" FOR SOCKET AS #1
PRINT#1,"SHOW DB\n"
LINE INPUT#1, dat
LINE INPUT#1, dat
count = 0
WHILE LEFT(dat, 1) <> "."
LINE INPUT#1, dat
IF LEFT(dat, 1) <> "." THEN total[count] = TRIM(dat)
count+=1
WEND
PRINT#1,"QUIT\n"
CLOSE(#1)
FOR cnt = 0 TO count - 2
SETPROPERTY serverList, "APPENDITEM", total[cnt]
NEXT
SETPROPERTY serverList, "VALUE", "1"
UPDATE serverCombo
whichDictionary = total[0]
EXIT SUB
G_NetError:
PRINT "Server ",server_selection," not available. (",ERROR,")\n"
END SUB
SUB btnClear_clicked
CLEAR serverList
SETPROPERTY txt, "VALUE", ""
SETPROPERTY entry, "VALUE", ""
END SUB
SUB btnSearch_clicked
LOCAL dict, dat, total, info
SETPROPERTY txt, "VALUE", "Fetching...."
ON ERROR GOTO L_NetError
dict = LEFT(whichDictionary, INSTR(whichDictionary, " "))
OPEN server_selection & ":2628" FOR SOCKET AS 1
IF GETPROPERTY(chkAll, "VALUE") THEN
PRINT#1,"DEFINE * " & GETPROPERTY(entry, "VALUE") & "\n"
ELSE
PRINT#1,"DEFINE " & dict & " " & GETPROPERTY(entry, "VALUE") & "\n"
END IF
REPEAT
LINE INPUT#1, dat
IF LEFT(dat, 3) = "151" THEN
total &= "------------------------------\r\n"
total &= RIGHT(dat, LEN(dat) - LEN(GETPROPERTY(entry, "VALUE")) - LEN(dict))
total &= "------------------------------\r\n"
REPEAT
LINE INPUT#1, info
info = REPLACE(info, CHR(34), CHR(92) & CHR(34))
IF LEFT(info, 1) <> "." THEN total &= TRIM(info) & "\n"
UNTIL LEFT(info, 1) = "."
total &= "\n"
END IF
UNTIL LEFT(dat, 3) = "250" OR VAL(LEFT(dat, 3)) > 499
PRINT#1,"QUIT\n"
CLOSE(#1)
IF LEFT(dat, 3) = "552" THEN
total = "No match found."
ELSE IF LEFT(dat, 3) = "501" THEN
total = "Select a dictionary first!"
ELSE IF LEFT(dat, 3) = "550" THEN
total = "Invalid database!"
END IF
SETPROPERTY txt, "VALUE", total
EXIT SUB
L_NetError:
dat[0] = "Could not lookup word! (" & ERROR & ")"
SETPROPERTY txt, "VALUE", dat
END SUB
--- End code ---
csisgro:
I am in. I haven't done any large projects with it in a while. Lately I use it for reading and extracting exported data or captured printouts then massaging the data for importing into other programs.
Support:
It's great to hear what other Script BASIC users are doing with the BASIC.
After compiling scriba 2.2 for Windows 64 bit I started with cURL because Armando's 2.1 Windows 64 effort didn't include the extension module. That should have been a hint to what was ahead. After a week of fighting with it I finally got it compiled. It has earned the top shelf position on my most PITA extension modules to build. I could have reduced the pain by using the bare bones cURL distribution but that wasn't my goal. What we now have is a 64 bit version of the library with all the bells and whistles.
--- Quote ---curl 7.28.1 (x86_64-pc-win32) - libcurl/7.28.1 OpenSSL/1.0.0j zlib/1.2.7 WinIDN libssh2/1.4.2 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN Largefile NTLM SSL SSPI libz
--- End quote ---
I have Apache 64 bit + extensions installed. My next step is getting the 64 bit version of the Script BASIC multi-threaded HTTPD proxy application server connected and running.
--- Quote ---Apache 2.4.7 win64 VC10
IPv6 and Crypto enabled, apr-1.5.0 apr-util-1.5.3 apr-iconv-1.2.1 openssl-1.0.1f zlib-1.2.8 pcre-8.34 libxml2-2.9.1 lua-5.1.5 expat-2.1.0
--- End quote ---
Support:
I'm happy to report that the Script BASIC ODBC Windows 64 bit extension module works with the MySQL 64 bit server. I'm using the same database / table I demonstrated in a previous post with the direct MySQL C API interface.
--- Code: ---' ODBC Test Program
INCLUDE odbc.bas
dbh = odbc::RealConnect("hobbydb","admin","")
odbc::query(dbh,"SELECT * FROM products WHERE productLine = 'Motorcycles'")
WHILE odbc::FetchHash(dbh,column)
PRINT column{"productName"}," - ",column{"productDescription"},"\n\n"
WEND
odbc::Close(dbh)
--- End code ---
Output
--- Code: ---C:\scriptbasic\test>scriba testodbc.sb
Harley Davidson Ultimate Chopper - replica features working kickstand, front suspension, gear-shift lever, footbrake lever
, drive chain, wheels and steering. All parts are particularly delicate due to their precise scale and require special care and atte
ntion.
Moto Guzzi 1100i - cial Moto Guzzi logos and insignias, saddle bags located on side of motorcycle, detailed engine, working
steering, working suspension, two leather seats, luggage rack, dual exhaust pipes, small saddle bag located on handle bars, two-ton
e paint with ch accents, superior die-cast detail , rotating wheels , working kick stand, diecast metal with plastic parts and b
aked enamel finish.
Harley-Davidson Eagle Drag Bike - l features, official Harley Davidson logos and insignias, detachable rear wheelie bar, he
avy diecast metal with resin parts, authentic multi-color tampo-printed graphics, separate engine drive belts, free-turning front fo
rk, rotating tires and rear ra slick, certificate of authenticity, detailed engine, display stand
, precision diecast replica, baked enamel finish, 1:10 scale model, removable fender, seat and tank cover piece for displaying the s
uperior detail of the v-twin engine
Suzuki XREO - cial logos and insignias, saddle bags located on side of motorcycle, detailed engine, working steering, worki
ng suspension, two leather seats, luggage rack, dual exhaust pipes, small saddle bag located on handle bars, two-tone paint with chr
ome accent uperior die-cast detail , rotating wheels , working kick stand, diecast metal with plastic parts and baked enamel fini
sh.
Harley Davidson El Knucklehead - icately detailed with chrome accents and trim, official die-struck logos and baked enamel
finish.
Vespa GS150 - ures rotating wheels , working kick stand. Comes with stand.
BMW R 1100 S - iled scale replica with working suspension and constructed from over 70 parts
BSA Gold Star DBD34 - iled scale replica with working suspension and constructed from over 70 parts
Ducati 900 Monster - ures two-tone paint with chrome accents, superior die-cast detail , rotating wheels , working kick sta
nd
BMW F650 ST - ures official die-struck logos and baked enamel finish. Comes with stand.
Ducati 996 R - ures rotating wheels , working kick stand. Comes with stand.
Ducati 350 Mk3 Desmo - model features two-tone paint with chrome accents, superior die-cast detail , rotating wheels , wor
king kick stand
Yamaha YZR M1 - ures rotating wheels , working kick stand. Comes with stand.
C:\scriptbasic\test>
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version