Clipper, XBase++ Conversion
Here are some XBase++ routines and notes that I have written during my Clipper/XBase++ conversion investigations..
Hybrid
PROMPT/MENU TO and ALERT
This zip file contains
routines to provide a hybrid CRT modal dialog for Menu and Alert
replacements for Clipper Menu To and Alert functions. The base
code from Alaska has been modified to provide a better Pushbutton
placement and width.
To use, link in AKMENU.PRG to override
the Clipper Alert function. To use the Menu To replacement, add #include
"MenuTo.CH" before issusing any PROMPT
commands.
--->
Clipper
@...SAY...GET to XBPStatic and XBPSLE
This zip file contains routines to translate Clipper's @..SAY..GET into XBase++ Parts - XBPStatics and XBPSles. I have modified XbpGet.PRG to include Up/Down arrows and the Enter key to move between SLE's as well as other keys. Importantly there are two functions - AK_GET() and AK_SAY(). These are automatically translated to if you add #include XbpGet.CH at the start of your program and including the new XbpGet.PRG into your compile/link script. Also change all your colours to N/W.
To use the VALID
clause, change the editing variable to x:editbuffer()
in the VALID.
For example : GET cTest VALID .not.empty(cTest) has to be changed
to
GET cTest VALID .not.empty(x:editbuffer()) etc. - NOT
NEEDED ANY MORE (15/4/98)
Both RANGE and WHEN clauses are now working. (15/4/98).
Added functionality in WHEN - ALL the GETS in the screen will be abled/disabled based on their WHEN conditions. This is done everytime you move between the Gets. Please run the MT.PRG test progam.
These routines convert the Gets and Says as I mentioned above. The Gets use the existing getlist array and this has to be declared as PRIVATE at the start of your function and cleared BEFORE you exit that function: PRIVATE getlist := {} at the start and CLEAR GETS at the end otherwise you will have rouge XBPSLE's left on the screen.
With the Says, you can leave them as normal hybrid screen output (there is a RETURN near the start of AK_SAY() function), or you can get AK_SAY() to convert them to proper XBPStatics. To do this, comment/remove the 6 odd lines. Declare a saylist array at the start of you function and again clear the saylist array at the end of your function: PRIVATE saylist := {} at the start and CLEAR SAYS at the end otherwise you will have rogue XBPStatis left on the screen. In the include file, I have also cleared the saylist whenever you issue CLEAR to clear the screen. You can use this if you like or comment it out.
Multiuser considerations: If you want to update fields as you go, the oXbp:Datalink code in AK_GET() locks, updates and unlocks the field. I used this system when I originally converted a large system by changing getsys.prg. I made the same changes in XBase++ and it works okay. Please note the code in Datalink needs more work. If you want to update at the end of all gets, you will have to make changes to the Datalink, the key handling routine for XBPGet and the READ system in XBPGet.CH.
Please note that this is Work In Progress and ANY help will be highly appreciated.
History:
17 April 98
- Fixes to XBPStatics
16 April 98
- make GetActive() work
- Validation on DATES - Test CENTURY and EPOCH
- Post translated data to the screen before leaving (dates etc)
- make SET CONFIRM to work - auto skip to next get
- new HIDDEN clause for passwords
15 April 98
- The original Clipper VALID conditions DO NOT need to be changed to x:editbuffer anymore
- Get the RANGE clause working
- Tidyup XbpGet.CH
- BIG ONE - get the WHEN clause working - updates ALL Gets every time you move
- Redo length calculations for gets using transform/picture
- include sample program MT.PRG with notes to compile, link and run
14 April 98
- Fixes to reset GET focus after VALID function calls
- Comment out Locking system for the time being13 April 98
- Get VALID working
12 April 98
- It works !!!
MORE TO COME...
You are visitor
This page hosted by Get your own Free
Home Page
©1998 Ashok Kumar, ISL NZ
Ltd., PO Box 1574, Dunedin, New Zealand