Console mode and mouse movement

1,093 views
Skip to first unread message

Marta

unread,
Aug 25, 2011, 1:05:03 PM8/25/11
to Harbour Users
Hello Everybody,

I've just begining use Harbour Minigui in console mode. I've got a
Clipper 5.2 program and I want to adapt to Harbour Minigui Extended
1.9. console mode, because i need FTP client. The FTP functions work
fine, but i have problem with GET system.

The navigation in READ with keyboard is good, but the navigation with
mouse is bad. Program cancelled in WHEN clause (with Error BASE/1072
Argument error:<> Called from ...,Called from
HBGETLIST:GETPREVALIDATE(0), ...).

The statements are some like:
FOR i:=1 TO 5
@ 10+i, 20 GET zido[i] WHEN IIF (&(READVAR())<>0, .f., MyFunc()).
NEXT
It refers &(READVAR()), and the GET field is an array element.

The GET object with mouse movement in a READ statement is not always
defined? My Clipper program previosly used :VarGet() methods
and :subscript exported variable, but that was also wrong in Harbour,
i changed them onto READVAR().
What can I do for eliminating this error?

Massimo Belgrano

unread,
Aug 25, 2011, 1:28:16 PM8/25/11
to harbou...@googlegroups.com
can you post a sample for understand what is bad on mouse?
You use minigui without do a gui programm like follow?
If you use Minigui Extended in text mode using gt (wich gt are you
using?) is very similar that Minigui


#include "hmg.ch"
Function Main
DEFINE WINDOW Win_1 AT 0,0 WIDTH 400 HEIGHT 200 TITLE 'Tutor 01 -
Hello World!' MAIN
END WINDOW
ACTIVATE WINDOW Win_1

If you like HMG programming style, you have the following choices:
- HMG 3 , HMG 4 (qt based and multiplatform)
- MiniGUI Extended
- OOHG
- HBQTCOMMAND


2011/8/25 Marta <gllm...@gmail.com>:

--
Massimo Belgrano

Marta

unread,
Aug 25, 2011, 2:27:51 PM8/25/11
to Harbour Users
When i click with mouse this GET field (with WHEN clause) the program
cancelled in GETPREVALIDATE(0) method, the GetPrevalidate's line is
zero. I think the GET object still is not defined in that moment when
i click. The navigation with keyboard cursor up, down, enter works.
My program contains:

Include "Inkey.ch"
SET EVENTMASK TO INKEY_ALL

and i don't use hbmk2.bat, only C:\MINIGUI\BATCH\COMPILE.BAT with /C
switch, so gtwin.lib.

At this moment in this program i needn't graphical interface, I use
only for mouse capability and the FTP (tip.lib) client Harbour
functions. I made other programs in Harbour MiniGui Extended with
gui.

Many thank for your reply, best regards
Márta Gáll
from Hungary

On aug. 25, 19:28, Massimo Belgrano <mbelgr...@deltain.it> wrote:
> can you post a sample for understand what is bad on mouse?
> You use minigui without do a gui programm like follow?
> If you use Minigui Extended in text mode using gt  (wich gt are you
> using?)  is very similar that Minigui
>
> #include "hmg.ch"
> Function Main
>     DEFINE WINDOW Win_1  AT 0,0 WIDTH 400 HEIGHT 200 TITLE 'Tutor 01 -
> Hello World!'       MAIN
>     END WINDOW
>     ACTIVATE WINDOW Win_1
>
> If you like HMG programming style, you have the following choices:
> - HMG 3 , HMG 4 (qt based and multiplatform)
> - MiniGUI Extended
> - OOHG
> - HBQTCOMMAND
>
> 2011/8/25 Marta <gllmr...@gmail.com>:

Massimo Belgrano

unread,
Aug 25, 2011, 2:36:57 PM8/25/11
to harbou...@googlegroups.com
can you post a sample for help me understand your problem
a=10
b=20
@ 1,2 say "Test1" get a when mywhen() valid a>1
@ 2,2 say "test2" get b when mywhen() valid a>2
read

function mywhen
  return .t. 

wich gt are you using

try compile with hbmk2

2011/8/25 Marta <gllm...@gmail.com>
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users



--
Massimo Belgrano

Viktor Szakáts

unread,
Aug 25, 2011, 2:51:47 PM8/25/11
to harbou...@googlegroups.com
I don't know what's the status now, but for long, MINIGUI decided 
to override Harbour's GET related classes (including GETPREVALIDATE),
so its release don't/didn't reflect any changes that happened in last 3-4 
years of Harbour development. So, for anyone using MINIGUI's Harbour 
build or MINIGUI libs, it's better to ask MINIGUI developers or users, 
because their Harbour is not the same as the official Harbour we know here.

Viktor

Marta

unread,
Aug 26, 2011, 2:38:34 AM8/26/11
to Harbour Users
Many thanks for your reply, sorry I am absolute beginner this console
mode and dont know, how supports MiniGuis Harbour the mouse in
HBGETLIST.
My MiniGUI Extended version is: 1.9 (Build 95) including Harbour
version is: 2.1.0rc2 Date: 2011-04-11 Last ChangeLog entry:
2011-04-10 12:43 UTC+0200 Przemyslaw Czerpak, Changelog version: 16557
I wrote to the developers and I wait for their answer.

Best regards
Márta Gáll
from Hungary, Ózd

Marta

unread,
Aug 26, 2011, 4:21:59 AM8/26/11
to Harbour Users
Hi Massimo,
Here is an long example:
#pragma /A+
#define NORMAL "w+/b,gr+/gr,,,n/w"
#include "inkey.ch"
#include "common.ch"
#include "hbclass.ch"

memvar i,kov,zidop,zidov,zidot,zok,zmegj

PROCEDURE MAIN
public ZIDOP[5],ZIDOV[5],ZIDOT[5],ZOK[5],ZMEGJ[5]

set color to NORMAL
set score off
set wrap on
set confirm on

SET(_SET_EVENTMASK, INKEY_ALL)
SetMode(25, 80)
CLEAR SCREEN
MSETCURSOR(.T.)

*__NONOALERT()
ALERT ("Működik?",{"Igen","Nem"},"W+/R,W+/B",0)

DO while .t.
CLEAR SCREEN
FOR I := 1 TO 5
ZIDOP[i]:=space(5)
ZIDOV[i]:=space(5)
ZIDOT[i]:=0
ZOK[i]:=0
ZMEGJ[i]:=space(30)
NEXT

kov:=5
@ kov-1,3 say "Kezdet"
@ kov-1,9 say "Veg"
@ kov-1,15 say "Tartam"
@ kov-1,22 say "Ok"
@ kov-1,25 say "Ok megnevezese"
@ kov-1,50 say "Megjegyzes"
@ kov ,3 say "Begin"
@ kov ,9 say "End"
@ kov ,15 say "Long"
@ kov ,22 say "Re"
@ kov ,25 say "Reason naming"
@ kov ,50 say "Note"

FOR i := 1 TO 5
@ kov+i, 3 GET zidop[i] pict "99:99" valid uresido(tomb_ert()) .or.
Timevalid(tomb_ert())
@ kov+i, 8 SAY "-"
@ kov+i, 9 GET zidov[i] pict "99:99"valid uresido(tomb_ert()) .or.
Timevalid(tomb_ert())
@ kov+i,15 GET zidot[i] PICT "99999" WHEN IIF (&(readvar())<>0, .t.,
percszamol(zidop[tomb_ind()], zidov[tomb_ind()],.t.));
VALID kiesettidokiir()
@ kov+i,20 SAY "'"
@ kov+i,22 GET zok[i] PICT "99" valid empty(tomb_ert()) .OR.
zokell(Row(),25,20)
@ kov+i,50 GET zmegj[i] pict"@S27"
NEXT
READ
if lastkey()=K_ESC
exit
endif
enddo
RETURN

********
FUNCTION uresido(ido)
RETURN ido=space(5) .OR. ido=" : "

*********
FUNCTION Percszamol(kezd,veg,berak)

local vissza:=int( (IIF(Timetosec(kezd)>Timetosec(veg), TimetoSec(veg)
+86400, TimetoSec(veg)) - TimetoSec(kezd) )/60)
*Alert(kezd+" "+veg)
IF berak
IF lastkey()=K_RETURN
keyb ltrim(str(vissza))
ENDIF
RETURN .t.
ELSE
RETURN vissza
ENDIF

********
FUNCTION Kiesettidokiir
LOCAL siker:=.t.,hkiesoido:=0
hkiesoido:=zidot[1]+zidot[2]+zidot[3]+zidot[4]+zidot[5]
@ kov+11, 15 SAY hkiesoido PICT "99999"
@ kov+11, 25 SAY "szumma"
RETURN siker

*******
FUNCTION Zokell(ksor,koszl,kszel)
LOCAL mit:=tomb_ert()
IF Empty(mit)
RETURN .t.
ELSE
IF ksor<>NIL
@ksor,koszl SAY padr(str(mit,2)+ "kodu zavar-ok",kszel)
ENDIF
ENDIF
RETURN .t.

********
FUNCTION Tomb_ert()
LOCAL tertek:=NIL, tvar:=READVAR()
* ALERT(tvar)
if TVAR==NIL
ALERT ('Undefined')
RETURN 0
ENDIF
tertek := &(READVAR())
RETURN tertek

********
FUNCTION Tomb_ind()

LOCAL tind:="0", tinde:=1, tindv:=1, tvar:=READVAR()
if TVAR==NIL
ALERT ('Undefined')
RETURN 0
ENDIF
tinde:=at("[",tvar)+1
tindv:=at("]",tvar)-1
if tinde=0 .or. tindv=0
Alert(tvar+" nem tömb típusú!" )
else
tind:=substr(tvar,tinde,tindv-tinde+1)
endif

RETURN val(tind)
-----------------------------------------------------------------------
and the COMPILE.BAT:
call c:\Minigui\batch\compile.bat teszt /C %1 %2 %3 %4 %5 %6 %7 %8 %9
pause
-----------------------------------
My MiniGUI Extended version is: 1.9 (Build 95) including Harbour
version is: 2.1.0rc2 Date: 2011-04-11 Last ChangeLog entry:
2011-04-10 12:43 UTC+0200 Przemyslaw Czerpak, Changelog version: 16557

best regards
Márta


On aug. 25, 20:36, Massimo Belgrano <mbelgr...@deltain.it> wrote:
> can you post a sample for help me understand your problem
> a=10
> b=20
> @ 1,2 say "Test1" get a when mywhen() valid a>1
> @ 2,2 say "test2" get b when mywhen() valid a>2
> read
>
> function mywhen
>   return .t.
>
> wich gt are you using
>
> try compile with hbmk2
>
> 2011/8/25 Marta <gllmr...@gmail.com>

Viktor Szakáts

unread,
Aug 26, 2011, 4:52:53 AM8/26/11
to harbou...@googlegroups.com
> My MiniGUI Extended version is: 1.9 (Build 95) including Harbour 
version is:  2.1.0rc2 Date: 2011-04-11 Last ChangeLog entry: 
2011-04-10 12:43 UTC+0200 Przemyslaw Czerpak, Changelog version: 16557 

This is not indicative on this list, since above is patched 
Harbour version.

> What can I do for eliminating this error?

Your sample doesn't contain anything that requires MINIGUI, 
and it works without RTE with original Harbour.

Use official Harbour (f.e. 3.0.0), without MINIGUI libs and 
COMPILE.BAT.

Command is:
     hbmk2 test.prg hbct.hbc -run

Viktor

Massimo Belgrano

unread,
Aug 26, 2011, 9:23:01 AM8/26/11
to harbou...@googlegroups.com
i suggest 
hbmk2 testzt.prg -run
 undefined reference to `HB_FUN_TIMEVALID'
 undefined reference to `HB_FUN_TIMETOSEC'
so add -lhbct 
(Hi Viktor Will prefix lib instead "-l" be also one symbol like +hbct or #hbct ? to be more readeable)
(HI Pritpal will hbide be more ready to use start hbide,past my prg code on empty tab ,and compile with 3 click/keyb )

hbmk2 testzt.prg -run -lhbct

work fine but jumping with mouse give follow error
Error BASE/1072  Argument error: <>
Called from (b)MAIN(54)
Called from HBGETLIST:GETPREVALIDATE(0)
Called from HBGETLIST:HITTEST(0)
Called from HBGETLIST:GETAPPLYKEY(0)
Called from HBGETLIST:READER(0)
Called from HBGETLIST:READMODAL(0)
Called from READMODAL(0)
Called from MAIN(59)


2011/8/26 Viktor Szakáts <harbo...@syenar.hu>

--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users



--
Massimo Belgrano


Massimo Belgrano

unread,
Aug 26, 2011, 9:25:47 AM8/26/11
to harbou...@googlegroups.com
Hi Marta
i suggest try with original harbour http://sourceforge.net/projects/harbour-project/files/
(missing trom prev post)

2011/8/26 Massimo Belgrano <mbel...@deltain.it>
i suggest 
hbmk2 testzt.prg -run
 undefined reference to `HB_FUN_TIMEVALID'
 undefined reference to `HB_FUN_TIMETOSEC'
so add -lhbct 
(Hi Viktor Will prefix lib instead "-l" be also one symbol like +hbct or #hbct ? to be more readeable)
(HI Pritpal will hbide be more ready to use start hbide,past my prg code on empty tab ,and compile with 3 click/keyb )

hbmk2 testzt.prg -run -lhbct

work fine but jumping with mouse give follow error
Error BASE/1072  Argument error: <>
Called from (b)MAIN(54)
Called from HBGETLIST:GETPREVALIDATE(0)
Called from HBGETLIST:HITTEST(0)
Called from HBGETLIST:GETAPPLYKEY(0)
Called from HBGETLIST:READER(0)
Called from HBGETLIST:READMODAL(0)
Called from READMODAL(0)
Called from MAIN(59)



--
Massimo Belgrano





--
Massimo Belgrano


Viktor Szakáts

unread,
Aug 26, 2011, 10:32:15 AM8/26/11
to harbou...@googlegroups.com
> (Hi Viktor Will prefix lib instead "-l" be also one symbol like +hbct or #hbct ? to be more readable)

You mean adding yet another (4th) syntax would help users 
to remind them of missing libs?

We have -lhbct, hbct.hbc, hbct.lib already. Adding another 
one won't help making users using it. So, I don't plan to 
add + or # for this, to me it looks even more cryptic and 
unusual.

Viktor

Massimo Belgrano

unread,
Aug 26, 2011, 10:52:05 AM8/26/11
to harbou...@googlegroups.com
It is only my point of view
the hbct.lib wich is the better is not multiplatform

2011/8/26 Viktor Szakáts <harbo...@syenar.hu>

Viktor

--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users



--
Massimo Belgrano

Viktor Szakáts

unread,
Aug 26, 2011, 10:59:10 AM8/26/11
to harbou...@googlegroups.com
Now I see it, compiled with GTXWC and using the mouse.

It's a crash in user supplied WHEN block, because READVAR() 
is not updated before calling WHEN block on mouse focus change.

It's fully replicating 5.3 behavior.

It may be an original 5.3 bug though as the doc says READVAR() 
can be used in WHEN block. It'd require more investigation to 
fully understand the whole picture and fixing it if needed.

I'd rather suggest to replace READVAR() usage with direct var 
name to workaround it in simple and straightforward way.

Viktor

Viktor Szakáts

unread,
Aug 26, 2011, 11:08:09 AM8/26/11
to harbou...@googlegroups.com
> It is only my point of view
the hbct.lib wich is the better is not multi platform

'-l' is a plain option, nothing special or complicated about it.

It is also listed as the second option on the help screen, so 
if someone doesn't want to read into two lines of the help 
screen, it won't help to add new and more obscure 
alternatives.

hbmk2 also recognizes Blinker scripts, so we have not 3 
but 4 different syntaxes supported to spec a lib already.

BTW 'hbct.lib' format is now recognized on all systems and 
with all C compilers, so it's still not elegant, but portable in 
3.1.0dev versions.

I think the problem is rather to identify which lib (contrib, 
addon) is needed when certain symbols are shown missing.
There is no easy answer for that however. Step forward is to
more tightly integrating the compiler and hbmk2.

Viktor

Massimo Belgrano

unread,
Aug 26, 2011, 11:17:13 AM8/26/11
to harbou...@googlegroups.com


2011/8/26 Viktor Szakáts <harbo...@syenar.hu>


BTW 'hbct.lib' format is now recognized on all systems and 
with all C compilers, so it's still not elegant, but portable in 
3.1.0dev versions.
Good to know
imo hbct.lib is very elegant  
How can be used Blinker scripts?


I think the problem is rather to identify which lib (contrib, 
addon) is needed when certain symbols are shown missing.
There is no easy answer for that however. Step forward is to
more tightly integrating the compiler and hbmk2.

we need a dbf with libname,libversion,function name created during compilation?
 
Viktor


--
Massimo Belgrano


Viktor Szakáts

unread,
Aug 26, 2011, 11:40:45 AM8/26/11
to harbou...@googlegroups.com
> imo hbct.lib is very elegant  

".lib" is very old school and compiler/platform specific 
naming, so I'd argue.

> How can be used Blinker scripts?

Rename to blinker, pass the script. Never used it myself.

> we need a dbf with libname,libversion,function name created during compilation?

It's little more complicated than that. First, .dbf format 
won't cut it, second such database needs to be generated, 
kept somewhere, parsed, etc.

Viktor

Marta

unread,
Aug 26, 2011, 1:29:18 PM8/26/11
to Harbour Users
Do you mean some like this:
// @ kov+i,15 GET zidot[i] PICT "99999" WHEN IIF
(&(readvar())<>0, .t., percszamol(zidop[tomb_ind()],
zidov[tomb_ind()],.t.));
// VALID kiesettidokiir()
@ kov+i,15 GET zidot[i] PICT "99999" WHEN IIF (zidot[i]<>0, .t.,
percszamol(zidop[i], zidov[i],.t.));
VALID kiesettidokiir()
This is wrong, because the subscript's [I] value equal with 6 after
the FOR i:=1 TO 5...NEXT . Or I must use five @GET commands?
Thanks
Márta

Klas Engwall

unread,
Aug 26, 2011, 7:26:54 PM8/26/11
to harbou...@googlegroups.com
Hi Marta,

> Do you mean some like this:
> // @ kov+i,15 GET zidot[i] PICT "99999" WHEN IIF
> (&(readvar())<>0, .t., percszamol(zidop[tomb_ind()],
> zidov[tomb_ind()],.t.));
> // VALID kiesettidokiir()
> @ kov+i,15 GET zidot[i] PICT "99999" WHEN IIF (zidot[i]<>0, .t.,
>
> percszamol(zidop[i], zidov[i],.t.));
> VALID kiesettidokiir()
> This is wrong, because the subscript's [I] value equal with 6 after
> the FOR i:=1 TO 5...NEXT . Or I must use five @GET commands?

When your gets are elements in an array and you get them in a loop, then
the subscript at "read time" will always be the number of the last
element plus one, so as you noticed that will not work. Instead you can
use when and valid clauses in codeblocks similar to

valid {|| getactive():varget() == 'whatever' }

where the name or subscript of the variable in the active get does not
matter. You just examine the data it holds.

If you have access to the Clipper 5.x manual you can read about it at
the beginning of the chapter describing the get system.

Regards,
Klas

Massimo Belgrano

unread,
Aug 27, 2011, 6:38:38 AM8/27/11
to harbou...@googlegroups.com
 complete Clipper reference can be found at the following address:

http://www.itlnet.net/programming/program/Reference/c53g01c/menu.html

2011/8/27 Klas Engwall <har...@engwall.com>

Klas Engwall

unread,
Aug 27, 2011, 11:14:46 AM8/27/11
to harbou...@googlegroups.com
Hi Massimo,

> complete Clipper reference can be found at the following address:
>
> http://www.itlnet.net/programming/program/Reference/c53g01c/menu.html

That is the Norton Guide, converted to HTML. Quite useful, I am sure,
for those who do not have the .ng file available. And it is probably as
complete as the .ng file is. But I was referring to the manual, the
thing made of paper :-). I use the .ng file all the time to check syntax
details, but for really learning how to use codeblocks, the get system,
the RDDs, etc, the paper manual is required reading.

Regards,
Klas

Marta

unread,
Aug 28, 2011, 8:26:25 AM8/28/11
to Harbour Users
Hi Klas,
In my original Clipper (5.2 and updated GETSYS.PRG +CLIPMOUSE.OBJ)
program i used :Varget() method, and :subscript exported variable, in
it i could use mouse and worked very well, but I need some FTP
functions in this program, that is not in the clipper and i must
convert it to Harbour. I inserted the FTP client (tip.lib) routines in
it, compiled it with Harbour compiler, all the program works vell and
quickly, the FTP routines also, but only the navigation with mouse in
READ is bad, the program hangs up in GETPREVALIDATE(0) function. I
used varget(), readvar() that is all the same. Viktor Szakáts wrote
that is originally a Clipper 5.3 error, that Harbour inherited. I made
the example above to point this error.
Thanks for your help, best regards,
Márta

JPR

unread,
Dec 16, 2014, 10:01:46 PM12/16/14
to harbou...@googlegroups.com
Marta,

You mention that you were able to get FTP functions working in console mode. Do you mind if I ask how you went about doing that? Thanks.
Reply all
Reply to author
Forward
0 new messages