• Please review our updated Terms and Rules here

Enable OA

START with opening an htm[l] file in OA

START with opening an htm[l] file in OA

sure, I'm up for it, I know nothing about it so if you start with senior citizen
level I may be able to keep up! :cool:

Good senior or is it Senor Cool! Start with the basics. Open any HTML file as if it's an Enable database just to have a look at what an ASCII/HTML file looks like when configured as an Enable database; but for brevity sake, one with 100-200 lines is better than a thousand lines. Use File, Open, then if you have an htm[l] file on disk, you could type *.htm~ to find it.

Enable will know it's an ASCII file and will consider each line a separate record. For our purposes we need not parse the lines into multiple fields. We'll consider each line as ONE field with length of 240 columns. So if the name of the file is xx.htm[l], the field will be xx.C1L240 in later code, e.g. when searching through the file using @match to find something. As soon as you try to open the html file Enable will ask for a field definition. Just Tab over to column 240 and enter C for character field, then optionally change the name of the field to C1L240 or accept Enable's naming defaults.

Now in DISPLAY mode look through the file to pick a word or phrase visible more than once in the file to have OA show it can find it. At the field prompt enter @MATCH(C1L240,"yourword") -- note the numbers in C1L240 can be changed to match or show different parts of the line, e.g. C16L12 will show the line segment beginning at column 16 and continuing for 12 columns. And so on. @match(c1l240,"but"){2},C1L75 would have a zero in most of the lines for the first field and would show 75 columns of the second field. If there were a "but" in the line, it would register in the @match formula. In DISPLAY mode we needn't use more than 75 columns since the field is protected from update preventing you from scrolling to the right via {F4}

Okay, this is just for starters to show how EnableOA can make a table out of an html file and how you can find embedded text via @match.

Hang in here:eek:ha:. This is just the opening of the tutorial. More in due season.... /Oafurf
 
Html??

Html??

I'll try and stay up, but the HTML stuff I've left to the younger generations. It surprises me that an HTML file is actually an ASCII file. How far they've come and yet not as far as one may think.

I will be out of the country for a few days (12) so I may be a little behind on the educational responses for a bit.
 
I'll try and stay up, but the HTML stuff I've left to the younger generations. It surprises me that an HTML file is actually an ASCII file.

For any file open in any html editor, check the source code [view source, or something similar] and you will see the ASCII text. When you're looking at a webpage [webpages are html files although if they have php or asp or some such filename extension some HTML editors may not open them thinking they're not html files.]

In sum, a browser or html editor is simply a screen platform to make sense out of ASCII code and show you a prettied up page. The browser interprets the ASCII text particularly the <code between brackets> which tells the browser how to treat the accompanying text, graphics, fonts, etc.

Before WYSIWYG editors and browsers appeared, one had to write the code from scratch, then browse it, then go back and edit it, etc. So yes, it's plain text ASCII designed for browser interpretation.

Therefore understand the principle: EnableOA can read and write ascii text from and to files and can launch html files via .exec_dos
/OAfurf
 
senor cool (I like that) reporting, first assignment done! howzat for keeping up!

Okay, I'm in learning mode myself here, trying new stuff as I go along. For example I renamed my FDF file [field definition file] to C1L240.FDF in order to use it with any future HTML/ASCII file. I didn't have to rename it; Enable defaults the FDF file to the same name as the html file but then you have to respecify field lengths etc. Well, I could use any previous FDF file that has the field length I want, etc. So I just took a notion that C1L240.FDF was cool --as in Senor Cool-- and would be a one-size-fits-all for just about any html file.

That way if one was using a menu macro to open the file the C1L240.FDF would be in the macro code and save the typing.

And don't forget here, the value of putting C1L240.FDF in the Config file so that it can be accessed without having to specify the full path.

Don't hesitate to experiment as you go along and give us all the benefit of any discoveries. /OAfurf
 
Doesn't EnableOA have macros, scripts or so? I suppose you can look at HTML as a big script file, ran through the web browser who parses it. All those script files consist of readable text, so they can easily be edited. Or compare with the Rich Text Format (RTF) if you are familiar with that one.
 
Doesn't EnableOA have macros, scripts or so? I suppose you can look at HTML as a big script file, ran through the web browser who parses it. All those script files consist of readable text, so they can easily be edited. Or compare with the Rich Text Format (RTF) if you are familiar with that one.

Yes, EnableOA does have macros, scripts, etc. It's a development platform that integrates its own spreadsheets, data tables, word processing files via its own menus, macros, etc. For example you can have a spreadsheet which can be used in its own right, but also store a database definition on the same SS which will allow you to run a script against the SS data. Or optionally you can dump the SS data to a DBMS table and run the script against that, and you can even do it with word processing data.

With EnableOA having its own online help files, you can test out/use EnableOA free by downloading it from Thogscave after signing up as a thogs :D denizen. I think the details are in this thread somewhere if I recall correctly. /OAfurf
 
Okay, I'm in learning mode myself here, trying new stuff as I go along. For example I renamed my FDF file [field definition file] to C1L240.FDF in order to use it with any future HTML/ASCII file. I didn't have to rename it; Enable defaults the FDF file to the same name as the html file but then you have to respecify field lengths etc. Well, I could use any previous FDF file that has the field length I want, etc. So I just took a notion that C1L240.FDF was cool --as in Senor Cool-- and would be a one-size-fits-all for just about any html file.

That way if one was using a menu macro to open the file the C1L240.FDF would be in the macro code and save the typing.

And don't forget here, the value of putting C1L240.FDF in the Config file so that it can be accessed without having to specify the full path.

Don't hesitate to experiment as you go along and give us all the benefit of any discoveries. /OAfurf


We could also save a copy transfer file i.e. c1l254.ctf and put it all into a
database, then we get 254 characters per line and we can read and edit them thru database display, I 'm not sure where we are going with it so I don't know if this helps.

I am looking forward to getting an example (or a few) of the types of
OPSYS commands you are using to 'launch' the HTML file thru exec_dos?
Perhaps that's coming in later instalments.
 
We could also save a copy transfer file i.e. c1l254.ctf and put it all into a
database, then we get 254 characters per line and we can read and edit them thru database display, I 'm not sure where we are going with it so I don't know if this helps.

Well, it would help if you had a need to change some lines here or there and then perhaps output the results by just dumping the lines out to a file or whatever but why did you pick 254? I picked 240 because that seems to be the wpf width limit of Enable. But of course an html file can accommodate a much longer line length although most html editors seem to default to even less than 240. Hmmm now where are we going? We want to get to the point where we can use the good ole dummy [or in some cases a disk-based table] to manipulate the html fields as one would do with a secondary table in Enable, with .read commands, .if, .elseif .else etc.

I am looking forward to getting an example (or a few) of the types of
OPSYS commands you are using to 'launch' the HTML file thru exec_dos?
Perhaps that's coming in later instalments.

Ah yes. Okay, lessee! First we need to have a minimal understanding of Window's file associations [you know, where you click on a file and it opens in its default application] because that's how we're gonna open and edit a file from within OA. Have you had a peek at your Windows File Types table? It's the File Types tab in the Folder Options which in turn is found under the topline View option in My Computer -- ie in my neanderthal Win98, if you have an updated version of Windows it might be slightly different to navigate to it.

What is your default html document app? Mine is Mozilla. It doesn't matter for the purpose of launching under Enable. Any html editor can be used. I mostly use Nvu and to a lesser extent Mozilla. Both are freebies.

But what is key here is to navigate to the HTML Document in the File Types, double click on it, then double click on both open and edit just for the purpose of eyeballing the syntax. Within OA we need to launch the file using this exact syntax. I'll give you examples from my XXshell.RPT. Do you have a copy of this script in wpf format? I'm pretty sure it's out on thogs somewhere. I know Rick has a copy of it. It comes bundled with the CHEWZDAT menu but the latter is optional, to be used if you want to use the keyboard rather than the mouse to select a date.

Whew, am I long winded or what? /OAfurf
 
lines out to a file or whatever but why did you pick 254? I picked 240 because that seems to be the wpf width limit of Enable. But of course an html file can accommodate a much longer line length although most html editors seem to default to even less than 240. Hmmm now where are we going? We want to get to the point where we can use the good ole dummy [or in some cases a disk-based table] to manipulate the html fields as one would do with a secondary table in Enable, with .read commands, .if, .elseif .else etc.

* I picked 254 because it is the maximum field length in Enable's database

But what is key here is to navigate to the HTML Document in the File Types, double click on it, then double click on both open and edit just for the purpose of eyeballing the syntax. Within OA we need to launch the file using this exact syntax. I'll give you examples from my XXshell.RPT. Do you have a copy of this script in wpf format? I'm pretty sure it's out on thogs somewhere. I know Rick has a copy of it. It comes bundled with the CHEWZDAT menu but the latter is optional, to be used if you want to use the keyboard rather than the mouse to select a date.

Whew, am I long winded or what? /OAfurf

Please take as much wind as you like! It's all new to me, I have not explored Windows much at all, it all seems like it could take forever and Enable has provided most of the functionality I wanted. I looked at the File Associations -
I ran iexplore.exe with my first prototype HTML file, running from command prompt it just opened the browser, but from a batch file and Enable exec_dos it waited for the browser to close before releasing me back to Enable. I would like to see XXshell.RPT, I 've seen it referred to , but not the file itself. If you could post it or send it that would be appreciated.
suthnsun
 
I ran iexplore.exe with my first prototype HTML file, running from command prompt it just opened the browser, but from a batch file and Enable exec_dos it waited for the browser to close before releasing me back to Enable. I would like to see XXshell.RPT

Probably it couldn't find the html file due to how the path was missing or inadequately assigned, assuming you had the syntax correct. Remember the old days of DOS where you first had to cd your way to the right dir or subdir then issue the command to the .exe or .bat file in THAT dir.

In Windows you don't have to do that. You can express the path within the exe command. When you looked at the file type association it showed you what command line execution takes place behind the scenes when you click on a file to open it.

But there are things to look out for. I'll email you the XXshell.RPT file with the Chewzdat.mnu bundled. It will take you a certain distance with any dummy [I dont use a dummy for this, I use my FILES.DBF table.] I will even bundle in the ZIPP.MNU [which I never bundled in before] which should take you a few steps farther with any text you key into the memo windows. But in order to create the XXshell.htm file you'll need to overwrite e:\SWUpda~1\ with one of your subdirs in the first line of code, i.e.
Code:
.define eggshell = "e:\SWUpda~1\XXshell.htm"
/OAfurf
 
It was indeed finding the HTML file and displaying it in a new browser window, the problem was that the batch file (and likewise Enable thru exec_dos) were being held waiting for the process to finish, so as soon as I closed the browser window the batch file (likewise Enable) proceeded normally. I booted up an old computer running an early version of '98, that ran the batch file OK,
opened the browser and released the initiating command prompt, so it was clearly to do with XP's handling of the processes.

Then I went on a little expedition using schtask.exe which I discovered is XP's task scheduling utility. This worked out in the following fashion direct from OA's exec_dos;

'Schedule' a batch file to open the browser and run in the future

'Test' the scheduled task by running immediately

'Delete' the task

These 'functions' are supported by schtask.exe directly from the command line

So this convoluted solution does actually work, it popped up the requested
browser/html task on demand from OA. ( I can supply lines if wanted)

However this morning I discovered that the following syntax actually accomplishes the task immediately, with no fuss;

.define send ="cmd.exe /c start c:\acc\iexplore.exe c:\acc\mytext.htm"
and later
.exec_dos [send]

The 'cmd.exe /c' opens a new command prompt primed to close when the process is complete
'start' opens the process

It won't run (on my machine at least) without both.

So it has been an interesting excursion, along the way I have found out how
to directly schedule, run and delete tasks controlled entirely by EnableOA and how to open browsers, editors, notepad, EnableOA, etc etc.
The vision is both widening and clarifying.
suthnsun
 
Bravo southnsun; that's what I meant a while back about letting us have the benefit of any discoveries made along the way. Sounds like XP Windows takes more control of the processing queue than Win98 and makes you wait.

As I was driving the back roads today I began to think that I left out something about XXshell, Chewzdat, etc. and that is the ultimate goal of the code. I get reports by email from 10 to 15 cities and these reports are copy/pasted into EnableOA and need to come flying outta Enable as nicely colored and sectioned HTML files. In the beginning I did the first ones by hand in Mozilla, later in NVu and decided that I could make Enable do the grunt work.

I wanted OA to let me point/shoot at the date, mouse [or type a single letter for] the location, snatch the reporter's name and matching graphic and so on, color the html sections randomly using the @rand function. Along the way I wanted an Enable user menu that allowed me to insert html code [the ZIPP.MNU] bang-bang, and do other things like close the memo windows, insert divs and spans, italics, bold, underlines, etc. Also all my interim menus have to be able to pause the app and open the Master Menu in case I need to do something else in the short term.

I wanted Enable to output the report in the color shell with a third top section for javascript moveables for emailing to a listserv. Then when that section is removed manually and the Mozilla window closed I want Enable to open the saved file, read through it and create another file with a unique name [other than xxshell.htm, i.e. a name that reflects date and location], match it to the reporter's name and assign this sort of information to fields in the current db table [FILES.DBF] and write a new record for that new file in such wise that I could use an Enable menu to point and shoot at the filename and have it open in the html editor for viewing and/or printing.

Beyond that I wanted Enable at the end of each month to auto-collect all the report files that are more than 3 months old, whirl them into one big file [with each report showing it's original name, and sling the big file into a Winzzip archive while simultaneously deleting the matching records AND erasing the files from disk]. To create the big file, Enable has to bypass the headers and body tags/lines on all but the first file and last file. Oh for the beauty of @match.

So the app begins with system menus that set up the FILES.DBF display screens, call menus to initiate the above tasks, track what's open in what window and on and on including my last two tweaks 1. making the thumb drive replicate the entire list of files, both Enable's db and the matching html files and 2. cosmetically adding an "l" to htm so that now the filenames in the DISPLAY screen show up as html even though on disk they're "htm".

The tiered Enable custom menus also have to be able to open and close all the scripts, menus, perform files, html files, etc. and track them in their respective windows.

Whew am I long winded or what?? But I thought that if you had the overview of the entire app, it would help to contextualize the code in XXshell.RPT.

Does this :confused:help, or does it :eek:overwhelm? /OAfurf
 
I've been 'flat out like a lizzard drinking' as they say down here in suthnsunland.

I think I get the gist of the xxshell.rpt, I have not had time to explore the intricacies yet. I have only an embryonic knowledge of HTML tags so I need to get some time to read up about them. I am also seeing references to PHP
and I had a quick look at some PHP information online, it looks quite interesting and not too dissimilar syntax to OA's procedural language from
the little I saw.

The question which comes to mind with OA communicating with the operating
system and seeing what you have been able to generate out of OA with
xxshell, have you discovered any ways for OA to 'hear' or pick up output of some kind from the operating system? (apologies if I have missed something
out of your description)
suthnsun
 
I've been 'flat out like a lizzard drinking' as they say down here in suthnsunland.

And I've been out of state schnorring in Maryland but am responding here from a motel in York Pennsylvania.

I am also seeing references to PHP
and I had a quick look at some PHP information online, it looks quite interesting and not too dissimilar syntax to OA's procedural language from
the little I saw.

Now where did you see php? I have some php code on my website mostly to execute its forms but wasn't aware of any php references that involved EnableOA. But my memory is unreliable so it could be there.

The question which comes to mind with OA communicating with the operating system and seeing what you have been able to generate out of OA with xxshell, have you discovered any ways for OA to 'hear' or pick up output of some kind from the operating system? (apologies if I have missed something out of your description) suthnsun

Nada. DOS based software like Enable has no OLE [Object linking and embedding] capabilities which many Windows programs have for inter-communication. Enable couldn't receive commands etc. from other programs the way it can send to them, er ah, well not exactly because I suddenly remember that quite a few years ago I set up file associations for EnableOA whereby a user clicking on a wpf file would watch it open in Enable's word processor and the same with at least the SSF files. It's been a while and I can quite remember what I did. /OAfurf
 
As far as I know, when you look at the source of a webpage, the PHP code itself doesn't show up, thus you can't really see it unless you have the script itself. I could be mistaken and be thinking of something else thought, but I vaguely remember something along those lines.

-VK
 
Unless the web server is misconfigured.. ;-) But of course on PHP.net you have the full documentation and code examples. How it compares to OA's procedural language, I have no clue, but most programming languages in this paradigm are reasonably similar to eachother. In any case, it might be interesting to know that PHP is used as a scripting language in more places than just web applications, although it where you see it the most. Just like e.g. Perl, it can be used most anywhere. For example the Noteworthy Composer 2 uses PHP for user defined macros/functions.
 
Yup, the server has to have the PHP parsing engine and typically the script file to be executed will have a php filename extension and show something in the opening line like #!/usr/local/bin/php which the server will check when the file is first stored on the system.

The most you'll see in a webpage if you check the source code is the name of the file that contains the php code but you wont see the code itself. Run the letters php in the Find or Search option and you'll catch it since it's preceded by a period in the script, e.g. DoThis.php Also php code can be executed right in the url line itself. We used to see it some years back but I haven't observed any in a while.

That php file can have embedded html code -- in which case when the php parser is needed to do its thing, it has to be alerted with a line or section beginning <?php -- here you put the php script to be parsed and end with ?> Here's an example from my website [I'll bet you can figure out what does what]. The name of the file is sara_reg.php and it's there to receive the Submit click on an event registration form that the user fills out online at the web page. This one tells the php engine to make an email out of the typed in data and email it to several people and email the registrant an acknowledgment. The email is not the ECHO lines. That's just telling the php engine to send a message to the screen.

When I'm old and nodding, maybe I'll have the time to write an OA script that will open a window and provide menus, clicks, dropdowns etc. which will allow me to create an embedded php/html script like the one below. Hi Ho Enable....OA. Enjoy. /OAfurf

Code:
#!/usr/local/bin/php
<body alink="#000099" vlink="#990099" link="#000099"
style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 68);">
<br>
<?php
	$msg = "\tYour submission From The Oh Saratoga! Registration Online Page.\n\nIf there are any corrections please reply to this message.\n\n\t$reg_name\n\t$reg_add1\n\t$reg_add2\n";
	$msg .= "\t$reg_city $reg_state $reg_zip\n\nTel:\t$reg_tel\tEmail: $reg_email\n\n";
	$msg .= "Meals:\t$meals\tYou Checked: [$Registeras] for Registration and You Checked $Lodging\n\n";
	$msg .= "Message:\t$reg_message\n\n";
	$mailheaders = "From: Maranatha@OhSaratoga.com\nReply-To: FrFrancis@OhSaratoga.com\n";
	$mailheaders .= "CC: jeff@OhSaratoga.com \nCC: JohnSmith@OhSaratoga.com\nCC: FrFrancis@OhSaratoga.com\n";
	mail("$reg_email", "Welcome to the Oh Saratoga! Family", $msg, $mailheaders);
	echo "<H1 align=center>Thank You, $reg_name</H1>";
	echo "<P align=center>A copy of what you filled in has been sent to your email address for your review</P>";
?>
<CENTER><font color="#CCFF00"><font size=+2><a href="http://OhSaratoga.com">Main Oh Saratoga Website</a><br>
or<br><a href="javascript:window.close();">Close Window</a><br></font></font></CENTER>

</body>
 
It's more than just OA

It's more than just OA

OAfurf,
I didn't realize your progamming talents went so far beyond OA's world. :grin: It's obvious that your knowlegde in this area is used for more than Oh Saratoga!!

Also noticed that this thread is one of the hotest hits on Vintage, way to go!!
 
OAfurf,
I didn't realize your programming talents went so far beyond OA's world. :grin: It's obvious that your knowledge in this area is used for more than Oh Saratoga!!

Also noticed that this thread is one of the hottest hits on Vintage, way to go!!

MidMich: you say the nicest things. In general I learn just enough to fool everyone into thinking I know more than in fact I do. I usually hit the programming docs to solve the problem I'm currently wrestling with, then I move onto other things. Except with EnableOA. There I like to know all there is to know and use the extra knowledge to decorate the screen and add bells and whistles. Bravo :D EnableOA. /OAfurf

P.S. Came back on to re-edit this page when I saw it was message #100. Keep this thread moving you guys.
 
Last edited:
Back
Top