JfwHome

Programming

Looking for a great Linux PHP editor? Try Geany.

by admin on Dec.09, 2009, under Linux, Programming

I’ve never been one of the vi or emacs brigade — when editing code (mainly PHP and Python), I’ve always found it easiest using a lightweight editor (together with a local server).
(continue reading…)

2 Comments more...

Querying subfolders in SharePoint lists using SPAPI and GetListItems()

by admin on Nov.11, 2009, under Programming, SharePoint

This took a while to figure out. I’ve been trying to query the SharePoint lists service using getListItems().

Getting something from inside one folder is easy — you just set the queryOptions parameter to be <QueryOptions><Folder>folderName</Folder></QueryOptions>.

This works and returns items fron within that folder. But what about subfolders?

(continue reading…)

2 Comments more...

Simple dynamic ASP includes

by admin on Jun.19, 2009, under Programming

I always end up never quite believing it when, once again, it dawns on me that I can’t complete a project the way I visualise due to ASP Classic’s lack of support for dynamic includes.

This time, I was creating a CMS-like site, which included mixed HTML/ASP files automatically. I tried pretty much every other solution — including server.execute (no go — doesn’t preserve variables/functions),  and other examples of using ASP’s execute() command to parse files (didn’t work for mixed HTML/ASP).

So, the only thing left was to write my own. It’s fairly simple, and due to ASP/VBScript’s horribly limited feature set, very low-level. It steps through a file one character at a time, and decides if it is in “HTML mode” or ”ASP mode” at an given time, and then uses this staus to convert the file into a set of executable lines.

It should handle most things correctly, with the exception of defines, and <!--# -style directives. It handles short ASP write tags (<%= %>) just fine. Variable scope is preserved inside the include file, and variables/functions set inside the include file continue to exist outside it after it is included — in other words, just as they should.

To use it, simply include the file, and use it just as you would in a sane language:

include("relative_path_to_local_file.asp")

The function returns false if the file doesn’t exist, or true otherwise.

If you fix any bugs in this, please let me have them.

Download it here: ASP Dynamic Includes

1 Comment :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Archives

All entries, chronologically...