1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How To Use Mpro

Discussion in 'Development' started by Jeff Winchell, Apr 13, 2017.

  1. Jeff Winchell

    Jeff Winchell Member

    Environment is character mode Linux on a machine with QAD installed. I use putty on a Windows 7 PC to ssh into the Linux machine. I suspect this is part of my challenges.

    I have tried to use MPRO to do some ABL commands that clearly won't work running on SQLENV.

    I can't seem to copy and paste anything into the mpro editor. backspace key seems to function like the delete key. arrow keys only work sometimes. and other issues.

    I cannot figure out how this ancient editing interface works. Youtube has 0 results found when searching it on mpro openedge
    That is a REALLY bad sign

    Progress's own documentation
    OpenEdge 11.7 Documentation
    is super lame.

    Somewhere, maybe on a usenet group archived by yahoo groups or the wayback machine there is some files telling me how to use this.

    Because I need to test the database natively (not compounding to the difficulty by dealing with ODBC), and certain things don't seem possible in Progress's SQLENV, MPRO seems to be my only choice of tools sitting on this QAD installation for this.

    If I am wrong about that please advice.

    If you have some tips for how someone who last used a primitive editor in 1986 (DOS edlin), can make productive use of mpro, I'm all ears.
    Last edited: Apr 13, 2017
  3. TomBascom

    TomBascom Curmudgeon

    It sounds like you have PuTTY setup to send DEL on backspace (I think that's the default). Right-click the icon in the upper left of the PuTTY window, "change settings", "keyboard". Also -- "xterm" usually works best.
  4. Rob Fitzpatrick

    Rob Fitzpatrick ProgressTalk.com Sponsor

    I wouldn't say so. I do the same.

    Editor keybindings are influenced by:
    • your shell's terminal emulation ($TERM);
    • your PuTTY emulation settings;
    • the individual control code settings in the appropriate section(s) of the protermcap file.
    Like Tom, I use TERM=xterm on Linux. Usually tweaking PuTTY settings is enough. If you need to adjust individual keybindings, they can be tweaked in the xterm section of protermcap. This is a text file that resides in the $DLC directory, so its settings affect all users who use the defaults. You can have your own custom settings by copying it to your own directory, editing it as needed, and setting and exporting the PROTERMCAP environment variable. This is explained in the Installation and Configuration manual.

    You won't find too much OE info on YouTube beyond high-level marketing stuff.

    The KB is a useful resource for topics that aren't dealt with in depth in the docs: knowledgebase.progress.com.
  5. Rob Fitzpatrick

    Rob Fitzpatrick ProgressTalk.com Sponsor

    The character editor is "vintage". Pasting into it works once your terminal emulation is set up properly, though pasting indented code throws it off. If I want to paste more than a few lines of indented code, I typically paste into vim, save the file, then open in the editor. Once you get the hang of ABL your really don't need to do editing work in the editor; just use it for syntax checking, running code, etc.

    If you want a better editor and your company is willing to invest in development tools, there is a Windows-based IDE called Progress Developer Studio for OpenEdge (PDSOE), which is based on Eclipse. You could download the evaluation version and see if it suits your needs.
  6. Rob Fitzpatrick

    Rob Fitzpatrick ProgressTalk.com Sponsor

    Some general advice if you're going to be using and doing administration on an OpenEdge application like QAD: while it's good to have SQL knowledge, don't try to rely entirely on interacting with the database via OpenEdge SQL. Some tasks are easier in SQL than in ABL. Some are easier in ABL than in SQL. Once you learn the basics you can be productive pretty quickly.
  7. Jeff Winchell

    Jeff Winchell Member

    In Putty's settings for Connection|Data|Terminal Details|Terminal-types string I changed the default value of xterm to linux and standard editor keys (delete/backspace/home/end, arrow keys,etc) all worked as expected, but then the Function keys stopped working, though I saw on a thread you (Rob) contributed to on another website that esc m will get me to the menu. I will do this for now as "good enough".

    So I tried to do a compile check on a simple line of code.
    If Can-Find(txz_mstr.txz_tax_zone Where txz_mstr.txz_tax_zone=?) Then Display "txz_mstr.txz_tax_zone".
    this generated an error about database name, but I thought that my loading mpro mydatabasename would set the intitial database context for the code I wrote. That doesn't seem to work so I don't know why one bothers with passing a databasename as a parameter to launching mpro.
    From some other reading it looks like I have to create two files, a main program file which connects to the database and then calls the second program. But I don't understand how the mpro environment knows this. If I am checking code in the second program, how would it know my database context.

    Clearly Progress's mpro has a different way of doing things than the two dozen or so other DBMS/db app dev environments that I have used. So I need to figure out how to do some basic stuff here.

    (FWIW, I seriously doubt I will ever get far into Progress programming, I just need to do some simple tasks when I can't do something using a non-progress client tool accessing progress data via ODBC or some other db driver)
  8. Rob Fitzpatrick

    Rob Fitzpatrick ProgressTalk.com Sponsor

    mpro dbname does establish a connect to database dbname.

    It would be easier to diagnose the error if you showed us what the full text of the error message actually was.

    I think you may be confusing this situation with the programmatic use of database aliases. If you are connected to two or more databases and you want to, for example, iterate over those databases and read from each DB's _File table, you would create a calling program that iterates over the connected databases, setting an alias for the currently-selected database, and running a called program. The called program would then read the data from <alias>._File and return to the caller.

    The point there is that you cannot both set and refer to a database alias name within a single procedure. That restriction isn't relevant to your described situation. Your assumption about mpro is incorrect.
  9. TomBascom

    TomBascom Curmudgeon

    This code:
    Code (progress):
    2. if can-find(txz_mstr.txz_tax_zone where txz_mstr.txz_tax_zone=?) then display "txz_mstr.txz_tax_zone".
    is confusing me.

    Is the db name txz_mstr? Or is that a table name?

    Is tax_zone a table? Or a field? "where txz_mstr.txz_tax_zone = ?" would be table.field - if txz_mstr is a db name then the WHERE clause should be "where txz_mstr.txz_tax_zone.somefieldname = ?"

    If txz_mstr is a table name then the code should be:
    Code (progress):
    2. if can-find( txz_mstr where txz_mstr.txz_tax_zone = ? ) then display "txz_mstr.txz_tax_zone".
    If it is the dbname then you can almost always omit the dbname -- while possible, it is very rare for 4gl code to be written with dbname.table or dbname.table.field. The exception is cases like Rob mentions where you are iterating over several possible databases that all have the same table names in them. But that's very unusual.

    It might be also be useful to display the RECID of records with an unknown value for the field:

    Code (progress):
    2. for each txz_mstr no-lock where txz_mstr.txz_tax_zone = ?:
    3.   display recid( txz_mstr ).  /* or display a list of other fields that might help track down the problem records */
    4. end.
    (assuming txz_mstr is a table name and txz_tax_zone is a field that you are worried may have unknown values)
  10. Jeff Winchell

    Jeff Winchell Member

    THAT is the solution to my confusion/the confusing error messages. Thank you!

Share This Page