What am I doing wrong? (using 4.21) This seems to just skip right over the "Function" and doesn't do anything. I was doing step by step in debug mode.

Code:

function GetDefaultPrinter()
$GetDefaultPrinter = join(split(readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device"),',',1),'')
endfunction

? $GetDefaultPrinter

USE LPT1: \\$GetDefaultPrinter



BNutz