Sintax error

Sintax error

Postby wartiaga » Tue Mar 12, 2019 4:48 pm

Hi,

Can you help me about this code sintax? The compiler results ")" error. Thanks in advance.

oFrPrn:SetUserDataSet( "aClientes", cFld,;
{ || nAt := 1, EVAL( bResync, nAt ) },;
{ || nAt++, EVAL( bResync, nAt ) },;
{ || nAt--, EVAL( bResync, nAt ) },;
{ || nAt > LEN( aClientes ) },;
{ |cFld| iif( cFld == "Codigo", aClientes[ nAt, 1 ],;
iif( cFld == "Nome", aClientes[ nAt, 2 ],;
iif( cFld == "Endereco", aClientes[ nAt, 3 ],;
iif( cFld == "Bairro", aClientes[ nAt, 4 ],;
iif( cFld == "Cidade", aClientes[ nAt, 5 ],;
iif( cFld == "Uf", aClientes[ nAt, 6 ]))))))})
wartiaga
 
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Re: Sintax error

Postby carlos vargas » Tue Mar 12, 2019 5:44 pm

Code: Select all  Expand view

oFrPrn:SetUserDataSet( "aClientes", cFld,;
{ || nAt := 1, EVAL( bResync, nAt ) },;
{ || nAt++   , EVAL( bResync, nAt ) },;
{ || nAt--   , EVAL( bResync, nAt ) },;
{ || nAt > LEN( aClientes )         },;
{ |cFld| Test1( cFld, nAt ) } )


static function Test1(cFld,nAt)
 local uRet
 do case
 case cFld == "Codigo"
  uRet = aClientes[ nAt, 1 ]
 case cFld == "Nome"
  uRet = aClientes[ nAt, 2 ]
 case cFld == "Endereco"
  uRet = aClientes[ nAt, 3 ]
 case cFld == "Bairro"
  uRet = aClientes[ nAt, 4 ]
 case cFld == "Cidade"
  uRet = aClientes[ nAt, 5 ]
 case cFld == "Codigo"
  uRet = aClientes[ nAt, 6 ]
 endcase
return uRet
 
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1720
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: Sintax error

Postby wartiaga » Tue Mar 12, 2019 7:52 pm

carlos vargas wrote:
Code: Select all  Expand view

oFrPrn:SetUserDataSet( "aClientes", cFld,;
{ || nAt := 1, EVAL( bResync, nAt ) },;
{ || nAt++   , EVAL( bResync, nAt ) },;
{ || nAt--   , EVAL( bResync, nAt ) },;
{ || nAt > LEN( aClientes )         },;
{ |cFld| Test1( cFld, nAt ) } )


static function Test1(cFld,nAt)
 local uRet
 do case
 case cFld == "Codigo"
  uRet = aClientes[ nAt, 1 ]
 case cFld == "Nome"
  uRet = aClientes[ nAt, 2 ]
 case cFld == "Endereco"
  uRet = aClientes[ nAt, 3 ]
 case cFld == "Bairro"
  uRet = aClientes[ nAt, 4 ]
 case cFld == "Cidade"
  uRet = aClientes[ nAt, 5 ]
 case cFld == "Codigo"
  uRet = aClientes[ nAt, 6 ]
 endcase
return uRet
 


Thank you!
wartiaga
 
Posts: 212
Joined: Wed May 25, 2016 1:04 am

Re: Sintax error

Postby AntoninoP » Wed Mar 13, 2019 11:35 am

In your original code is missing the second part of last iif,

oFrPrn:SetUserDataSet( "aClientes", cFld,;
{ || nAt := 1, EVAL( bResync, nAt ) },;
{ || nAt++, EVAL( bResync, nAt ) },;
{ || nAt--, EVAL( bResync, nAt ) },;
{ || nAt > LEN( aClientes ) },;
{ |cFld| iif( cFld == "Codigo", aClientes[ nAt, 1 ],;
iif( cFld == "Nome", aClientes[ nAt, 2 ],;
iif( cFld == "Endereco", aClientes[ nAt, 3 ],;
iif( cFld == "Bairro", aClientes[ nAt, 4 ],;
iif( cFld == "Cidade", aClientes[ nAt, 5 ],;
iif( cFld == "Uf", aClientes[ nAt, 6 ],))))))})
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: Sintax error

Postby wartiaga » Wed Mar 13, 2019 2:19 pm

AntoninoP wrote:In your original code is missing the second part of last iif,

oFrPrn:SetUserDataSet( "aClientes", cFld,;
{ || nAt := 1, EVAL( bResync, nAt ) },;
{ || nAt++, EVAL( bResync, nAt ) },;
{ || nAt--, EVAL( bResync, nAt ) },;
{ || nAt > LEN( aClientes ) },;
{ |cFld| iif( cFld == "Codigo", aClientes[ nAt, 1 ],;
iif( cFld == "Nome", aClientes[ nAt, 2 ],;
iif( cFld == "Endereco", aClientes[ nAt, 3 ],;
iif( cFld == "Bairro", aClientes[ nAt, 4 ],;
iif( cFld == "Cidade", aClientes[ nAt, 5 ],;
iif( cFld == "Uf", aClientes[ nAt, 6 ],))))))})


Thank you AntoninoP!
wartiaga
 
Posts: 212
Joined: Wed May 25, 2016 1:04 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 73 guests