2404 Fivewin.ch error -- Antonio
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Mon Apr 29, 2024 5:41 pm
by Rick Lipkin
Antonio
Re-compiling most of my FW apps with 2404 and bcc770 .. got a strange error
- Code: Select all Expand view
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
Re: 2404 Fivewin.ch error -- Antonio
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Mon Apr 29, 2024 6:33 pm
by Antonio Linares
Dear Rick,
Can you please post here the first lines of your login.prg ?
thanks!
Re: 2404 Fivewin.ch error -- Antonio
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Mon Apr 29, 2024 6:44 pm
by Rick Lipkin
Antonio
Here is the entire file .. not very large ..
- Code: Select all Expand view
// 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
Re: 2404 Fivewin.ch error -- Antonio
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Mon Apr 29, 2024 6:48 pm
by Rick Lipkin
Smiles
I am sorry ... I do not understand ??
Rick
Re: 2404 Fivewin.ch error -- Antonio
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Mon Apr 29, 2024 6:55 pm
by Rick Lipkin
Antonio
Fixed by moving #INCLUDE "FIVEWIN.CH" to the top of the program .. old code .. sorry to bother you ...
- Code: Select all Expand view
// 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
Re: 2404 Fivewin.ch error -- Antonio
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Tue Apr 30, 2024 8:26 am
by Enrico Maria Giordano
The problem is these two lines in fivewin.ch:
- Code: Select all Expand view
static aFwStack := {}
static _fwhtmp_ := nil
An include file would never contain variables or functions definitions.