Subject Re: " ? " function not working
From Mervyn Bick <invalid@invalid.invalid>
Date Sat, 19 Aug 2017 22:31:43 +0200
Newsgroups dbase.getting-started

On 2017-08-19 9:40 PM, Bob McKinney wrote:
> Hi A: Have been trying to add/edit my code at my shop using  db2.8  - w/7 on a peer to peer network.
>      I wrote the following code on my computer at home (not on a network) and it worked fine, both the " ? " function (displaying in the view section of the command window) and the code itself.
>      On the shop computer,  the " ? " would not display and I could not get the code itself to work.  Trying to run the edited code screwed up the network by changing the code at the beginning ( set procedure to Invoicedatamodulel.dmd  to invoicekdatamodule.dmo ).  As a result, the computer could not find a table.
>
> [begin code sample]
>     function EQUANTITY_onLostFocus
>        local rs, mPrc,mQty,mNPrc,mFrt
>        rs = form.InvoiceDataModule1.Lineitem1.rowset
>        mQty = 0
>        mPrc = 0
>        mNPrc = 0
>        mFrt = 0
>        mPrc := rs.fields["price"].value
>        mQty := rs.fields["Quantity"].value
> ? mPrc   " Price "     //Would not load or display
> ? mQty   " Qty "    // Same thing

You need a comma between the variable and the text literal.  You should
have had an error message saying "Unallowed phrase/keyword in command:
Price" (and Qty" for the second print statement.)

? mPrc ,  " Price "
? mQty ,  " Qty "

>        do case
>         case rs.fields["Quantity"].value <2 and ;
>             rs.fields["partNumber"].value = "TIP0-17"
>              if rs.fields["Quantity"].value <2  // one
>                rs.fields["Price"].value := (mPrc*2)
>              endif
> [ End code sample]
>
> Is the reason for this reaction because of the network?  I cannot understand it not working since I have edited code in years gone by w/out these problems.  Any help appreciated..........Bob

The network should not be the cause of this problem.

Mervyn.