Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2006

Tip: Looking for answers? Try searching our database.

Stuffing text from Word into a VT100 terminal emulator

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Bishop - 08 Feb 2006 20:39 GMT
Here's a challenge for you.  I need to get some complex text into a legacy
database running in a VT100 terminal emulator (please don't laugh).  So I am
generating the text in Word 97 using dropdown form fields, with VBA running
in the background to conditionally alter other fields.  Once done, I have a
button that copies the text to the clipboard.  The user switches to the VT100
terminal emulator and pastes the text in.  There are two remaining things
that I would like to do.

1) Preserve the bold and underline from the Word text.  In the database,
bold is switched on and off with key strokes <crtl-6><b> and underline with
<ctrl-6><u>.
2) Also put data into other fields in the database.  I could due this with a
macro in the terminal emulator but I want the data vary depending on the
contents of the Word file.  So when I switch to the database, I am thinking
that I need to be able to stuff the keyboard with a sequence of keystrokes.  
I realise that the solution may depend on the specifics of the VT100 terminal
emulator that I am using.  The terminal emulator runs macros which are held
in files.  One possibility is to have VBA write the macro to a file, switch
to the terminal emulator and then run the macro that Word has just produced.

Signature

Paul Bishop

Jezebel - 08 Feb 2006 22:11 GMT
Hard to suggest without knowing a little more (and sorry, I can't keep a
straight face --- then again, I've still got a couple of VT52s in the back
shed). Is it feasible to output the document to a text file, then pipe that
into your emulator app? My recollection is very hazy on this (VT100 is early
80s, as I recall), but I'm sure we had a method of using a text file in
place of the keyboard source.

> Here's a challenge for you.  I need to get some complex text into a legacy
> database running in a VT100 terminal emulator (please don't laugh).  So I
[quoted text clipped - 27 lines]
> to the terminal emulator and then run the macro that Word has just
> produced.
Peter Jamieson - 08 Feb 2006 22:33 GMT
Just out of interest, what is the database system and what system/OS is it
running on?

Peter Jamieson
> Here's a challenge for you.  I need to get some complex text into a legacy
> database running in a VT100 terminal emulator (please don't laugh).  So I
[quoted text clipped - 27 lines]
> to the terminal emulator and then run the macro that Word has just
> produced.
Paul Bishop - 11 Feb 2006 18:06 GMT
The database is called "Telepath".  It is used by pathology departments in
the British National Health Service.  I believe it runs under Mumps.  The
PCs, of course, run the terminal emulators under Windows of various vintages.
Signature

Paul Bishop

> Just out of interest, what is the database system and what system/OS is it
> running on?
[quoted text clipped - 31 lines]
> > to the terminal emulator and then run the macro that Word has just
> > produced.
Peter Jamieson - 11 Feb 2006 19:28 GMT
Can't really help you on that one, though I'd have thought there was some
form of bulk loader for Mumps that could do the job. ISTR getting data
/from/ a Mumps system without too much difficulty a few years ago (I didn't
touch it personally, but the NHS IT people we were working with seemed to
have the necessary tools), but maybe it was something else.

Peter Jamieson
> The database is called "Telepath".  It is used by pathology departments in
> the British National Health Service.  I believe it runs under Mumps.  The
[quoted text clipped - 44 lines]
>> > to the terminal emulator and then run the macro that Word has just
>> > produced.
Paul Bishop - 12 Feb 2006 09:16 GMT
I'm not in a position to start meddling with Mumps.  All I have is the
functionality of the terminal emulator.  I will see if I can get VBA to write
a file which will act as a script for the emulator.
Signature

Paul Bishop

> Can't really help you on that one, though I'd have thought there was some
> form of bulk loader for Mumps that could do the job. ISTR getting data
[quoted text clipped - 51 lines]
> >> > to the terminal emulator and then run the macro that Word has just
> >> > produced.
Paul Bishop - 13 Feb 2006 21:20 GMT
I think I can get the terminal emulator to do what I want by running a
script.  The script is a straightforward ascii file.  So I need to assemble
the script as a string in VBA, then write it to the script file.  Excuse me
asing something so simple, but how do I write the string to a file?  (My book
on VBA tells me how to write documents to file, but not a simple string. I am
new to VBA)
Signature

Paul Bishop

> Can't really help you on that one, though I'd have thought there was some
> form of bulk loader for Mumps that could do the job. ISTR getting data
[quoted text clipped - 51 lines]
> >> > to the terminal emulator and then run the macro that Word has just
> >> > produced.
Peter Jamieson - 14 Feb 2006 11:19 GMT
The following code shows an example of how you can write the contents of
string S to a file, but there are doubtless better ways:

Dim s As String
Dim iFileNumber As Integer
Dim strFilePath As String
s = "some text to write"
strFilePath = "c:\mytextfiles\myfile.txt"
iFileNumber = FreeFile
' Need to open for output to create a new file
' because Put to a Binary file just overwrites
' existing data
Open strFilePath For Output As iFileNumber
Close iFileNumber
' Re-open in the mode we want
Open strFilePath For Binary As iFileNumber
Put iFileNumber, , s
Close iFileNumber

Peter Jamieson

>I think I can get the terminal emulator to do what I want by running a
> script.  The script is a straightforward ascii file.  So I need to
[quoted text clipped - 71 lines]
>> >> > to the terminal emulator and then run the macro that Word has just
>> >> > produced.
Paul Bishop - 15 Feb 2006 20:37 GMT
Thanks

I tried that but it stuck an unprintable character and a "$" at the
beginning of the script.  The simplest way to write the scripit is:

s = "the script that I need to run"
open "c:\ptw32\snomed.psl" for output as #1
print #1, s
close #1

It works.  I mapped the spare Enter key at the right of hte number pad to
run the script.  Let's see if my colleagues think it worth the effort.

Paul Bishop

> The following code shows an example of how you can write the contents of
> string S to a file, but there are doubtless better ways:
[quoted text clipped - 92 lines]
> >> >> > to the terminal emulator and then run the macro that Word has just
> >> >> > produced.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.