0

PowerBuilder 12.5 Classic の long、longlong、integer、dec、および decimal
のデータ型に問題があります。

// set variables for item price and the cash given by the customer

double price, cash

price=double(trim(sle_price.text))
cash=double(trim(sle_cash.text))



if cash="" then
    messagebox("","CASH")
    sle_cash.setfocus()
    return
end if

if  fare="" then
    messagebox("","SET FARE")
    sle_amount.setfocus()
    return
end if
double balance

balance=cash -price


 messagebox("",balance)

INSERT INTO cash_table  
         ( items.price   

  VALUES ( :price );
4

2 に答える 2

3

私のコメントより

double と string を比較しようとするのはなぜですか?

異なるタイプを比較することは違法です。正しい例

if trim(sle_cash.text) = "" then
于 2012-07-27T16:21:30.143 に答える
0

入力フィールドが空かどうかを調べるためにdouble cashdouble fare変数を比較していると思います。"" (empty string)その方法の代わりに、次のようなことができます。

if trim(sle_cash.text)="" then
    messagebox("","CASH")
    sle_cash.setfocus()
    return
end if

if  trim(sle_fare.text)="" then
    messagebox("","SET FARE")
    sle_amount.setfocus()
    return
end if
于 2012-07-27T08:13:59.453 に答える