Welcome, Guest
Username: Password: Remember me
Qui si parla italiano
  • Page:
  • 1

TOPIC:

Warning sugli ASSIGN generati dal VODbServerEditor 11 Jan 2023 00:48 #24953

  • veliero
  • veliero's Avatar
  • Topic Author


  • Posts: 15
  • Salve, sto smanettando con il VODbServerEditor in ambiente XIDE e si verifica questa situazione anomala:
    - importo un file DBF (cui è associato un indice CDX)
    - salvo il codice generato (e fin qui tutto bene)
    - procedo poi con la compilazione ma mi da una serie di Warning XS9032 - This entity type cannot return a value. Return value ignored.

    questo accade nelle istruzioni RETURN per gli ASSIGN di tutti i campi del mio database (sotto un codice di esempio):

    ASSIGN CODICE(uValue )

    RETURN SELF:FieldPut(#CODICE, uValue)

    Come posso risolvere questa problematica?

    Saluti
    Francesco

    Please Log in or Create an account to join the conversation.

    Warning sugli ASSIGN generati dal VODbServerEditor 11 Jan 2023 01:05 #24954

    • Chris
    • Chris's Avatar


  • Posts: 3736
  • Hi Francesco,

    This is the same as in VO, the code is generated based on the file CAVOFED.TPL. Please locate this file (it will be somewhere inside the folder of your Project, and if it's not there, it should be in \XIDE\Config), edit it and change the entry at the end from

    [DBSERVER]
    ASSIGN %hlname%...
    RETURN SELF:FieldPut(#%hlname%, uValue)

    to

    [DBSERVER]
    ASSIGN %hlname%...
    SELF:FieldPut(#%hlname%, uValue)

    Then delete the ASSIGNs from the code, and the next time you save the DBServer, they will be generated again without the RETURN.

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Last edit: by Chris.

    Warning sugli ASSIGN generati dal VODbServerEditor 11 Jan 2023 01:32 #24955

    • veliero
    • veliero's Avatar
    • Topic Author


  • Posts: 15
  • Ciao Chris,
    perfetto, ora il WARNING sugli ASSIGN è sparito tuttavia c'è un'altra segnalazione sulla variabile "lTemp" nel CONSTRUCTOR della mia CLASSE Clienti derivata da DBserver:

    CLASS Clienti INHERIT DBServer
    INSTANCE cDBFPath := "C:\Users\Utente\Desktop\chicco d'oro\" AS STRING
    INSTANCE cName := "CLIENTI.DBF" AS STRING
    INSTANCE xDriver := "DBFcdx" AS USUAL
    INSTANCE lReadOnlyMode:= FALSE AS LOGIC
    INSTANCE lSharedMode := TRUE AS USUAL
    INSTANCE nOrder := 0 AS INT


    // User code starts here (DO NOT remove this line) ##USER##
    CONSTRUCTOR(cDBF, lShare, lRO, xRdd)
    LOCAL oFS AS FILESPEC
    LOCAL i AS DWORD
    LOCAL nFields AS DWORD
    LOCAL aFieldDesc AS ARRAY
    LOCAL aIndex AS ARRAY
    LOCAL nIndexCount AS DWORD
    LOCAL oFSIndex AS FILESPEC
    LOCAL nPos AS DWORD
    LOCAL lTemp AS LOGIC <=========================
    LOCAL oFSTemp AS FILESPEC

    in fase di compilazione si presenta il messaggio:

    warning XS0165: Use of unassigned local variable 'lTemp'

    l'errore si verifica in questo ciclo:

    FOR i:=1 UPTO nIndexCount
    oFSIndex := FileSpec{ aIndex[DBC_INDEXNAME] }
    oFSIndex:Path := SELF:cDBFPath

    IF lTemp .AND. !Empty( aIndex[DBC_INDEXPATH] ) <============
    oFSIndex:Path := aIndex[DBC_INDEXPATH]
    ENDIF

    IF oFSIndex:Find()
    lTemp := SELF:SetIndex( oFSIndex )
    ENDIF
    NEXT

    Ti torna questo problema?
    Attachments:

    Please Log in or Create an account to join the conversation.

    Warning sugli ASSIGN generati dal VODbServerEditor 11 Jan 2023 09:41 #24956

    • Chris
    • Chris's Avatar


  • Posts: 3736
  • Hi Francesco,

    You can fix this also. Please open CAVODED.TPL this time, and in the section:
    [INIT]
    METHOD Init(cDBF, lShare, lRO, xRdd) CLASS %classname%
    	LOCAL oFS		  AS FILESPEC
    	LOCAL i 		  AS DWORD
    	LOCAL nFields	  AS DWORD
    	LOCAL aFieldDesc  AS ARRAY
    	LOCAL aIndex	  AS ARRAY
    	LOCAL nIndexCount AS DWORD
    	LOCAL oFSIndex	  AS FILESPEC
    	LOCAL nPos		  AS DWORD
    	LOCAL lTemp 	  AS LOGIC
    	LOCAL oFSTemp	  AS FILESPEC
    ...

    add an assignment for the local declaration of lTemp:

    LOCAL lTemp := FALSE AS LOGIC

    Now also this warning should go away!

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Warning sugli ASSIGN generati dal VODbServerEditor 11 Jan 2023 09:50 #24957

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3242
  • Hi Chris,
    PMFJI: maybe there should be an option in XIDE for global template files like in VO, instead of putting them in every application.
    And XIDE should install versions that are compatible with the X# compiler.
    If anyone has changed them in VO it would be much easier to make these changes then again in XIDE.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Warning sugli ASSIGN generati dal VODbServerEditor 11 Jan 2023 09:55 #24958

    • Chris
    • Chris's Avatar


  • Posts: 3736
  • Hi Wolfgang,

    Yes, you can put the templates in XIDE\Config and they will become available for all projects and applications. But you can also put different templates inside a project and those will then override the global ones, for this project.

    About installing them together with XIDE, I feel uneasy about doing this, because those files are from another product, so I'd like avoiding them including them in XIDE. But it's very easy to copy them manually from the VO folder and also VOXporter does this when you port an app.

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Warning sugli ASSIGN generati dal VODbServerEditor 11 Jan 2023 10:07 #24959

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3242
  • Hi Chris,
    since X# requires adapted template files XIDE (and also the VS integration) should supply them, at least optionally.
    If you feel uneasy to install them, maybe it could be an option to copy them optionally from a VO installation if not already present and make then the required changes.
    Personally I think that would help a lot the people that migrates from VO - and I don't think many people has changed any of these template files other than the cavowed.inf.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Warning sugli ASSIGN generati dal VODbServerEditor 11 Jan 2023 10:31 #24960

    • Chris
    • Chris's Avatar


  • Posts: 3736
  • Hi Wolfgang,

    I understand you, but I'd rather avoid having to deal with anything related to legal matters...

    Also please remember that those messages from the compiler are only warnings, not errors. And those warnings will appear when you port an app, no matter if you have adjusted the templates or not, they will be reported because they will already exist in the VO code itself. Or actually most of them will not be reported at all, because VOXporter disables them (the ones about missing initialization) by default :)

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Warning sugli ASSIGN generati dal VODbServerEditor 13 Jan 2023 00:17 #24979

    • veliero
    • veliero's Avatar
    • Topic Author


  • Posts: 15
  • Ciao Chris,
    grazie; ora la compilazione va a buon fine.

    Saluti
    Francesco

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1
    Moderators: wriedmann