hpwNLSQLite released

Started by HPW, January 01, 2004, 06:51:43 AM

Previous topic - Next topic

HPW

Just upload another extension.DLL for newLISP.

(SQLite.dll 2.8.8 included)



Download:

http://hpwickern.bei.t-online.de/anmeldung/html1/newLISP/newLISP4.html">http://hpwickern.bei.t-online.de/anmeld ... LISP4.html">http://hpwickern.bei.t-online.de/anmeldung/html1/newLISP/newLISP4.html





Exported functions:



hpwSQLiteCreate

hpwSQLiteQuery





Sample usage:



(import "hpwNLSQLite.dll" "hpwSQLiteCreate")

(import "hpwNLSQLite.dll" "hpwSQLiteQuery")



(get-string(hpwSQLiteCreate "c:/newlisp/mytest.db" "^"))



(get-string(hpwSQLiteQuery "c:/newlisp/NL.db" "Select * FROM SQLITE_MASTER" "|" "^"))

(get-string(hpwSQLiteQuery "c:/newlisp/NL.db" "Select ROWID as ID, * from Simpsons" "|" "^"))

(get-string(hpwSQLiteQuery "c:/newlisp/NL.db" "Update Simpsons Set Firstname='Chief1' where Lastname='Wiggum 1'" "|" "^"))





The parameter "|" is used for delimiting the database-fields in a record.



The parameter "^" is used for delimiting the result-string from SQLite variables:

ChangeCount

LastError

LastErrorMessage
Hans-Peter

nigelbrown

#1
Hans-Peter, you are being very successful in adapting dll's to newlisp!



If you are looking for a project - how difficult would it be to integrate a web browser control? I was thinking about an interface that would give a similar degree of functionality as the browser command in Ibasic (http://www.pyxia.com">www.pyxia.com) that provides for (along with some other functionality):

1 Navigates to the specified web page or local file.  

2 Loads the default 'home' page

3 Moves back one page in the history list.

4 Moves ahead one page in the history list.

5 Stops loading of the current document.

6 Refreshes the current document.

7 Returns the title of the current document.

8 Cancels navigation to the current page.

9 Returns a string containing the data from a form.

10 Returns a string containing the URL.

11 Loads the browser with the contents of a string. 1 string parameter.

12 Prints the currently displayed document.

and also provides some other navigation notifications.



There are a few references for using the MS browser active X control but there is also a Mozilla based control http://www.iol.ie/~locka/mozilla/control.htm">http://www.iol.ie/~locka/mozilla/control.htm



Being able to print from a browser control would also address the question in another thread regarding high quality printing from newlisp.

I realise you can launch a browser from newlisp pointing at a url and ask the user to print but having an integrated controllable browser may be useful (I've used the Ibasic command to do a small custom image retriever for my use on a local system).



Just a thought.



Thanks again for the dll'ing.

Nigel

HPW

#2
Nigel,



Until now I only look through my neobook plugins to check what make sense in newlisp directly. I have not much knowledge of binding OCX into a DLL. I also do not know if it is possible with Delphi 5 Standard (my current license). Also in neobook we have a browser object, so a special DLL is not needed for neobook/newlisp user.



Also you are not clear where to embed. Embeding in TCL/TK there is something in the TCL/TK community to do it. In native newlisp there is no GUI to embed, so you have to create a window and a seperate main/event-loop.



For TCL/TK:

http://www2.cmp.uea.ac.uk/~fuzz/optcl/default.html">http://www2.cmp.uea.ac.uk/~fuzz/optcl/default.html
Hans-Peter

HPW

#3
Related thread:



http://www.alh.net/newlisp/phpbb/viewtopic.php?t=75">http://www.alh.net/newlisp/phpbb/viewtopic.php?t=75
Hans-Peter

nigelbrown

#4
Thanks for the pointers.

I have Delphi5 Standard but never got into pascal far enough to make full use of it (having a console turbopascal background). I found a delphi(4) component that was supposed to be an improvement on the TWebBrowser component - it was shareware then freeware/unsupported when company changed direction  see ActiveIE v.1.0 on http://www.torry.net/browsers.htm">http://www.torry.net/browsers.htm

As it's unsupported I'll try the tcl option.



Nigel

PS

I see the mozilla active x page has a link to a delphi how to but it may need a more recent version than 5 std.

Lutz

#5
If it is an application running in a browser why can it not not be done with newLISP scripting those pages? The Mozilla browser (and others too, I guess) has an API which is accessible via Javascript from within a displayed page and with which you can control pretty much every aspect of the browser. Other features of Mozila are  accessible via XML and newLISP is very fast handling XML via buil-in functions.



What are the specific things you are looking for when asking for a browser control?



Lutz

nigelbrown

#6
As an example - with IBasic (http://www.pyxia.com">www.pyxia.com) I wrote a small browser based app. It was a custom document image viewer. I used AutoIt to respond to a key combination <alt-F9> by giving focus to a telnet window, sending  select-all and copy key combinations to get the telnet text into the clipboard. In basic I then got the clipboard contents, extracted an id number from the clipboard text and recast the id as a url for the document image. This url was then sent as a string to the browser in the app window  to direct it to the image (tiff) that a browser tiff viewer (AlternaTIFF plugin see http://www.alternatiff.com/">http://www.alternatiff.com/ ) displayed. Having the browser as a component on the app window saved multiwindow clutter and let me add some custom buttons as alternatives to the <alt-F9> signal.



Nigel

PS I remember the windows windowing system that newlisp had for win32 before the multi-platform tk-tcl front-end - what happened to that?

Lutz

#7
>>

PS I remember the windows windowing system that newlisp had for win32 before the multi-platform tk-tcl front-end - what happened to that?

>>



The Windows stuff in the old Win32 SDK based version of newLISP was much nicer, than what we have today with TCL/TK, but it was a pain to maintain. The work was basically 80% GUI stuff and 20% LISP stuff. The Win32 SDK API is extremely weird and inconsistent, new features are just slapped on it, there is no underlying clean design and the whole thing is not portable to any other platform. The TCL/TK folks have done a great job delivereing a GUI API compatible on many platforms.



I wonder when somebody will come up with a nice newLISP windows API layed on top of the Tcl/Tk stuff.



Lutz

eddier

#8
I had visions of adapting wxWindows to newLisp once like wxPython and wxPerl. The wx toolkit is portable, very easy to use, and allows rapid development of some VERY NICE GUIs. Even has methods for handling tables and methods for windows displaying html.



I don't know if it is possible to combine wx with newLisp without some callback mechanism.



If I wasn't working on SACS accreditation stuff, I would look into it.



Eddie

HPW

#9
Just ran across a little freeware for SQLite-users:



ADO to SQLite

Convert from Microsoft MDB databases to SQLite using ADO.

Converts all tables to a new SQLite database.





http://www.hellobasic.com/download.htm">http://www.hellobasic.com/download.htm
Hans-Peter

nigelbrown

#10
Thanks for the pointer Hans-Peter.

I saw on that download page a link to the bcx basic - on their web page it says:

NEWS

Beginning with version 4.31,

BCX supports the Pelles C Compiler System For Windows.

Pelles C, unlike Lcc-Win32, is FREE TO USE

for PROFESSIONAL Software developments



Made me think - perhaps Pelles C might be another target compiler for newlisp. Unlike the free borland compiler it is integerated with an IDE (although I recognise that borland is supported by some separate IDEs).

So far I've installed Pelles C (see http://www.smorgasbordet.com/pellesc/">http://www.smorgasbordet.com/pellesc/ )and am trying to get a first compile - looking at what borland/other defines need setting.



Nigel

HPW

#11
Nigel,



what I find interesting is the possibility to compile for Pocket PC.

The small newlisp would be great on small devices.

I had posted a hint to an experimental GCC for pocket PC.

But it would be a good thing to have something common for GUI over

all platform, so that the wheel must not invented every time on each platform.



Keep us informed about ongoing success.
Hans-Peter