total newbie here about X#. Just started to play around and with VO Xporter I've converted a big VO app but when compiling I'm getting the following messages:
1- XS9999: An internal compiler error has occurred: 'Object reference not set to an instance of an object.', at LanguageService.CodeAnalysis.GreenNode.AdjustFlagsAndWidth(GreenNode node)
2 - XS1030 #warning: ' The following method did not include a CLASS declaration'
as per first point I have no clue on whats going on
as per second point I've two methods that extends bBrowser functionality to my needs. I've read the VOPad example in the help and tried to change my code accordingly but still getting the XS1030 warning:
Code: Select all
STATIC CLASS bBrowserExtensions
STATIC METHOD DeleteItem( SELF obBrowser AS bBrowser ) AS LOGIC
LOCAL iRecnoID AS INT
LOCAL lDeleted AS LOGIC
LOCAL lUpdated AS LOGIC
LOCAL lEmptyFile AS LOGIC
LOCAL lLocked AS LOGIC
LOCAL lSuccess AS LOGIC
LOCAL lMessage AS LOGIC
LOCAL cErrorMsg AS STRING
LOCAL symClassName AS SYMBOL
lDeleted := FALSE
lEmptyFile := FALSE
lLocked := FALSE
cErrorMsg := ""
Default( @lMessage, TRUE )
// lMessage indica se vogliamo che il messaggio di conferma compaia (lMessage=TRUE) oppure no (lMessage=FALSE)
IF lMessage
lSuccess := FabMessageYesNo( obBrowser:Owner, "Vuoi cancellare questo record dall'archivio ?", "Cancella", 2 )
ELSE
lSuccess := TRUE
ENDIF
IF lSuccess
symClassName := ClassName( obBrowser:Server )
obBrowser:Server:SuspendNotification()
iRecnoID := obBrowser:SelectionFirstRow()
WHILE iRecnoID > 0
obBrowser:Server:GoTo( iRecnoID )
// 14-05-2018: se il server è un bArrayServer la delete( ) è irrevocable (questo parametro non sussiste se il Server è un DB fisico)
// 10-10-2022: piccola modifica per supportare l'AdoServer in caso di tabella Postgres
IF symClassName == #bArrayServer
lDeleted := obBrowser:Server:DELETE( .T. ) // Cancello il record, lIrrevocable := .T.
ELSE
lDeleted := obBrowser:Server:DELETE() // Cancello il record
ENDIF
IF !lDeleted
cErrorMsg := "Impossibile cancellare il record dall'archivio"
EXIT
ELSE
iRecnoID := obBrowser:SelectionNextRow()
ENDIF
ENDDO
IF lDeleted
obBrowser:Server:Commit()
obBrowser:Server:Unlock()
ENDIF
// Se la cancellazione e' andata a buon fine allora controllo
// se il file e' vuoto oppure mi devo posizionare sul record buono.
IF lDeleted
lUpdated := obBrowser:RefreshBrowser( TRUE ) // Refresh del Browse
IF obBrowser:Server:EoF
obBrowser:Server:Skip( -1 )
IF obBrowser:Server:BoF
lEmptyFile := TRUE
ENDIF
ENDIF
ENDIF
obBrowser:Server:ResetNotification()
IF obBrowser:Server:Reccount > 0
// 10-10-2022: il notify aviene solo se ci sono ancora records da visualizzare. nel caso di un AdoServer
// se la tabella è vuota è necessario ricorrere ad una Requery() altrimenti il metodo Notify()
// genera un errore a runtime
obBrowser:Server:Notify( NOTIFYFILECHANGE ) //10-10-2022: NON CAMBIARE IL NOTIFYFILECHANGE
ELSE
// bBrowser vuoto
lEmptyFile := TRUE
IF symClassName == #ADMAdoServer .OR. symClassName == #AdoServer
obBrowser:Server:Requery()
ELSEIF symClassName == #bArrayServer // 23-10-2022: aggiunto il refresh del browse in caso di "file vuoto" per il bArrayServer
obBrowser:Server:Notify( NOTIFYFILECHANGE )
ENDIF
ENDIF
ENDIF
IF !Empty( cErrorMsg )
FabMessageAlert( obBrowser:Owner, cErrorMsg )
ENDIF
IF lEmptyFile
FabMessageInfo( obBrowser:Owner, "File vuoto!" )
ENDIF
cErrorMsg := NULL_STRING
RETURN lDeleted
STATIC METHOD RefreshBrowser( SELF obBrowser AS bBrowser) AS LOGIC
LOCAL lUpdated AS LOGIC
LOCAL lRetainSelection AS LOGIC
LOCAL symRefreshMode AS SYMBOL
lUpdated := TRUE
Default( @lRetainSelection, FALSE )
IF !lRetainSelection
symRefreshMode := #RefreshBuffer
ELSE
symRefreshMode := #RetainCurrentRow
ENDIF
IF obBrowser:SelectionRowCount > 1
lUpdated := obBrowser:SelectionRemove(#All)
ENDIF
IF obBrowser:Server:Reccount > 0
obBrowser:SelectionSet(#Single,obBrowser:CurrentColumn,obBrowser:CurrentRow,obBrowser:Server:RECNO)
obBrowser:SetFocus()
lUpdated := obBrowser:Refresh(symRefreshMode)
ENDIF
RETURN lUpdated
END CLASS
Using X# 2.21.0.5
Stefano