ASort() error

ASort() error

Postby StefanHaupt » Thu Mar 07, 2013 11:09 am

Hi,

with harbour I get a strange compiler error in this line
Code: Select all  Expand view
aPair :=   { {"Sun",8}, {"Mon",1}, {"Tue",57}, {"Wed",-6} }
ASORT( aPair,,, {| x, y | x[2] < y[2] } ) // syntax error at "["


with xHarbour it´s compiling fine.

Does anyone has an idea why it does not compile with harbour ?
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: ASort() error

Postby anserkk » Thu Mar 07, 2013 12:23 pm

Your code is working fine here with Harbour and xHarbour

Code: Select all  Expand view
#Include "FiveWin.ch"
Function Main()
  Local aPair
  aPair :=   { {"Sun",8}, {"Mon",1}, {"Tue",57}, {"Wed",-6} }
  ASORT( aPair,,, {| x, y | x[2] < y[2] } ) // syntax error at "["
  ? "Completed"
Return NIL


Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: ASort() error

Postby ADutheil » Thu Mar 07, 2013 12:34 pm

Compiled without problem with HARBOUR:

Version: Harbour 3.2.0dev (Rev. 18819)
Compiler: Microsoft Visual C++ 16.0.30319 (32-bit)
Platform: Windows 7 6.1.7601 Service Pack 1
PCode version: 0.3
ChangeLog last entry: 2013-02-03 12:59 UTC+0100 Viktor Szakats
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: ASort() error

Postby hmpaquito » Thu Mar 07, 2013 1:27 pm

Stephan,

Perhaps is waste hidden characters from your code editor. Delete line and retyped function.

Regards
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: ASort() error

Postby StefanHaupt » Fri Mar 08, 2013 7:44 am

thanks for all hints, finally I found it

I had a wrong #translate direction in my code. Because harbour does not support the new bit operators (bit or: <x> | <y> ) I tried to simulate it with
Code: Select all  Expand view
#translate <x> | <y>  =>  HB_BITOR( <x>, <y> )
but this failed in codeblocks
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests