locked
Where the array is declared. RRS feed

  • Question

  • Dear all,

               I have a SCX file which contains a two dimensional array
    name as item. As I browse and search the code
    I cannot find where the array is declared. I use go fish to search the
    array name. And it finds 3-RESERVED3

    cnt
    changed
    ^item[100,20]

    And I don't understand the mechanism about how the two dimensional
    array is declared in foxpro. Here is my
    code:

    nodefault
    private all like z*

    with thisform

            .txtSstockcode.value = mypad( .txtSstockcode.value,
    len(stock.scode) )

            do case
            case empty(.txtSstockcode.value)
                    announce('請輸入 貨品編號')
                    return
            case empty(.txtSsupcode.value)
                    announce('請輸入 供應商編號')
                    return
            case empty(.txtSsupinvno.value)
                    announce('請輸入 供應商發票編號')
                    return
            case .cnt=1000
                    announce('最多1000款')
                    return
            case .txtClass.value<'00' .or. .txtClass.value>'99'
                    announce('等級 不對, 要 00 至 99')
                    return
            case !check_input ( .txtSame, (.txtSame.value >= 1), '請輸入 數量')
                    return
            case !check_input ( .txtScost, (.txtScost.value > 0 ), '請輸入 成本')
                    return
            case !check_input ( .txtSprice, (.txtSprice.value > 0 ), '請輸入 定價')
                    return
            case !check_index ( .txtSSupCode, 'supplier', 'scode', 'scode', '請輸入 供
    應商編號')
                    return
            case !check_index ( .txtSStockCode,  'jew_name', 'gcode', 'gcode', '請輸
    入 貨品編號')
                    return
            case !.changed
                    announce('最少要改變了'+crlf+' 折扣,增值比例,重量,'+crlf+'成本,定價'+crlf+'才可繼續')
                    return
    *       case !indexseek(.txtSstockcode.value + .txtClass.value, .f.,
    'stock', 'sstockcode') .and. !confirm('貨品編號 從 0001 開始, 確定?')
    *               return
            endcase

            cursor2(1)

            z2 = .txtSstockcode.value
            z3 = .txtSweight.value

            if empty(.txtClass.value)
                    select weight
                    locate for material$subs(z2,2,2) .and. lower<=z3 .and. z3<=higher
    *               if !found()
    *                       announce('決定不了等級')
    *                       return
    *               endif
                    .txtClass.value = cat
            endif

            if .cnt=0
                    .txtSsupcode.enabled = .F.
                    .txtSindate.enabled = .F.
                    .txtSsupinvno.enabled = .F.
            endif

            store .cnt+1 to z1, .cnt
            .item[z1,1] = .txtDiscount.value
            .item[z1,2] = .txtMarkup.value
            .item[z1,3] = .txtWeight.value
            .item[z1,4] = round( .txtTtlCost.value * .txtDiscount.value,2)

            .item[z1,5] = .txtSame.value
            .item[z1,6] = .txtSstockcode.value
            .item[z1,7] = .txtSsupstock.value
            .item[z1,8] = .txtSweight.value
            .item[z1,9] = .txtSlength.value
            .item[z1,10] = .txtSlabor.value
            .item[z1,11] = .Spinner1.value
            .item[z1,12] = .Spinner2.value
            .item[z1,13] = .txtSjawgt.value
            .item[z1,14] = .txtSjjwgt.value
            .item[z1,15] = .txtSjpdia.value
            .item[z1,16] = .txtSggoldp.value
            .item[z1,17] = .txtScost.value
            .item[z1,18] = .txtSprice.value
            .item[z1,19] = .txtClass.value
            .item[z1,20] = .txtSubCode.value

            .txtInvLine.value = .cnt
            .txtInvQty.value = .txtInvQty.value + .txtSame.value
            .txtInvCost.value = round(.txtInvCost.value + .item[z1,4], 2)
            .txtInvCostAct.value = .txtInvCost.value

    *       store 1 to .txtDiscount.value, .txtMarkup.value
            store 0 to .txtWeight.value, .txtTtlCost.value, .txtSame.value, ;
                                    .txtSweight.value, .txtSlength.value, .txtSlabor.value, ;
                                    .Spinner1.value, .Spinner2.value, .txtSjawgt.value, .txtSjjwgt.value, .txtSjpdia.value, ;
                                    .txtSggoldp.value, .txtScost.value, .txtSprice.value
            store ''
    to .txtSstockcode.value, .txtSsupstock.value, .txtClass.value, .txtSubCode.value

            .cmdConfirm.visible = .T.
            .changed = .F.

            .txtSstockcode.setFocus

            cursor2(0)

    endwith


    hon123456
    Monday, June 7, 2010 1:59 AM

Answers

  • Array is declared as Form Property.

    you can access your array thisform.item[x,y]





    Please "Mark as Answer" if this post answered your question. :)

    Kalpesh Chhatrala | Software Developer | Rajkot | India

    Kalpesh's Blog
    • Proposed as answer by Pavel Celba Tuesday, June 8, 2010 11:02 AM
    • Marked as answer by hi123456 Saturday, June 12, 2010 12:10 PM
    Monday, June 7, 2010 5:25 AM
    Answerer