I cannot get a vfp8 compiled program to run in exe. ( it runs perfectly well interpreted).

I purchased vfp8 some while ago after creating many exe programs from compiled foxpro 2.6 for DOS.   I need to run foxpro in windows (7) to access usb  (mainly since no modern computers/printers have parallel ports now).   I have converted most of my programs to run in vfp8  (SQL not OOP) with no problems.   Vfp8  creates a stand alone (exe) program  with no problems but when I run it all I get is a blank screen with no reaction from the keyboard.  The task Manager shows the program running.  I can only think I have omitted or added something to create this situation.  Having scanned the web for answers which have not solved my problem such as the "read" command being replaced by "read event" I am at a loss to know what to do.   Can you please help me?
foxdave123Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pcelbaCommented:
The standard structure of VFP 8 program (lat name it MAIN.PRG) should be:

1) Some initialization
2) Create main menu (DO MainMenu.MPR)
3) READ EVENTS
4) Cleanup and exit (QUIT)

ManiMenu.MPR should be created by the standard Menu generator. You may also create your own menu code.

Executing above program you should see the blank screen having the menu on top.

The READ EVENTS stops the program execution and waits for events. Possible events are:

1) DO FORM SomeForm.scx   && displays a form prepared by CREATE FORM command
2) CLEAR EVENTS  && exits the waiting in the READ EVENT
3) We could find more events...

Both DO FORM and CLEAR EVENTS (or other events) can be placed as Command in the MainMenu.mpr

All above files should be in a project file from which you are building the EXE.

Did you do everything written above?

You may also place following command at the beginning:
ON SHUTDOWN QUIT
this will ensure fast app closing when you press Close (X) control button.
foxdave123Author Commented:
The program has been written line by line as in foxpro 2.6 but with changes (eg: define window, etc) to meet with vfp8 needs.  The start prg calls a set-up (set talk off, set date british, etc)  and a menu using "@ xx,yy say " lines.  On return to start prg  a "@  xx,yy  get " with a "read"  followed by  a "do case " command choice to select  various optional prgs supported by procedure files,  There are no parts of the program that have been created by OOP such as reports, forms or events.  It is a direct conversion from a foxpro 2.6 program that works perfectly well when run from vfp8 but hangs up when run as an compiled exe file.  I find OOP a most confusing system especially after using foxpro 2.6 for DOS successfully for more that twenty years.  When I consult the vfp Help File I often see "Included For Backward Compatibility  --- Use Form/Report Designer Instead" which, with no explanation why it is not used or no examples of correct substitute coding, is no help at all.   If I can solve the reason(s) it stalls I will be satisfied with creating programs as I always have without having to re-learn an alien  so-called easy program creating system. Any help would be appreciated.  Thank you.
pcelbaCommented:
If you have a bunch of @ say/gets in your code but they are not visible then it is caused by Windows themes most probably.

The easiest fix should be following command at the beginning of your code:
_screen.Themes = .F.

Also all defined windows should have Themes = .F. but that's not your case because you have no object access to your windows probably. (To have object access to your windows just add NAME clause to DEFINE WINDOW command.)

Another switch which I am not sure exists in VFP 8 is  SYS(2700, 0). Please check the help file for its availability.

If you are using old fashioned code and no objects then you don't need READ EVENTS but the old READ or READ CYCLE should work.

BTW, what font do you use in your app windows? When VFP recognizes old say/gets and you don't have FONT clause in your definitions then VFP uses Courier which does not look so cool sometimes...

I would also recommend to start with OO approach... You may define one Form class with all the code necessary to navigate DBF records, save changes, searching records etc. You'll improve your coding speed when you use this class for your application forms creation later. Such forms do not need any line of code whereas FoxPro 2.6 code contains tons of redundant lines etc. etc.

Of course, the question is whether to start with OO in FoxPro now... If you decide yes, then look at Hentzenwerke's FoxPro books offer. One of them describes porting old FoxPro apps to VFP.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

foxdave123Author Commented:
pcelba   Thanks for replying but I'm afraid your suggestions did not make any difference.
" SYS(2700, 0)"  has already been installed to no effect.
"_screen.Themes = .F. " also had no effect.
The font is Courier but that is only cosmetic.
 
I have included a txt copy of the initial prg of the program as an attachment.  You may spot something that could be causing the problem.
I await your reply.
WOBOWLS.TXT

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
foxdave123Author Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for foxdave123's comment #a40934677

for the following reason:

A suggestion was tried but it is not a solution.
pcelbaCommented:
Suggestions were sent without any knowledge of the source code.

The code attached to the last post is not usable as many parts are still missing. I'll try to reduce it and create usable EXE file but it is really hard to help...

Did you try some older VFP version? It should be more compatible to your FoxPro/DOS code. (VFP 9 license allows to use any prior VFP version legally, I am not sure about VFP 8 license.)
pcelbaCommented:
Just FYI and because you are not able to post any code which would confirm the behavior described I've updated your txt file, created an VFP 9 exe and it works as expected... This is the running code:
* Program .....: WOBOWLS.PRG (Master)
* http://www.experts-exchange.com/questions/28706245/I-cannot-get-a-vfp8-compiled-program-to-run-in-exe-it-runs-perfectly-well-interpreted.html*
* Added as a suggestion 18/0802015
_SCREEN.THEMES = .F.
*
* Added as a suggestion 17/0802015
SYS(2700.0)
SET ENGINEBEHAVIOR 70
*SET REPORTBEHAVIOR 80 && Only used in VFP9
*
SET TALK OFF
SET SAFETY OFF
*
ON ERROR DO WOERROR.PRG
*
CLOSE ALL
CLEAR ALL
CLEAR
 WAIT "1"
SET SCOREBOARD OFF
SET INTENSITY OFF
SET CONFIRM OFF
nkey=INSMODE()
IF nkey = .T.
 =INSMODE(!INSMODE())
ENDIF
* set cursor to _ for overwrite mode
=SYS(2008,"O",0)
* set cursor to  for insert mode
=SYS(2008,"I",2)
*
* if capital lock on set capital lock off
nkey=CAPSLOCK()
IF nkey = .T.
 =CAPSLOCK(!CAPSLOCK())
ENDIF
*
*nmlk = NUMLOCK()
*= NUMLOCK(.T.)
*
 WAIT "2"

*-- SET PROCEDURE TO WOSPROC.PRG

IF FILE("WOSEES.MEM")
*RESTORE FROM WOSEES ADDITIVE
 RESTORE FROM WOSEES
 snlg = seesnlg
ELSE
*--  DO SSNLEAGS
*COUNT FOR SSNTYP = "W" TO seewin
*COUNT FOR SSNTYP = "S" TO seesum
*seenil = IIF(seewin = 0,"W",seenil)
*seenil = IIF(seesum = 0,"S",seenil)
*seeson = "W"
*seesen = "Winter"
*choose = "S"
*IF seewin+seesum = 0
* seenil = "B"
* SAVE TO WOSEES ALL LIKE see*
*ENDIF
*--  DO WOLEDIT.PRG
ENDIF   
nmlk = NUMLOCK()

= NUMLOCK(.T.)
STORE " " TO chose, newlst

leegcd = "Mens"
IF FILE("LEEGE&snlg..MEM")
 RESTORE FROM LEEGE&snlg ADDITIVE
ELSE
 *-- DO WOLEDIT.PRG
ENDIF
*
 WAIT "3"
*-- DO WOINDEX.PRG
 WAIT "4"
*-- DO WOTSETS.PRG
*
fsizw = 100
mcol = 20
chose = "ABCDEFGJKLMNPQRSTUVWXYZ"  && -- Unused-"HIO"

@6, 0 SAY PADC("League Details",fsizw)
@ 7,mcol SAY "Select Season ------------------------------------ S" && WOLEDIT
@ 8,mcol SAY "League: Select --- N,  Create New --- C,  Edit --- G" && WOLEDIT
@ 9,mcol SAY "Set League Matches ------------------------------- M" && WOMTCHS
@10,mcol SAY "Create Matches List by Name --- V    by Number --- Y" && WOLLIST, WONLIST
@11,mcol SAY "League Matches Printout -------------------------- Z" && WOPRNTS
@ 15, 0 SAY PADC("Weekly Match Results",fsizw)
@ 16,mcol SAY "Results Entry ------------------------------------ X" && WOSEDIT
@ 17,mcol SAY "Weekly Results List --- K    Last Week Display --- R" && WOWLIST, WORLIST
@ 21, 0 SAY PADC("Home Team Matches Schedule",fsizw)

@ 22,mcol SAY "Home Team Initiation, Match Dates, Allocations,"
@ 23,mcol SAY "Matches Listing, Matches Printout ---------------- A" && WOMLIST, WOPRNTS
@ 24,mcol SAY "Edit Team Bowler Details --- E    Team Details --- T" && WOMEDIT/WOTEDIT

@ 28,mcol SAY "All League Bowls Calender List --- B     Print --- F" && WOCALST, WOCAPNT
@ 32,mcol SAY "Default Settings ----- D   Quit Program ---------- Q" && WODFLTS/QUIT
@ 34,mcol SAY "Desktop Mode -------- J/Laptop Mode --------- J"

 SET COLOR TO GR+/N
 @ 40, 0 SAY SPACE(97)
 @ 40,36 SAY "Please Enter Choice : :"
 SET COLOR TO W+/N
 DO WHILE .T.
  choose = " "
  CLEAR TYPEAHEAD
  @ 40,57 GET choose PICTURE "!"
  READ
* READ EVENTS && not used
  IF choose $ chose
   EXIT
  ENDIF
  ?? CHR(7)
 ENDDO

CANCEL

Open in new window


All SAYs are visible and GET / READ waits for input.
pcelbaCommented:
The above code also works well as VFP 8 executable under Windows 7. The problem described in the question did not appear and the question author should provide more info or code which causes the behavior described otherwise it is really not possible to help.
pcelbaCommented:
The assisted solution works correctly.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FoxPro

From novice to tech pro — start learning today.