Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What ami I missing?

85 views
Skip to first unread message

Richard Latta

unread,
Apr 12, 2022, 2:12:17 PM4/12/22
to
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.

Dan

unread,
Apr 13, 2022, 3:03:17 AM4/13/22
to
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?

dlzc

unread,
Apr 13, 2022, 10:35:12 AM4/13/22
to
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
0 new messages