'Date Created: 31-May-2002 09:48:16 PM
'Last Updated: 13-Jun-2002 08:46:48 PM
'Created By : Cian Chambliss
'Updated By :
'Minor tweaks and posted By : Ray Lyons
printers = ui_printers_get()
printer = word(printers,1,crlf())
settings = ""
use_settings = ""
result = ui_dlg_box("Printer setup script","">
%dlg%,;
;
{endregion};
%dlg%)
if result = "Copy To Clipboard" then
clipboard.Set_Data(generate_code)
else if result = "Create a Script" then
script_name = "printer_override"
ask_again:
script_name = ui_get_text("Script","Name of script",script_name)
if script_name "" then
if script_load(script_name) "" then
ui_msg_box("Error","Script of that name already exists")
goto ask_again
end if
script_save(script_name,generate_code)
end if
end if
end if
function printer_opt_format as c (name as c,contents as c)
conditional = "?"+quote(name)+"$use_settings"
if contents = "" then
printer_opt_format = "[.20options."+name+conditional+"]"
else if contents = "" then
printer_opt_format = "(options."+name+conditional+")"
else
printer_opt_format = "[.40options."+name+"^=values."+name+conditional+"]"
end if
end function
function printer_opt_init as c(name as c,contents as c)
if contents = "" then
printer_opt_init = "dim options."+name+" as n"
else if contents = "" then
printer_opt_init = "dim options."+name+" as l"
else
printer_opt_init = "dim options."+name+" as c"+crlf()+"options."+name+" = "+quote(word(contents,1,crlf()))
end if
end function
function printer_opt_generate as c(name as c,value as c)
if typeof(value) = "N" then
printer_opt_generate = "options."+name+" = "+value
else if typeof(value) = "L" then
printer_opt_generate = "options."+name+" = "+if(value,".T.",".F.")
else
printer_opt_generate = "options."+name+" = "+quote(value)
end if
end function
end
'Last Updated: 13-Jun-2002 08:46:48 PM
'Created By : Cian Chambliss
'Updated By :
'Minor tweaks and posted By : Ray Lyons
printers = ui_printers_get()
printer = word(printers,1,crlf())
settings = ""
use_settings = ""
result = ui_dlg_box("Printer setup script","">
%dlg%,;
;
{endregion};
%dlg%)
if result = "Copy To Clipboard" then
clipboard.Set_Data(generate_code)
else if result = "Create a Script" then
script_name = "printer_override"
ask_again:
script_name = ui_get_text("Script","Name of script",script_name)
if script_name "" then
if script_load(script_name) "" then
ui_msg_box("Error","Script of that name already exists")
goto ask_again
end if
script_save(script_name,generate_code)
end if
end if
end if
function printer_opt_format as c (name as c,contents as c)
conditional = "?"+quote(name)+"$use_settings"
if contents = "" then
printer_opt_format = "[.20options."+name+conditional+"]"
else if contents = "" then
printer_opt_format = "(options."+name+conditional+")"
else
printer_opt_format = "[.40options."+name+"^=values."+name+conditional+"]"
end if
end function
function printer_opt_init as c(name as c,contents as c)
if contents = "" then
printer_opt_init = "dim options."+name+" as n"
else if contents = "" then
printer_opt_init = "dim options."+name+" as l"
else
printer_opt_init = "dim options."+name+" as c"+crlf()+"options."+name+" = "+quote(word(contents,1,crlf()))
end if
end function
function printer_opt_generate as c(name as c,value as c)
if typeof(value) = "N" then
printer_opt_generate = "options."+name+" = "+value
else if typeof(value) = "L" then
printer_opt_generate = "options."+name+" = "+if(value,".T.",".F.")
else
printer_opt_generate = "options."+name+" = "+quote(value)
end if
end function
end
Comment