Elftown Pike

This is a short description of how to program Heddate. Please note that Roxen Webserver is using an older version of Pike, not the newest one. More information about Pike can be found on http://pike.ida.liu.se/

Installation

If you have installed Roxen, you also have installed Pike.

Try things!

If you start a shell (or a MSDOS-prompt) and run the program /usr/local/roxen/server-2.2.252/bin/roxen (Or what it is called, maybe c:\roxen internet software\roxen\server\bin\roxen) you can run pike-commands one by one.

Example:

[hedda@o235 hedda]$ /usr/local/roxen/server-2.2.252/bin/roxen
Pike v7.2 release 260 running Hilfe v2.0 (Incremental Pike Frontend)
> ({2,4,2,4})-({2});
Result: ({ /* 2 elements */
            4,
            4
        })
> string foo="bar";
Result: "bar"
> foo+=" gazonk";
Result: "bar gazonk"
> for (int i=0; i<5; i++) foo+=(" "+i);
Ok.
> foo;
Result: "bar gazonk 0 1 2 3 4"
>

Try database things!

Example:


[root@o235 hedda]$ /usr/local/roxen/server-2.2.252/bin/roxen
Pike v7.2 release 260 running Hilfe v2.0 (Incremental Pike Frontend)
>  object db=Sql.sql("mysql://localhost/elftown");
Result: object
>  mixed foo=db->query("select nr, name, last_seen, uname from members where uname LIKE 'h%2'");
Result: ({ /* 2 elements */
            ([ /* 8 elements */
              "last_seen":"1032194205",
              "members.last_seen":"1032194205",
              "members.name":"",
              "members.nr":"10",
              "members.uname":"h12",
              "name":"",
              "nr":"10",
              "uname":"h12"
            ]),
            ([ /* 8 elements */
              "last_seen":"1065609746",
              "members.last_seen":"1065609746",
              "members.name":"",
              "members.nr":"14",
              "members.uname":"h22",
              "name":"",
              "nr":"14",
              "uname":"h22"
            ])
        })
> foo->uname;
Result: ({ /* 2 elements */
            "h12",
            "h22"
        })


Back to index