Giter VIP home page Giter VIP logo

Comments (5)

cpyrgas avatar cpyrgas commented on August 23, 2024

There are also some more incompatibilities, but VO's behavior looks crazy for most, so not sure if we should deal with those:

  1. Passing the string as filter to the first param (which should accept a codeblock) of DBSetFilter() with for example DBSetFilter("alltrim(fld)=='bbb'") results to a runtime "Syntax Error" in VO, with message "Error setting filter". In X#, this works without errors, even though the type of the argument to the function was wrong. Not sure if we should change that.

  2. For some bizarre reason, VO for this code:

	DbSetFilter(,".T.")
	DbGotop()
	? EOF()
	DbSetFilter(,".F.")
	DbGotop()
	? EOF()
	DbSetFilter(,"1==2")
	DbGotop()
	? EOF()
	DbSetFilter(,"1==1")
	DbGotop()
	? EOF()
	DbSetFilter(,"SOMEINVALIDFILTER")
	DbGotop()
	? EOF()

returns T,T,T,F,F for DBFCDX and F,F,F,F,F for DBFNTX!!! None of the two make any sense, so I guess we should ignore this.

from xsharppublic.

RobertvanderHulst avatar RobertvanderHulst commented on August 23, 2024
  1. When you pass a string as first parameter to DbSetFilter() then we convert that to a codeblock and assume you meant to pass it as second parameter. This should not harm I think
  2. These should not produce an exception. Will fix that.

from xsharppublic.

cpyrgas avatar cpyrgas commented on August 23, 2024

Robert, sorry, the "runtime exception" comments in the code in #1489 (comment) were a leftover from previous tests, will fix that. None of those produce an exception in X#, it's just different behavior to (the very bizarre behavior of) VO.

X# produces a runtime exception only for the original report #1489 (comment), DBSetFilter() with whitespace for the filter string, which is the main problem.

from xsharppublic.

RobertvanderHulst avatar RobertvanderHulst commented on August 23, 2024

The problem with the white space should be fairly easy to fix.
There is already the following code:

FUNCTION DbSetFilter(cbCondition, cCondition) AS LOGIC CLIPPER
    LOCAL sCondition AS STRING
    LOCAL cbCond AS CODEBLOCK
    if PCount() == 0 .or. (cbCondition:IsNil .and. cCondition:IsNil)
        return DbClearFilter()
    endif

We can add a condition there to test for an empty string.

from xsharppublic.

cpyrgas avatar cpyrgas commented on August 23, 2024

OK, done, but this exposed a deeper serious issue with DBSetFilter(), I opened #1493 for it

from xsharppublic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.