xsharp.eu • Do I see ghosts somewhere?
Page 1 of 2

Do I see ghosts somewhere?

Posted: Tue Jun 16, 2020 10:08 am
by ArneOrtlinghaus
When comparing VO and X# programs we noticed a difference regarding a field in a buffered server object . But the mystery does not happen in the X#-Code, it happens in the VO-Code in a code part already programmed years ago.
Internally the field is created and referenced correctly with the symbol #ENDD
But in runtime the field symbol is #ENDDO!

I made a small console app and here is the result.
It seems that the compiler generates this replacement of symbols. In the macro execution this does not happen.
Is this possible?
And if yes, which symbols may be affected?
endd.png
endd.png (56.58 KiB) Viewed 350 times

Do I see ghosts somewhere?

Posted: Tue Jun 16, 2020 10:32 am
by ArneOrtlinghaus
assymbol("ENDD") is #endd in the runtime execution.

Do I see ghosts somewhere?

Posted: Tue Jun 16, 2020 10:50 am
by Chris
Hi Arne,

Wow, you're right, same goes with #ENDI (ENFID), #ENDC (ENDCASE), #METH etc! Apparently it replaces 4-letter abbreviations with the matching keyword. Obviously a bug in VO.

Do I see ghosts somewhere?

Posted: Tue Jun 16, 2020 12:15 pm
by ArneOrtlinghaus
Hi Chris,
thank you for verifying. Of course I do not ask you to emulate this bug in X#. But I would like to verify, which symbols could be affected. Do you have a possibility to see, which symbols are substituted in VO?

Do I see ghosts somewhere?

Posted: Tue Jun 16, 2020 1:33 pm
by Chris
Hi Arne,

I cannot see it, but I think it's very clear from testing to conclude that ALL symbols that are 4 or more characters long and those characters are the first ones of ANY keyword (like #METH, #METHO, #PROCEDU etc) get substituted to the respective keyword.

And yeah, I agree, we have emulated a lot of weird behavior of VO in X#, but this one would be gong just way too far :)

Do I see ghosts somewhere?

Posted: Tue Jun 16, 2020 5:57 pm
by robert
Chris,

Meinhard was the last person that worked on VO. Maybe he can fix this in VO ?

Robert

Do I see ghosts somewhere?

Posted: Wed Jun 17, 2020 7:28 am
by ArneOrtlinghaus
It is not necessary to fix it in VO. Worse: Our program now relies on that behavior. It works correctly, if everything remains as it is. Fortunately only few parts with secondary importance should be involved. That's why I wanted to know for which symbols this happens so that I can search for them in the program and think about workarounds for X#.

Do I see ghosts somewhere?

Posted: Wed Jun 17, 2020 8:33 am
by Karl-Heinz
Hi Arne,

take a look at the VO "Built-in" Commands. I haven't tried all of them, but I've noticed that #Text doesn't expand to #Textblock.

Code: Select all

? AsString( #begi )  , AsString ( #ifde )  , AsString ( #ifnd ) ,  AsString ( #fiel ) , AsString ( #decl )  , AsString ( #text )
regards
Karl-Heinz

Do I see ghosts somewhere?

Posted: Wed Jun 17, 2020 3:02 pm
by ArneOrtlinghaus
Bingo!
the "built-in" commands show this behavior if at least 4 characters have been set. Exceptions: the commands with a blank containing and textblock.
Here is a list of 55 symbols, that are automatically transformed. Interesting how many secrets we still can discover for VO at the end of its lifecycle.
ACCE -> ACCESS
ACCES -> ACCESS
ASSI -> ASSIGN
ASSIG -> ASSIGN
BEGI -> BEGIN
CLAS -> CLASS
DECL -> DECLARE
DECLA -> DECLARE
DECLAR -> DECLARE
DEFI -> DEFINE
DEFIN -> DEFINE
WHIL -> WHILE
ENDI -> ENDIF
ENDD -> ENDDO
FIEL -> FIELD
FUNC -> FUNCTION
FUNCT -> FUNCTION
FUNCTI -> FUNCTION
FUNCTIO -> FUNCTION
GLOB -> GLOBAL
GLOBA -> GLOBAL
LOCA -> LOCAL
MEMV -> MEMVAR
MEMVA -> MEMVAR
METH -> METHOD
METHO -> METHOD
PARA -> PARAMETERS
PARAM -> PARAMETERS
PARAME -> PARAMETERS
PARAMET -> PARAMETERS
PARAMETE -> PARAMETERS
PARAMETER -> PARAMETERS
PRIV -> PRIVATE
PRIVA -> PRIVATE
PRIVAT -> PRIVATE
PROC -> PROCEDURE
PROCE -> PROCEDURE
PROCED -> PROCEDURE
PROCEDU -> PROCEDURE
PROCEDUR -> PROCEDURE
PUBL -> PUBLIC
PUBLI -> PUBLIC
RESO -> RESOURCE
RESOU -> RESOURCE
RESOUR -> RESOURCE
RESOURC -> RESOURCE
RETU -> RETURN
RETUR -> RETURN
STAT -> STATIC
STATI -> STATIC
STRU -> STRUCTURE
STRUC -> STRUCTURE
STRUCT -> STRUCTURE
STRUCTU -> STRUCTURE
STRUCTUR -> STRUCTURE

Do I see ghosts somewhere?

Posted: Wed Jun 17, 2020 6:16 pm
by Karl-Heinz
Hi Arne,

Here are a few more ;-)

Code: Select all

? AsString ( #ifde )  // IFDEF
? AsString ( #ifnd )  // IFNDEF
? AsString ( #brea ) // BREAK
? AsString ( #sequ ) // SEQUENCE 
? AsString ( #reco ) // RECOVER 
? AsString ( #usin ) // USING   
? AsString ( #inhe ) // INHERIT  
? AsString ( #pasc ) // PASCAL   
? AsString ( #clip ) // CLIPPER
? AsString ( #memb ) // MEMBER 
? AsString ( #unio ) // UNION
? AsString ( #alig ) // ALIGN 
? AsString ( #exte ) // EXTERN  ? 

// and of course the datatypes:  
?   
? AsString ( #usua ) // USUAL 
? AsString ( #arra ) // ARRAY  
? AsString ( #floa ) // FLOAT
? AsString ( #real ) // REAL4   
? AsString ( #dwor ) // DWORD 
? AsString ( #shor ) // SHORTINT
? AsString ( #long ) // LONGINT 
? AsString ( #stri ) // STRING
? AsString ( #symb ) // SYMBOL 
? AsString ( #code ) // CODEBLOCK  
? AsString ( #obje ) // OBJECT
? AsString ( #logi ) // LOGIC
?
regards
Karl-Heinz