• What ami I missing?

    From Richard Latta@21:1/5 to All on Tue Apr 12 11:12:16 2022
    I am using Xprompt on Windows 7
    My code is as follows:

    Request dbfntx
    set defaultrdd("dbfntx")
    local mmpn,mmpi,mmpt,mcsp

    proc main()
    sele 1
    use g:\f7_\llm____
    do whil .t.
    do whil !bof()
    local subs(x,1,1) := T
    goto bott
    mmpn := mpn
    mcsp := csp
    mmpi := mpi
    mmpt := mpt

    local mpn := mmpn
    repl all csp with mcsp,mpi with mmpi,mpt with mmpt

    local subs(x,1,1) := T
    if bof()
    rele all like m*
    exit
    retu
    else
    skip -1
    endi
    endd
    endd
    retu

    Any assistance would be appreciated.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan@21:1/5 to All on Wed Apr 13 09:03:13 2022
    Il 12/04/2022 20:12, Richard Latta ha scritto:
    I am using Xprompt on Windows 7
    My code is as follows:

    Request dbfntx
    set defaultrdd("dbfntx")
    local mmpn,mmpi,mmpt,mcsp

    Local declaration can't be put after any statement

    proc main()
    sele 1
    use g:\f7_\llm____
    do whil .t.

    this seems an infinite loop. How do you exit?

    do whil !bof()
    local subs(x,1,1) := T
    goto bott
    mmpn := mpn
    mcsp := csp
    mmpi := mpi
    mmpt := mpt

    local mpn := mmpn
    repl all csp with mcsp,mpi with mmpi,mpt with mmpt

    local subs(x,1,1) := T
    if bof()
    rele all like m*
    exit
    retu
    else
    skip -1
    endi
    endd
    endd
    retu

    Any assistance would be appreciated.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dlzc@21:1/5 to wr.now...@gmail.com on Wed Apr 13 07:35:11 2022
    On Tuesday, April 12, 2022 at 11:12:17 AM UTC-7, wr.now...@gmail.com wrote:
    I am using Xprompt on Windows 7
    My code is as follows:

    Request dbfntx
    [...]
    local mmpn,mmpi,mmpt,mcsp

    proc main()
    set defaultrdd("dbfntx") > sele 1 ]
    use g:\f7_\llm____
    do whil .t.
    ... you have just opened the file, you are likely at BOF.
    goto bott ... syntax error? goto expects a record number.
    go bott]

    do whil !bof()
    [...] statement moved up
    local subs(x,1,1) := T
    ... neither 'x' nor 'T' have been defined
    ... you cannot make a function (the LHS of the :=) local.

    mmpn := mpn
    mcsp := csp
    mmpi := mpi
    mmpt := mpt

    local mpn := mmpn
    What the hell are you trying to do with the above statement? "LOCAL" has a meaning, it defines a symbolic name, and optionally assigns it a value. You have already used 'mpn' about 5 lines before. And if 'mpn' is a field name in your database, you
    have created another memory variable with the same name. Now you will have to reference the DBF field with llm____->mpn

    repl all csp with mcsp,mpi with mmpi,mpt with mmpt

    local subs(x,1,1) := T
    ... same crap

    if bof()
    ... recommend you issue CLOSE ALL

    rele all like m*
    ... includes DBF field names, right?

    exit "Dan: THIS is why it would not be an infinite loop, if it did not have other errors."
    retu
    ... only makes sense at the end of a function. The following "else" (just below) ends the true condition processing.

    else
    skip -1
    endi
    endd
    endd
    ... this entire "do while .t." and second "endd" loop are pointless.
    retu

    Any assistance would be appreciated.

    What are you trying to do?

    What did you think you were doing with 'local subs(x,1,1) := T'

    David A. Smith

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)