Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.* 1 > Newsgroup comp.lang.clipper.visual-objects

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 07-29-2012, 08:44 PM
bob.morris@gmail.com
Guest
 
Posts: n/a
Default How do I import Clipper PRGs into Visual Objects?

Import in VO appears to want MEF files to import into the app. I have a Clipper app that I need to import into VO (and then into Vulcan.)

File / Import in VO asks for MEFs. Do I need to someohow convert the Clipper PRGs to MEFs? Any help appreciated. The cavo docs don't seem to mention any of this.

Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 07-29-2012, 09:13 PM
Urs Eggmann
Guest
 
Posts: n/a
Default Re: How do I import Clipper PRGs into Visual Objects?

Hi Bob,

The "bad" news first: There is no direct way to import Clipper Code to VO.
Clipper is a procedural character-based program language and VO is a event
driven graphical Windows development system. This are two almost completely
different worlds.

The somewhat better news now:
There are some possibilities to go from Clipper to a graphic user interface:
www.alaska-software.com has something like this.
http://www.experts-exchange.com/Prog..._22032997.html

Try to find the solution by Google....

Regards
Urs


<bob.morris@gmail.com> schrieb im Newsbeitrag
news:503c29e6-69d3-430e-aa2f-0460afe75dee@googlegroups.com...
> Import in VO appears to want MEF files to import into the app. I have a
> Clipper app that I need to import into VO (and then into Vulcan.)
>
> File / Import in VO asks for MEFs. Do I need to someohow convert the
> Clipper PRGs to MEFs? Any help appreciated. The cavo docs don't seem to
> mention any of this.
>


Reply With Quote
  #3 (permalink)  
Old 07-29-2012, 09:40 PM
Carlos Rocha
Guest
 
Posts: n/a
Default Re: How do I import Clipper PRGs into Visual Objects?

> Import in VO appears to want MEF files to import into the app. I have a Clipper app that I need to import into VO (and then into Vulcan.)
>
>
>
> File / Import in VO asks for MEFs. Do I need to someohow convert the Clipper PRGs to MEFs? Any help appreciated. The cavo docs don't seem to mention any of this.


From the code editor you can import .prg
__
Carlos Rocha
Reply With Quote
  #4 (permalink)  
Old 07-30-2012, 12:22 AM
Bob Morris
Guest
 
Posts: n/a
Default Re: How do I import Clipper PRGs into Visual Objects?

I spoke with Vulcan and they said it was possible to import Clipper code to VO but they hadn't actually used VO in five years and couldn't quite recall how to do it. (That's not a putdown, they were helpful, VO is old, and I'm using the free demo version.)

I've used xHarbour in other Clipper conversions. This client want to go to .NET and Vulcan uses .NET and can import from VO.

Is there any way to get xHarbour to use .NET?


On Sunday, July 29, 2012 2:13:11 PM UTC-7, Urs Eggmann wrote:
> Hi Bob,
>
>
>
> The "bad" news first: There is no direct way to import Clipper Code to VO.
>
> Clipper is a procedural character-based program language and VO is a event
>
> driven graphical Windows development system. This are two almost completely
>
> different worlds.
>
>
>
> The somewhat better news now:
>
> There are some possibilities to go from Clipper to a graphic user interface:
>
> www.alaska-software.com has something like this.
>
> http://www.experts-exchange.com/Prog..._22032997.html
>
>
>
> Try to find the solution by Google....
>
>
>
> Regards
>
> Urs
>
>
>
>
>
> <bob.morris@gmail.com> schrieb im Newsbeitrag
>
> news:503c29e6-69d3-430e-aa2f-0460afe75dee@googlegroups.com...
>
> > Import in VO appears to want MEF files to import into the app. I have a

>
> > Clipper app that I need to import into VO (and then into Vulcan.)

>
> >

>
> > File / Import in VO asks for MEFs. Do I need to someohow convert the

>
> > Clipper PRGs to MEFs? Any help appreciated. The cavo docs don't seem to

>
> > mention any of this.

>
> >


Reply With Quote
  #5 (permalink)  
Old 07-30-2012, 12:24 AM
Bob Morris
Guest
 
Posts: n/a
Default Re: How do I import Clipper PRGs into Visual Objects?

Thanks for the reply. When I import into a PRG it says "the following line(s) is not part of any entity and will be saved in a TEXTBLOCK entity" which clearly is not what I want. Hmmm.

On Sunday, July 29, 2012 2:40:30 PM UTC-7, Carlos Rocha wrote:
> > Import in VO appears to want MEF files to import into the app. I have a Clipper app that I need to import into VO (and then into Vulcan.)

>
> > File / Import in VO asks for MEFs. Do I need to someohow convert the Clipper PRGs to MEFs? Any help appreciated. The cavo docs don't seem to mention any of this.

>
> From the code editor you can import .prg

Reply With Quote
  #6 (permalink)  
Old 07-30-2012, 12:40 AM
Carlos Rocha
Guest
 
Posts: n/a
Default Re: How do I import Clipper PRGs into Visual Objects?

Well, that's because something was not understood by VO, so a valid entity could not be created (define, function, procedure,...). You must "adapt" the syntax to VO. Please provide the code that is saved as a textblock so someone can help you.
__
Carlos Rocha
Reply With Quote
  #7 (permalink)  
Old 07-30-2012, 01:19 AM
Bob Morris
Guest
 
Posts: n/a
Default Re: How do I import Clipper PRGs into Visual Objects?

On Sunday, July 29, 2012 5:40:03 PM UTC-7, Carlos Rocha wrote:
> Well, that's because something was not understood by VO, so a valid entity could not be created (define, function, procedure,...). You must "adapt" the syntax to VO. Please provide the code that is saved as a textblock so someone can help you.
>
> __
>
> Carlos Rocha


I'm attempting to import the starting Clipper program, menu.prg

Here's the program. Way old school code.

-------------------


#include "inkey.ch"
#include "box.ch"
#define true .T.
#define FALSE .F.
#define TEXT

PUBLIC cRPTHDR

procedure MENU


** "Seed" the random number generator
random( Seconds() * Day( date() ) * Month( date() ) * Year( date() ) )

do while .T.
CLOSE ALL
x=1
clear all
SET COLOR to gr+/b
clear
set talk off
STORE Right(Str(Year(date())),4) to YEAR
STORE Left(YEAR,1) to YEAR1
STORE SubStr(YEAR,2,1) to YEAR2
STORE SubStr(YEAR,3,1) to YEAR3
STORE Right(YEAR,1) to YEAR4
STORE YEAR1+" "+YEAR2+" "+YEAR3+" "+YEAR4+" " to YEAR
set safety off
set scoreboard off
set status off
set confirm off
set bell off
set function 10 to "?;"
PUBLIC CLIPPER
IF CLIPPER
SET ESCAPE ON
ELSE
SET ESCAPE OFF
ENDIF
set device to screen
@0,0 to 24,79 DOUBLE
@ 2,35 say Year
SELECT 2
USE TOURNEY
STORE TOURNEY to TOURNAMENT
USE
SELECT 1
TOURNAMENT=Trim(TOURNAMENT)
STORE Len(TOURNAMENT) to TOURLEN
@ 4,40-(TOURLEN/2) say TOURNAMENT
**** ADDED 1/2007
cRPTHDR:=StrTran(YEAR," ","")+" "+TOURNAMENT
****
SET COLOR to w+/r
@6,17 clear to 19,61
set color to n/n
@20,19 clear to 20,63
@7,62 clear to 19,63
SET COLOR to w+/r
SET WRAP ON
@ 7,22 Prompt " 1. Add a Player"
@ 8,22 Prompt " 2. Edit a Player"
@ 9,22 Prompt " 3. Add a Team"
@10,22 Prompt " 4. Edit a Team"
@11,22 Prompt " 5. Game Entry"
@12,22 Prompt " 6. Check Player's Score"
@13,22 Prompt " 7. Individual Reports/Lists"
@14,22 Prompt " 8. Team Reports/Lists"
@15,22 Prompt " 9. Add/Edit/Print Geo. & Ctrl. Codes"
@16,22 Prompt "10. Instructions/Help/Utilities"
@17,22 Prompt "11. EXIT Program"
@19,23 SAY "Press menu number or use "+CHR(24)+CHR(25)+" keys"
* @21,70 GET lOK QUITPB && WHEN !(LASTKEY()=K_ENTER .OR. LASTKEY()=K_PGDN .OR. LASTKEY()=K_CTRL_W)
* READ
SET COLOR to gr+/b
@22,30 SAY "Press <ESC> to Exit"
SET COLOR to w+/r
MENU to x
IF LASTKEY()=K_ESC
SET COLOR to w/n
CLS
quit
ENDIF

do case
case x=1
do addplay
case x=2
do editplay
case x=3
do addteam
case x=4
do editteam
case x=5
do gamemenu
case x=6
do player
case x=7
do INDMENU
case x=8
do TEAMMENU
case x=9
do geoMENU
case x=10
do help
CASE x=11
SET COLOR to W/N
CLS
RETURN
endcase
CLEAR ALL
enddo

*--- These are printer functions used to print reports ----------------

FUNCTION SETPRFL(cFNM)

SET PRINT to (cFNM+".txt")
SET DEVICE to PRINT
SET PRINT ON

RETURN
*----------------------------------------------------------------------
FUNCTION PRTFL(cFNM)
LOCAL nSTART:=Seconds(),lD:=.f.,cSCR,nOFF:=5
SET PRINT OFF
SET DEVICE to SCREEN
SET PRINT to
CLS

#ifndef WIN98
WHILE Seconds()<nSTART+1.5
if !lD
SET COLOR to N/N
@8,15+nOFF CLEAR to 14,54+nOFF
@8,15+nOFF,14,54+nOFF BOX B_DOUBLE color "R+/N"
SET COLOR to G+/N
@10,20+nOFF SAY [REPORT DISPLAYED in "WORDPAD"]
@12,17+nOFF SAY [Press "WORDPAD" Print Icon to print]
lD:=.t.
endif
ENDDO
SET COLOR to W+/B
#endif

#ifndef WIN98
RUN ( "write "+cFNM+".txt" )
#else
RUN ( "copy "+cFNM+".txt LPT1" )
#endif

INKEY(1)

RETURN

*---------------------------------------------------------------------------
Function random( s )
local aRN:={38833,37171,11903,18233,31337,23339,27481,31 063, ;
34543,36299,13691,17659,29411,16807},x
Static a := 16807 // This is just a lucky prime number to start
Static seed:=0
Static lC:=.F.

// you can hardcode these as constants for better speed
local m := ( 2 ^ 31 ) - 1
local q := int( m / a )
local r := int( m % a )

if ValType( s ) == 'N'
seed := s
endif

seed := a * ( seed % q ) - r * ( seed / q )

IF seed <= 0
seed += m
endif

if !lC
x:=int(( seed - 1 ) / ( m - 2 )*14)
a := iif(x>0,aRN[x],a)
lC:=.T.
* alert(str(a,10))
endif

return ( seed - 1 ) / ( m - 2 )

*---------------------------------------------------------------
FUNCTION DISPMA()

MSETCURSOR(true)
#ifndef TEXT
MSHOW(LLM_CURSOR_ARROW)
#endif

RETURN nil

*-----------------------------------------
FUNCTION MWAIT()
? "Press any key to continue..."
SET EVENTMASK to INKEY_KEYBOARD
do while .t.
x=inkey(0)
if x>0
exit
endif
enddo
SET EVENTMASK to INKEY_ALL
RETURN

************************************************** ***********
FUNCTION STUFFKEY(cKEY)
LOCAL cDEF:=K_ENTER

IF PCount() = ZERO
cKEY = cDEF
ENDIF
KEYBOARD CHR(cKEY)

RETURN nil

*-------------------------------------------------------------------
Reply With Quote
  #8 (permalink)  
Old 07-30-2012, 03:01 AM
Stephen Quinn
Guest
 
Posts: n/a
Default Re: How do I import Clipper PRGs into Visual Objects?

Bob

If you get 20 lines of that imported code working in VO you'll be very lucky
(and that's only 1 .prg<g>).

VO (after V2.0) doesn't use @ say co-ordinate system so that's a total
rewrite
and none of the printer stuff works that way in VO
- matter of fact your whole interface will require changing<g>

You'd be better off bringing in code that has your business logic in it and
start converting that.
I suggest you start by
Creating DBServers to handle your DBFs
Build your menus in the menu editor
Design your windows for data entry/display
Tie them all together with your business logic

Seeing what your starting with I'd even go so far as saying you should start
over new with C# and .NET and forget converting to VO/VULCAN altogether.

CYA
Steve


Reply With Quote
  #9 (permalink)  
Old 07-30-2012, 03:03 AM
Carlos Rocha
Guest
 
Posts: n/a
Default Re: How do I import Clipper PRGs into Visual Objects?

Oh my god. The menu... *snif*

You have no chance to port that to VO, sorry.
I suggest you to import it to VO (even with the TEXTBLOCKs result), then from Vulcan, and change the code inside Vulcan. But forget about stuff like "inkey", "keyboard", "@x, y ...". In Vulcan you have better and easier ways to provide menus and ask for input.
__
Carlos Rocha
Reply With Quote
  #10 (permalink)  
Old 07-30-2012, 05:12 AM
Bob Morris
Guest
 
Posts: n/a
Default Re: How do I import Clipper PRGs into Visual Objects?

Carlos and Stephen.Thanks for the advice and help. I appreciate it.

After I looked at VO docs and played with it a bit I figured your answers were what was coming. Yes, the code is paleolithic, isn't it?

It'll probably compile and run fine as a console app in xHarbour. Maybe that'll be a stopgap measure for the client so it can at least run in Windows until we can port to .NET.

Among other things, I have a niche business converting these dinosaur apps to Windows. I'm currently doing two conversions to VFP for Clipper apps that have been running companies with yearly billings in the millions since 1992.

Another client has a mission-critical highly-visible Clipper app that they don't want to convert, so I support it.

xHarbour is supposed to be 100% Clipper compatible but I just found an app where it wasn't as they were doing completely psychotic things with function keys inside GETs and it didn't work in xHarbour.

I get to look at a lot of bad code.


On Sunday, July 29, 2012 8:03:17 PM UTC-7, Carlos Rocha wrote:
> Oh my god. The menu... *snif*
>
> You have no chance to port that to VO, sorry.

Reply With Quote
  #11 (permalink)  
Old 07-30-2012, 09:11 PM
D.J.W. van Kooten
Guest
 
Posts: n/a
Default Re: How do I import Clipper PRGs into Visual Objects?

On Sun, 29 Jul 2012 22:12:37 -0700 (PDT), Bob Morris
<bob.morris@gmail.com> wrote:

Hello Bob,

>I get to look at a lot of bad code.



I don't think the code is bad, it's a little bit outdated <g>.

I think the best you can do is install the 30 days Vulcan version,
Chris' editor Vide and start looking at the many samples around. You
will learn to use designers for windows and menu's. That saves you all
the effort of defining colours and positions.

Windows programming is event based. If you put a button on a window
there will be a click event, linked to that button. That click event
starts when the user presses the button, e.g. save the content of
singelineedits and other Windows controls on your window in fields of
a dbf. It is usually a so called method beloninging to a class with
methods which serve a similair purpose. In this case the class will be
the name of your window and all methods exclusively work on that
window. If you have a second window, and a button which will do
(almost or exacly) the same thing, you will have to copy that method
of class MyWindow1 to the class MyWindow2 to have it working. Of
course doing so would be bad programming habit; so you will quickly
learn how to write classes which can be used by multiple parts of your
program (e.g. all save buttons). That is the basic principle of Object
Oriented Programming.

As Vulcan is .Net based, one main advantage is that lots of more
complex programming can be done in a few lines of code so you can
concentrate on your program's business logic . Things which are either
impossible in Clipper/Harbour and partly also in VO, or at least
require a lot of code. Examples reach from reading/writing the
registry to manipulation of multimedia files.

Vulcan also uses .prg files while VO has an elaborate organization of
code called the repository. As I consider this (.Net common) way of
organizing and editing code a major step back, it will look familiair
to you. But you must realize that the only code you can more or less
use is probably your Random function (as this contains mainly
calculations...and you won't even need it as their is a built in
VO/Vulcan function for it), and reading/writing data from/to dbf's
with some change.

Should you want to start with VO, the best way to have a full
impression of how you program a complete applications is to open the
South Sea Adventure (SSA) sample.

I hope this helps a bit in getting you started.


Dick
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 05:48 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.