Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

Behavior SetSoftSeek() in Visual Studio differs from VO and X# 28 Mar 2022 06:14 #22044

  • ThomasWYale
  • ThomasWYale's Avatar
  • Topic Author


  • Posts: 42
  • First, it's merely assumed that users have Visual Studio installed before installing X#. I recently discovered that that's the reason I didn't have integration between the two. When I reinstalled X# with VS installed, then I could open the project in VS generated by the VOXPorter. Perhaps something for future reference for other developers.

    This involves another issue entirely. In my application, I have SetSoftSeek(TRUE) at start of runtime. Later, among other values, it searches for the expression "aa" in a dbf file called TypeRule. Given its particular operation, the records can't have spaces following the expressions but are followed with the "{" character, ASCII value 123, which is 1 higher than the alphabetic characters it searches for, instead of spaces, which are ASCII value 32. With that, when searching for a string such as "aasvPSs", the record pointer should point to a record with "aa{{{{{{{{" in the indexed field, and given that SetSoftSeek() is true, EOF() should be false.

    In X# and VO, the record pointer points at that very record and EOF() is false, but in VS, the field is blank because EOF() is true.

    I think this is handled by VORDDClasses, which is present in the VS project as well as in X# and the original VO. Is there any way to resolve this so that it runs the same in both?

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

    Last edit: by ThomasWYale.

    Behavior SetSoftSeek() in Visual Studio differs from VO and X# 28 Mar 2022 07:31 #22045

    • robert
    • robert's Avatar


  • Posts: 3289
  • Thomas,
    Thanks for your remark about the installer.
    I'll try to add a warning to the next installer.
    W.r.t. the softseek issue: I really do not understand why the behavior of X# inside VS could differ from the behavior outside of VS. Running inside VS should have no influence on the runtime behavior.

    Robert
    XSharp Development Team
    The Netherlands

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

    Behavior SetSoftSeek() in Visual Studio differs from VO and X# 28 Mar 2022 09:21 #22046

    • Chris
    • Chris's Avatar


  • Posts: 3751
  • Hi Thomas,

    In addition to what Robert said, can you please send a sample reproducing the problem?

    .
    XSharp Development Team
    chris(at)xsharp.eu

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

    Behavior SetSoftSeek() in Visual Studio differs from VO and X# 28 Mar 2022 16:39 #22047

    • ThomasWYale
    • ThomasWYale's Avatar
    • Topic Author


  • Posts: 42
  • Sure. For some reason the VS fails to build this. Also, dbf's and ntx's aren't among the filetypes that I can include as an attachments. The structure and the sought record is here:

    RECNO TYPE RULE ABBREV RETAIN PLACEHLDER SUBTYPE BASETYPE EMBED PRIBASIC DEFDUPES
    98 3 aa{{{{{{{{{{ a 0 0

    TYPE is a 1-byte character field and RULE is a 12-byte character field, and DBCREATEINDEX("c:\DiscoveryOLD\dbfs\TYPERUL1","TYP Rule Placehlder")
    Attachments:

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

    Behavior SetSoftSeek() in Visual Studio differs from VO and X# 28 Mar 2022 18:47 #22048

    • Chris
    • Chris's Avatar


  • Posts: 3751
  • Hi Thomas,

    Thanks for the file. You did not mention what error you are getting in X#, but most likely it's that you jest need to go to the project properties, "Language" page and enable the options "Enable MEMVAR support" and "Enable Undeclared variables support". We will make sure that VOXporter automatically enables those options in the next X# release.

    About the data files, please zip all the necessary dbf/ntx and or dbt files and upload the .zip file, this is allowed.

    .
    XSharp Development Team
    chris(at)xsharp.eu

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

    Behavior SetSoftSeek() in Visual Studio differs from VO and X# 29 Mar 2022 03:33 #22049

    • ThomasWYale
    • ThomasWYale's Avatar
    • Topic Author


  • Posts: 42
  • Actually there is no error when I run it from X# or VO, only when I run it from VS. Also, I did check the memvar support and undeclared variables support in all three.

    In any event, I found out what the real problem was: it was searching for the value with the wrong index. When opening up more than one index file for a dbf file, the active index and order is different depending on which IDE it's run from. :blink: Robert was right. SetSoftSeek() behaves the same way whether in VO, X# or VS.

    DBUSEAREA(TRUE,"DBFNTX","c:\DiscoveryOLD\dbfs\TYPERULE.dbf")
    DbSetIndex("c:\DiscoveryOLD\dbfs\TYPERUL1") <<<<< In VO, it's the first index file opened.
    DbSetIndex("c:\DiscoveryOLD\dbfs\TYPERUL2")
    DbSetIndex("c:\DiscoveryOLD\dbfs\TYPERUL3") <<<<< In VS, it's the last.

    So at the point where DBSelectArea("TYPERULE") is executed just prior to searching for the intended record, I just put DBSetOrder(1), and solved the problem. I guess you wouldn't need the zip file with the DBF's or NTX's then. Oy. :unsure: :S

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

    Last edit: by ThomasWYale.

    Behavior SetSoftSeek() in Visual Studio differs from VO and X# 29 Mar 2022 09:30 #22051

    • FFF
    • FFF's Avatar


  • Posts: 1392
  • Congrats...
    FTR, there seems to be a misunderstanding/-spelling: "X#" is the compiler, "Xide" is Chris' IDE for it.
    Regards
    Karl (X# 2.14.0.4; Xide 1.33; W8.1/64 German)

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

    Behavior SetSoftSeek() in Visual Studio differs from VO and X# 29 Mar 2022 10:31 #22052

    • Chris
    • Chris's Avatar


  • Posts: 3751
  • Hi Thomas,

    Indeed, no need to send the dbfs, actually this specific problem (different behavior to VO) was reported and fixed last month, see here: github.com/X-Sharp/XSharpPublic/issues/958. The fix is already available in the latest subscribers' X# release and will be included also in the next public build.

    But this issue is the same no problem where you are are running the app from, the IDE (VS or XIDE) should have absolutely nothing to do with it, so I am surprised you say you get different results. Maybe you are actually testing with slightly different code in the two IDEs and that makes the results slightly different. Of course, when you run the app from VO, then the results are different (due to above mentioned bug in X#), but VO has nothing to do with X#.

    Also as Karl said, there seems to be some confusion with names. To clarify:

    - X# is the main product, the compiler, runtime, VOXporter and many more things, also including integration for VS.
    - XIDE is a standalone (freeware) IDE designed to work (mainly) with X#
    - VS is, well, VS :). X# integrates into it.

    The compiler and the runtime is always the same, no matter which IDE you are using, so when the code is the same and the compiling options are the same, in both cases the X# apps should be behaving EXACTLY the same.

    .
    XSharp Development Team
    chris(at)xsharp.eu

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

    Last edit: by Chris.
    • Page:
    • 1