FWPPC V10.2 issues

FWPPC V10.2 issues

Postby johnshay » Thu Apr 14, 2011 10:07 am

HI,
First of all a Big Thankyou for all of your work over the many years Antonio. I have been using Fivewin Harbour and Fivwin PPC for around 6 years Now! Its a great Product!
Now a few probelms with V10.2 which i just purchased. I hope someone can help...

1) Curdir() seems to return blank "". Before it returned a path i.e "program files\app"

2) Having big problems with a LISTBOX using database fields of Numeric type..

Example --- This works fine because CODE and DESC are type 'Char' fields

Code: Select all  Expand view
@ 5, 5 LISTBOX oBrw1 VAR b1 pixel ;
          FIELDS code,desc  ;
          FONT tfont[30] ;
          HEADERS  "Code","Desc";
          FIELDSIZES 300,400 ;
          SIZE 800,600




This causes Memory ussage to inc dramatically and after scrolling a few pages - systems runs out of memory and gives Gen protection Fault
Only diff is extra field 'PRICE' is N 7 2 database field

Code: Select all  Expand view
       @ 5, 5 LISTBOX oBrw1 VAR b1 pixel ;
          FIELDS code,desc,price  ;
          FONT tfont[30] ;
          HEADERS  "Code","Desc","price";
          FIELDSIZES 300,400,100 ;
          SIZE 800,600


3) Variable Scope

I have a program i am converting from CLIPPER / Alaska xbase. It has lots of PRIVATE variables. I know this isnt good practise BUT it has run ok for the last 15 years and i dont want to start making them all PUBLIC or using oop... so i hope someone can help

Simple example with 2 windows. 1st window is the startup page with button to open up app1 app2 app3 etc

Pressing the TEST1 Button .. MSGINFO works FINE

Code: Select all  Expand view
 myvar1="hello!"
   DEFINE WINDOW odlg TITLE "Main page" //from 0,0 to 768,1024
      @300,400 Button "TILL" size 200,40 pixel action {|odlg|till(odlg)}
      @450,400 Button "TEST1" size 200,40 pixel action {||test1()}
   activate WINDOW

   function test1()
   msginfo(myvar1)  //this works fine



Now pressing the TILL BUTTON which opens up the Till windows works,,,but pressing TEST2 -- ERROR .. myvar2 doest not exist/ is not in scope?

   function till(odlg)
   myvar2="Hello Again"
   DEFINE WINDOW odlg2 TITLE "TILL PAGE" of odlg
      @450,400 Button "TEST2" size 200,40 pixel action {||test2()}
   activate WINDOW odlg2

   function test2()
   msginfo(myvar2)  //  ERROR  VARIABLE Does not exist  :- myvar
 


THIS worked fine on Early FWPPC version (around 2006). I can accept that perhaps the new version IS CORRECT and indeed this also seems to be how FWH Harbour works but i just wanted someone To Clarrify how private variable SCOPE rules apply, and why myvar1 is in scope in first window but myvar2 is not in scope from the 2nd window ???


4) The TITLE doesnt seem to work. Im running wince6.0. My windows shows title as 'FWPPC' ??

Code: Select all  Expand view
 DEFINE WINDOW odlg TITLE "Main page" //from 0,0 to 768,1024



5) I changed my proram so that i start with a dialog for the main page. (i tried a window but the ownd:end() not only closes it also ends the program -- which is probably correct but wouldnt then let me open a new window).
Then once a buton is pressed..i close the dialog and open a window for my child app to run in.. This WORKS.. The variable scope problem goes away..
BUT.....
The newly opening windows is in the background. I have to slect it from the task/bar or TASK manager. I tried some edamples from here of how to bring the window to the front but couldnt get any of them to work.

Code: Select all  Expand view
do while .t.
  DEFINE WINDOW odlg
   op=""
   @30,40 Button "TILL" size 200,40 pixel action (op:="till",odlg:end())
   @35,40 Button "Article File" size 200,40 pixel action (op:="article",odlg:end())
   @40,40 Button "SETTINGS" size 200,40 pixel action (op:="settings",odlg:end())

   activate WINDOW odlg
   if op="till"
    till()
   elseif op="article"
    article_list()
   elseif op="settings"
    settings_list()
   else
    exit
   endif
enddo
quit

Does anyone have a working example of bringing a window or dialog to to the front..

Sorry its such a long post. Any help would be very much apreciated.......
john
User avatar
johnshay
 
Posts: 10
Joined: Mon Mar 10, 2008 11:46 am
Location: Manchester,UK

Re: FWPPC V10.2 issues

Postby Enrico Maria Giordano » Thu Apr 14, 2011 10:46 am

johnshay wrote:
Code: Select all  Expand view
FIELDS code,desc,price  ;


Try

Code: Select all  Expand view
FIELDS code,desc,STR(price)  ;


or use TRANSFORM() to set the numeric format.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FWPPC V10.2 issues

Postby johnshay » Sat Apr 16, 2011 8:11 am

Thanks Enrico,
I've changed all my listbox field to type 'C' for now.. My BIG BIG probelm is the PRIVATE variables not being visiable from the 2nd Window / Dialog i.e problem 2)
I just want a main window with 3 buttons to choose the 3 sections to run. These buttons open up a new Window But i just cant access any PRIVATE vars Defined in each sub program

Perhaps Antonio could have a look at my first Post....please....
User avatar
johnshay
 
Posts: 10
Joined: Mon Mar 10, 2008 11:46 am
Location: Manchester,UK

Re: FWPPC V10.2 issues

Postby Antonio Linares » Sat Apr 16, 2011 11:09 am

John,

Please use:

ACTIVATE WINDOW ... MODAL

so it will use modal execution :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 12 guests