2404 Fivewin.ch error -- Antonio

2404 Fivewin.ch error -- Antonio

Postby Rick Lipkin » Mon Apr 29, 2024 5:41 pm

Antonio

Re-compiling most of my FW apps with 2404 and bcc770 .. got a strange error

Code: Select all  Expand view  RUN

Project: YachtW32, Environment: BorlandFWH:
[1]:Harbour.Exe "LOGIN.PRG"  /m /n /gc0 /w0 /es2 /a /iC:\XHARBOUR\Include /o"Obj\LOGIN.c"
xHarbour 1.3.1 Intl. (SimpLex) (Build 20240413)
Copyright 1999-2024, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'LOGIN.PRG'...
C:\fwh2404\include\FIVEWIN.CH(2198) Error E0004  STATIC declaration follows executable statement
C:\fwh2404\include\FIVEWIN.CH(2199) Error E0004  STATIC declaration follows executable statement
2 errors
 



So far this is the first FiveWin error I have come across ... do you see something in the script above that would cause this error ??

Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: 2404 Fivewin.ch error -- Antonio

Postby Antonio Linares » Mon Apr 29, 2024 6:33 pm

Dear Rick,

Can you please post here the first lines of your login.prg ?

thanks!
regards, saludos

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

Re: 2404 Fivewin.ch error -- Antonio

Postby Rick Lipkin » Mon Apr 29, 2024 6:44 pm

Antonio

Here is the entire file .. not very large ..

Code: Select all  Expand view  RUN

// LOGIN.PRG

FUNC _LOGIN( cAUTH, oDLG, oSAY, cSAY )

LOCAL cNAME,SAYING,lOK := .F.
LOCAL oRsUser,oErr,cFIND,cSQL

SET DELETED ON

#INCLUDE "FIVEWIN.CH"

xLOGIN := UPPER( WNetGetuser() )+space(8) // fivewin
xLOGIN := SUBSTR(xLOGIN,1,8)

IF cAUTH = 'Y'
   cSAY := cSAY+"   "+xLOGIN
   oSAY:ReFresh()
   SysReFresh()
ENDIF

oRsUser := TOleAuto():New( "ADODB.Recordset" )
oRsUser:CursorType     := 1        // opendkeyset
oRsUser:CursorLocation := 3        // local cache
oRsUser:LockType       := 3        // lockoportunistic

// check for very first user

cSQL := "SELECT * FROM USERINFO"
TRY
   oRsUser:Open( cSQL, xCONNECT )
CATCH oErr
   MsgInfo( "Error in Opening USERINFO table here" )
   IF cAUTH = 'Y'
       oDLG:END()
       SysReFresh()
   ENDIF
   RETURN(.F.)
END TRY

IF oRsUser:eof
   oRsUser:AddNew()

   oRsUser:Fields("usereid"):Value    := "011111111111111111"
   oRsUser:Fields("userid"):Value     := xLOGIN
   oRsUser:Fields("READ_ONLY"):Value  := "Y"
   oRsUser:Fields("WRITE"):Value    := "Y"
   oRsUser:Fields("SUPER"):Value    := "Y"
   oRsUser:Fields("lastlog"):Value  := dtoc(DATE())+" "+time()
   oRsUser:Update()

   oRsUser:CLose()
   IF cAUTH = 'Y'
      oDLG:END()
      SysReFresh()
   ENDIF
   RETURN(.T.)
ENDIF

oRsUser:MoveFirst()
oRsUser:Find( "userid = '"+xLOGIN+"'" )

IF oRsUser:eof
   xLOGIN := "UNKNOWN"
   xREAD  := 'Y'
   xWRITE := 'N'
   xSUPER := 'N'
ELSE

   xREAD   := 'Y'
   xWRITE  := oRsUser:Fields("WRITE"):Value
   xSUPER  := oRsUser:Fields("SUPER"):Value
   xLOGIN  := oRsUser:Fields("userid"):Value

   oRsUser:Fields("lastlog"):Value := dtoc(DATE())+" "+time()
   oRsUser:Update()

ENDIF

oRsUser:Close()

IF cAUTH = 'Y'
   oDLG:END()
   SysReFresh()
ENDIF

RETURN(.T.)

* END LOGIN.PRG

 


Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: 2404 Fivewin.ch error -- Antonio

Postby paquitohm » Mon Apr 29, 2024 6:45 pm

Hi,

Bad use
Code: Select all  Expand view  RUN
FUNCTION Foo()
a:= b
#Include "Fivewin.ch"
..
 


Correct use
Code: Select all  Expand view  RUN
#Include "Fivewin.ch"
FUNCTION Foo()
a:= b
...
 


Regards
paquitohm
 
Posts: 266
Joined: Fri Jan 14, 2022 8:37 am

Re: 2404 Fivewin.ch error -- Antonio

Postby Rick Lipkin » Mon Apr 29, 2024 6:48 pm

Smiles

I am sorry ... I do not understand ??

Rick
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: 2404 Fivewin.ch error -- Antonio

Postby Rick Lipkin » Mon Apr 29, 2024 6:55 pm

Antonio

Fixed by moving #INCLUDE "FIVEWIN.CH" to the top of the program .. old code .. sorry to bother you ...

Code: Select all  Expand view  RUN

// LOGIN.PRG

#INCLUDE "FIVEWIN.CH"   // moved to top of program ...

FUNC _LOGIN( cAUTH, oDLG, oSAY, cSAY )

LOCAL cNAME,SAYING,lOK // := .F.
LOCAL oRsUser,oErr,cFIND,cSQL

SET DELETED ON

lOk := .f.

xLOGIN := UPPER( WNetGetuser() )+space(8) // fivewin
xLOGIN := SUBSTR(xLOGIN,1,8)

IF cAUTH = 'Y'
   cSAY := cSAY+"   "+xLOGIN
   oSAY:ReFresh()
   SysReFresh()
ENDIF

 
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: 2404 Fivewin.ch error -- Antonio

Postby paquitohm » Mon Apr 29, 2024 7:18 pm

Impressive ! :roll:
paquitohm
 
Posts: 266
Joined: Fri Jan 14, 2022 8:37 am

Re: 2404 Fivewin.ch error -- Antonio

Postby Enrico Maria Giordano » Tue Apr 30, 2024 8:26 am

The problem is these two lines in fivewin.ch:

Code: Select all  Expand view  RUN
static aFwStack      := {}
static _fwhtmp_      := nil


An include file would never contain variables or functions definitions.
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 34 guests