Groups > dBase > dBase shared code > MSDialog.prg in duflp version S




MSDialog.prg in duflp version S

MSDialog.prg in duflp version S
Sat, 21 Apr 2007 14:28:07 +020
Some comments on MSDialog.prg in duflp version S:

The Header:

The code I posted was a copy of a message fro Rich-autoTraker. any blame for
hardcoding everything
should be put on him <g>

The X/Y parametes:

The result of running MSDialog.prg with the following strings of parameters
results in both cases in
a Syntax error.

? MSDialog( "Enter name:", "Give Me A Name", "Put your
name here","","")
? MSDialog( "Enter name:", "Give Me A Name", "Put your
name here",8000,"")


The code below my signature is an attempt to include also the helpFile and
Context parameters, but I
have not been able to make the InputBox return a help subject, only an error
that the subject can
not be found. Any suggestions?


Ivar B. Jessen

//-----
function VBInputbox
parameters Message, Title, Default, Xpos, Ypos, HelpFile, Context

/*
Examples of use:

cOut = VBInputbox = (Message, Title, Default, Xpos, Ypos, HelpFile, Context)

cOut = VBInputbox("This message", "This Title", "The
Default", 1500, 1500, ;
          "D:\Programmer\dbase\Plus221\help\Plus_EN.hlp", 23)  

cOut = VBInputbox("This message", "This Title", "The
Default", 1500, "")  

cOut = VBInputbox("This message", "This Title", "The
Default")

Set a parameter to "" if it needs to be blank

I don't know how to make the HelpFile/Context show a real help subject instead
of an error telling that the subject can not be found

*/

#define CR chr(13)
sc = new OleAutoClient("MSScriptControl.ScriptControl")
sc.language = "VBScript"

if empty(argvector(6)) or empty(argvector(7))
	retval = nohelp()
else
	retval =	withHelp()
endif

sc = null

return retVal

function withHelp
strCode = ;
	[Function VBInbox()] + CR + ;
	[VBInbox =
InputBox("&Message","&Title","&Default"
;,] + ;
	 Xpos+[,]+Ypos+[,"&HelpFile",] + Context +[)] + CR + ;
	[End Function]
sc.addCode(strCode)
cStr = sc.run('VBInbox')

return cStr

function noHelp
if Xpos <> "" and Ypos = ""
	strCode = ;
	[Function VBInbox()] + CR + ; 
	[VBInbox =
InputBox("&Message","&Title","&Default"
;,] + Xpos + [)] + CR + ;
   [End Function]

elseif Xpos = "" and Ypos = ""
	strCode = ;
	[Function VBInbox()] + CR + ; 
	[VBInbox =
InputBox("&Message","&Title","&Default"
;)] + CR + ;
   [End Function]

elseif  Xpos = "" and Ypos <> ""
	strCode = ;
	[Function VBInbox()] + CR + ; 
	[VBInbox =
InputBox("&Message","&Title","&Default"
;,,] + Ypos + [)] + CR + ;
   [End Function]

else
	strCode = ;
	[Function VBInbox()] + CR + ; 
	[VBInbox =
InputBox("&Message","&Title","&Default"
;,] + ;
	Xpos + [,] + Ypos + [)] + CR + ;
   [End Function]

endif

sc.addCode(strCode)
cStr = sc.run("VBInbox")

return cStr
Post Reply
about | contact