Some time ago we disussed this in thread209-36997.
Thanks to two separate and unrelated posts by Jeminger and BigBadDave in the JavaSript forum I was able to piece together a solution, abeit IE only.
This solution is for client-side interfacing of the browser with PC COBOL.
It uses a form to write a text file MYFILE.TXT and then launhes the COBOL program MYCOBOL.EXE which could read and process the file MYFILE.TXT.
Here is the code: save it as MYDEMO.HTA.
<html><head>
<title>Using Your Browser as a COBOL Front-end</title>
<script language="JavaScript" type="text/javascript">
function launch() {
document.writeln('<object width="1px" height="1px" classid="CLSID:018B7EC3-EECA-11d3-8E71-0000E82C6C0D" codebase="MYCOBOL.EXE"></object>')
}
</script>
<script type="text/vbscript">
sub writeToFile(s)
set oFS = createobject("scripting.filesystemobject"
set oFile = oFS.opentextfile("MYFILE.TXT", 8, true)
oFile.writeline(s)
oFile.close()
set oFile = nothing
set oFS = nothing
end sub
</script>
<meta http-equiv="Pragma" content="no-cache">
</head>
<body>
<form name="form1">
<textarea name="ta" rows="10" cols="50"></textarea><br />
<input type="button" value="Launch COBOL"
onClick="writeToFile(document.form1.ta.value);launch()" />
</body></html>
Clive
Thanks to two separate and unrelated posts by Jeminger and BigBadDave in the JavaSript forum I was able to piece together a solution, abeit IE only.
This solution is for client-side interfacing of the browser with PC COBOL.
It uses a form to write a text file MYFILE.TXT and then launhes the COBOL program MYCOBOL.EXE which could read and process the file MYFILE.TXT.
Here is the code: save it as MYDEMO.HTA.
<html><head>
<title>Using Your Browser as a COBOL Front-end</title>
<script language="JavaScript" type="text/javascript">
function launch() {
document.writeln('<object width="1px" height="1px" classid="CLSID:018B7EC3-EECA-11d3-8E71-0000E82C6C0D" codebase="MYCOBOL.EXE"></object>')
}
</script>
<script type="text/vbscript">
sub writeToFile(s)
set oFS = createobject("scripting.filesystemobject"
set oFile = oFS.opentextfile("MYFILE.TXT", 8, true)
oFile.writeline(s)
oFile.close()
set oFile = nothing
set oFS = nothing
end sub
</script>
<meta http-equiv="Pragma" content="no-cache">
</head>
<body>
<form name="form1">
<textarea name="ta" rows="10" cols="50"></textarea><br />
<input type="button" value="Launch COBOL"
onClick="writeToFile(document.form1.ta.value);launch()" />
</body></html>
Clive