GetField() Syntax
Posted: Sun Nov 17, 2013 7:16 pm
Hi, I have been right through the forum and help files and just can seem to get this right. I want to return the discount value entered into a user field on the Supplier Table.
My Script is:
OpenTable("Supplier") .OR. Echo ("Table failed to open")
Find(Upper(SCCRead("Name2"))) - where Name2 is the supplier code
nMargin:= GetField('Purchdisc') - Purchdisc is the name of the field in Supplier. It is this value that I want to read.
nNewList := nCost * nMargin
SCRWrite("Margin", nMargin)
CloseTable ()
All works fine if nMargin is a hard coded number, but as a GetField() it does not want to play.
Thanks in Advance.
My Script is:
OpenTable("Supplier") .OR. Echo ("Table failed to open")
Find(Upper(SCCRead("Name2"))) - where Name2 is the supplier code
nMargin:= GetField('Purchdisc') - Purchdisc is the name of the field in Supplier. It is this value that I want to read.
nNewList := nCost * nMargin
SCRWrite("Margin", nMargin)
CloseTable ()
All works fine if nMargin is a hard coded number, but as a GetField() it does not want to play.
Thanks in Advance.