Having trouble with AT Function Behaviour
Posted: Sun Dec 10, 2017 1:37 am
I am having trouble using the AT function. Please see the attached piece of code. The AT function consistently returns Zero.
I would deeply appreciate any help
Thanks in advance
Peter
#include <hmg.ch>
Private S11:= "", S12:= "", S21:= "", S22:= "", S31:="", S32:= ""
Private Location := "", SalaBrak := "", Nationality := "", CurEmployer := ""
Private V_Location := "", V_SalaBrak := "", V_Nationality := "", V_CurEmployer := ""
Location = "Location"
SalaBrak = "Salary Bracket"
Nationlity = "Nationality"
CurEmployer = "Current Employer"
S11 = "Location: Dubai- United Arab Emirates Salary Bracket: $2001 - $3000"
S12 = "Nationality: Romanian Current Employer: Government"
S21 = "Location: Dubai- United Arab Emirates Salary Bracket: $4001 - $5000"
S22 = "Nationality: Irish Current Employer: Seeking work in Dubai"
S31 = "Location: Dubai- United Arab Emirates Salary Bracket: $4001 - $5000"
S32 = "Nationality: British (UK) Current Employer: Not Mentioned"
Proclocationline(S11)
ProcNationalityLine(S12)
Proclocationline(S21)
ProcNationalityLine(S22)
Proclocationline(S31)
ProcNationalityLine(S32)
RETURN
Static Procedure ProcLocationLine(LineInput)
Local LocPtr := 0, LocLen := 0, SalPtr := 0, SalLen := 0
LocLen = 10
SalLen = 16
LocPtr = AT(LineInput, Location)
SalPtr = AT(LineInput, SalaBrak)
V_Location = SUBSTR(LineInput, (LocPtr + LocLen), (SalPtr - LocLen - 1))
V_SalaBrak = SUBSTR(LineInput, (SalPtr + SalLen))
RETURN
*
*
*
Static Procedure ProcNationalityLine(LineInput)
Local NatPtr := 0, NatLen:= 0, EmpPtr := 0, EmpLen := 0
NatLen = 13
EmpLen = 18
NatPtr = AT(LineInput, Nationality)
EmpPtr = AT(LineInput, CurEmployer)
V_Nationality = SUBSTR(LineInput, NatLen, (EmpPtr - NatLen))
V_CurEmployer = SUBSTR(LineInput, (EmpPtr + EmpLen))
RETURN
*
I would deeply appreciate any help
Thanks in advance
Peter
#include <hmg.ch>
Private S11:= "", S12:= "", S21:= "", S22:= "", S31:="", S32:= ""
Private Location := "", SalaBrak := "", Nationality := "", CurEmployer := ""
Private V_Location := "", V_SalaBrak := "", V_Nationality := "", V_CurEmployer := ""
Location = "Location"
SalaBrak = "Salary Bracket"
Nationlity = "Nationality"
CurEmployer = "Current Employer"
S11 = "Location: Dubai- United Arab Emirates Salary Bracket: $2001 - $3000"
S12 = "Nationality: Romanian Current Employer: Government"
S21 = "Location: Dubai- United Arab Emirates Salary Bracket: $4001 - $5000"
S22 = "Nationality: Irish Current Employer: Seeking work in Dubai"
S31 = "Location: Dubai- United Arab Emirates Salary Bracket: $4001 - $5000"
S32 = "Nationality: British (UK) Current Employer: Not Mentioned"
Proclocationline(S11)
ProcNationalityLine(S12)
Proclocationline(S21)
ProcNationalityLine(S22)
Proclocationline(S31)
ProcNationalityLine(S32)
RETURN
Static Procedure ProcLocationLine(LineInput)
Local LocPtr := 0, LocLen := 0, SalPtr := 0, SalLen := 0
LocLen = 10
SalLen = 16
LocPtr = AT(LineInput, Location)
SalPtr = AT(LineInput, SalaBrak)
V_Location = SUBSTR(LineInput, (LocPtr + LocLen), (SalPtr - LocLen - 1))
V_SalaBrak = SUBSTR(LineInput, (SalPtr + SalLen))
RETURN
*
*
*
Static Procedure ProcNationalityLine(LineInput)
Local NatPtr := 0, NatLen:= 0, EmpPtr := 0, EmpLen := 0
NatLen = 13
EmpLen = 18
NatPtr = AT(LineInput, Nationality)
EmpPtr = AT(LineInput, CurEmployer)
V_Nationality = SUBSTR(LineInput, NatLen, (EmpPtr - NatLen))
V_CurEmployer = SUBSTR(LineInput, (EmpPtr + EmpLen))
RETURN
*