Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #3872 > unrolled thread

How do I import Clipper PRGs into Visual Objects?

Started bybob.morris@gmail.com
First post2012-07-29 13:44 -0700
Last post2012-07-30 23:11 +0200
Articles 11 — 6 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  How do I import Clipper PRGs into Visual Objects? bob.morris@gmail.com - 2012-07-29 13:44 -0700
    Re: How do I import Clipper PRGs into Visual Objects? "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2012-07-29 23:13 +0200
      Re: How do I import Clipper PRGs into Visual Objects? Bob Morris <bob.morris@gmail.com> - 2012-07-29 17:22 -0700
    Re: How do I import Clipper PRGs into Visual Objects? Carlos Rocha <jazzda1307@gmail.com> - 2012-07-29 14:40 -0700
      Re: How do I import Clipper PRGs into Visual Objects? Bob Morris <bob.morris@gmail.com> - 2012-07-29 17:24 -0700
        Re: How do I import Clipper PRGs into Visual Objects? Carlos Rocha <jazzda1307@gmail.com> - 2012-07-29 17:40 -0700
          Re: How do I import Clipper PRGs into Visual Objects? Bob Morris <bob.morris@gmail.com> - 2012-07-29 18:19 -0700
            Re: How do I import Clipper PRGs into Visual Objects? "Stephen Quinn" <stevejqNO@bigpondSPAM.net.au> - 2012-07-30 13:01 +1000
            Re: How do I import Clipper PRGs into Visual Objects? Carlos Rocha <jazzda1307@gmail.com> - 2012-07-29 20:03 -0700
              Re: How do I import Clipper PRGs into Visual Objects? Bob Morris <bob.morris@gmail.com> - 2012-07-29 22:12 -0700
                Re: How do I import Clipper PRGs into Visual Objects? D.J.W. van Kooten <public@ic2remove.this.com> - 2012-07-30 23:11 +0200

#3872 — How do I import Clipper PRGs into Visual Objects?

Frombob.morris@gmail.com
Date2012-07-29 13:44 -0700
SubjectHow do I import Clipper PRGs into Visual Objects?
Message-ID<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.
 

[toc] | [next] | [standalone]


#3873

From"Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Date2012-07-29 23:13 +0200
Message-ID<a7lnc1F432U1@mid.individual.net>
In reply to#3872
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/Programming/Misc/Q_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.
> 

[toc] | [prev] | [next] | [standalone]


#3876

FromBob Morris <bob.morris@gmail.com>
Date2012-07-29 17:22 -0700
Message-ID<b2479efc-55aa-4bcb-a0a3-4b92ce554352@googlegroups.com>
In reply to#3873
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/Programming/Misc/Q_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.
> 
> >

[toc] | [prev] | [next] | [standalone]


#3874

FromCarlos Rocha <jazzda1307@gmail.com>
Date2012-07-29 14:40 -0700
Message-ID<20e4aad4-9ac1-49b5-94f1-995aa2ed11cb@googlegroups.com>
In reply to#3872
> 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

[toc] | [prev] | [next] | [standalone]


#3875

FromBob Morris <bob.morris@gmail.com>
Date2012-07-29 17:24 -0700
Message-ID<6c61681d-7bd8-4085-8afd-b0788a545a2f@googlegroups.com>
In reply to#3874
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

[toc] | [prev] | [next] | [standalone]


#3877

FromCarlos Rocha <jazzda1307@gmail.com>
Date2012-07-29 17:40 -0700
Message-ID<5d4f6bf4-0eea-428a-a4a2-06e8cee17b9e@googlegroups.com>
In reply to#3875
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

[toc] | [prev] | [next] | [standalone]


#3878

FromBob Morris <bob.morris@gmail.com>
Date2012-07-29 18:19 -0700
Message-ID<17d5608f-bb83-4165-ab61-94edf2d15817@googlegroups.com>
In reply to#3877
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,31063,  ;
            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

*-------------------------------------------------------------------

[toc] | [prev] | [next] | [standalone]


#3879

From"Stephen Quinn" <stevejqNO@bigpondSPAM.net.au>
Date2012-07-30 13:01 +1000
Message-ID<ZMmRr.1134$qv3.130@viwinnwfe01.internal.bigpond.com>
In reply to#3878
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 

[toc] | [prev] | [next] | [standalone]


#3880

FromCarlos Rocha <jazzda1307@gmail.com>
Date2012-07-29 20:03 -0700
Message-ID<8b020bd8-032b-467e-a1f5-3a3946a992dc@googlegroups.com>
In reply to#3878
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

[toc] | [prev] | [next] | [standalone]


#3881

FromBob Morris <bob.morris@gmail.com>
Date2012-07-29 22:12 -0700
Message-ID<fc851a4c-627d-4ff7-8539-d524e647bf3a@googlegroups.com>
In reply to#3880
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.

[toc] | [prev] | [next] | [standalone]


#3886

FromD.J.W. van Kooten <public@ic2remove.this.com>
Date2012-07-30 23:11 +0200
Message-ID<02td18p5jr2uldqgjld2oc1nq5mtd3pc7h@4ax.com>
In reply to#3881
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web