PsyScriptIcon.png PsyScript: getting experiments done

$query\n"; } $result = mysql_query($database, $query, $connection) or die("ack! query failed: " ."
  • errorno=".mysql_errno() ."
  • error=".mysql_error() ."
  • query=".$query ); return $result; } $Base = "http://www.maccs.mq.edu.au"; $URL= $PHP_SELF; $connection = mysql_connect('localhost', 'tim', 'connect2'); if (!$connection) { print("Cannot connect to database. Call Tim.
    "); exit(); } $result=safe_db_query("Counters","SELECT * FROM Count WHERE Base='$Base' AND URL='$URL'", $connection); while ($row = mysql_fetch_row($result)) { $ChkBase=$row[0]; $ChkURL=$row[1]; $ChkCount=$row[2]; $Count=$ChkCount; } if ($ChkURL == ""){ safe_db_query("Counters","INSERT INTO Count VALUES ('$Base','$URL','0')", $connection); $Count=0; } $Count++; safe_db_query("Counters","UPDATE Count SET Number='$Count' WHERE Base='$Base' AND URL='$URL'"); $result=safe_db_query("Counters","SELECT * FROM Count WHERE Base='$Base' AND URL='$URL'", $connection); while ($row = mysql_fetch_row($result)) { $Base=$row[0]; $URL=$row[1]; $Count=$row[2]; } echo $Count; */ ?>hits
  • Libraries

    PsyScript allows you to make "script libraries collections of handlers and properties that you can use over again. These are full objects, so you can create multiple instances in your experiments, for instance to maintain two parallel adaptive staircases, just make two staircase objects.

    If you have suggestions for changing these libraries, or if you make new libraries yourself, please submit them to me.

    Contents

    FileHandler: A collection of handlers useful in every script. This does lists, initializes file paths, randomises items etc.

    Staircase: An adaptive staircase object.

    Eyelink.lib: Acollection of handlers to help you write Eyelink applications.

    RB.lib: Acouple of handlers created for doing funny things in terms of creating masks out of single characters and controlling their length etc.

     


    Using a Library

    To use the library load it at the top of your script.

    set helper to load script file (""& Psyscript base folder &" libraries:file.lib")

    Then call the handlers you need using the following three equivalent forms:

    libraryName 's handler ()

    e.g set newList to helper's removeItem ( 3 , {1,2,3,4,5,6})

    handler of libraryName

    e.g. set newList to removeItem ( 3 , {1,2,3,4,5,6}) of helper

    tell library to handlerName ()

    e.g. tell helper to removeItem ( 3 , {1,2,3,4,5,6})

    MACCS PsyScriptIcon.png Documentation Downloads FAQ Mailing List
    Last change:
    Advanced Search

    Applescript in a Nutshell : A Desktop Quick Reference

    AppleScript for Applications: Visual QuickStart Guide

    AppleScript For Dummies

    Applescript for the Internet Visual Quickstart Guide

    Applescript Language Guide; English Dialect

    Danny Goodman's Applescript Handbook