For Programmers: Free Programming Magazines  


Home > Archive > Clarion > August 2005 > Process Coding Help Sort - Clarion 5B









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Process Coding Help Sort - Clarion 5B
Edwin Mashiringwani

2005-08-22, 6:55 pm

Hi All,

I have what appears to be a coding problem. I use Clarion 5B

I have 2 files ie Invoice and Vendor . ( I must add both files have more
than 10 fields).
There is one field which is common to both files and that is, ACCOUNT field
..
This is a LONG field type.

This is the Code I have placed on Local Objects.ThisProcess (Process Class)

SET(Vendor)
LOOP
NEXT(Vendor)
IF ERRORCODE() THEN BREAK.

INV:VendorNumber = VDR:Vendor Number
IF ACCESS.INVOICE.TRYFETCH(INV:ByVendorNumber)

ELSE
IF INV:Account = 0
INV:Account = VDR:Account
ACCESS:Invoice.Update()
END
END
END
________________________________________
____________________________________
_

This is a process procedure with Vendor file as the file to Process and
Invoice as the Other File

This Code kind of works on some of the invoice Records but some records are
not updated.
In Other words some Invoices Records still remain with a ZERO account when
infact ALL the Account Numbers in the Vendor file are NOT zero.

Is it because I am only acting one field bearing in mind each file has more
than 10 fields.

Thank you
in advance

Edwin Mashiringwani


fanie@coltech.co.za

2005-08-24, 3:55 am

is how u coded it.as i understand i wil do it like following.

Clear(vdr:record)
Set(vendor)

Loop
Next(Vendor)
If ErrorCode() = 33
Break
Elsif ErrorCode()
Message(Error() & '|Next vendor',ErrorCode(),icon:exclamation)
Break
End


!> INV:VendorNumber = VDR:Vendor Number
!> IF ACCESS.INVOICE.TRYFETCH(INV:ByVendorNumber)
!>
!> ELSE
!> IF INV:Account = 0
!> INV:Account = VDR:Account
!> ACCESS:Invoice.Update()
!> END
!> END
!i would do.

inv:vendornumber = vdr:vendornumber
Get(invoice, inv:vendorkey)
If ErrorCode() = 35!not found
inv:account = vdr:account
put(invoice)
if ErrorCode()
Message(ErrorCode() & '|put invoice',ErrorCode())
end
Elsif ErrorCode()
Message(ErrorCode() & '|Get invoice',ErrorCode())
End




End


I help this helps u...




Edwin Mashiringwani wrote:
> Hi All,
>
> I have what appears to be a coding problem. I use Clarion 5B
>
> I have 2 files ie Invoice and Vendor . ( I must add both files have more
> than 10 fields).
> There is one field which is common to both files and that is, ACCOUNT field
> .
> This is a LONG field type.
>
> This is the Code I have placed on Local Objects.ThisProcess (Process Class)
>
> SET(Vendor)
> LOOP
> NEXT(Vendor)
> IF ERRORCODE() THEN BREAK.
>
> INV:VendorNumber = VDR:Vendor Number
> IF ACCESS.INVOICE.TRYFETCH(INV:ByVendorNumber)
>
> ELSE
> IF INV:Account = 0
> INV:Account = VDR:Account
> ACCESS:Invoice.Update()
> END
> END
> END
> ________________________________________
____________________________________
> _
>
> This is a process procedure with Vendor file as the file to Process and
> Invoice as the Other File
>
> This Code kind of works on some of the invoice Records but some records are
> not updated.
> In Other words some Invoices Records still remain with a ZERO account when
> infact ALL the Account Numbers in the Vendor file are NOT zero.
>
> Is it because I am only acting one field bearing in mind each file has more
> than 10 fields.
>
> Thank you
> in advance
>
> Edwin Mashiringwani


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com