FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ASort() error
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
ASort() error
Posted: Thu Mar 07, 2013 11:09 AM
Hi,

with harbour I get a strange compiler error in this line
Code (fw): Select all Collapse
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
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: ASort() error
Posted: Thu Mar 07, 2013 12:23 PM
Your code is working fine here with Harbour and xHarbour

Code (fw): Select all Collapse
#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
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: ASort() error
Posted: 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
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: ASort() error
Posted: Thu Mar 07, 2013 01:27 PM

Stephan,

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

Regards

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: ASort() error
Posted: Fri Mar 08, 2013 07: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 (fw): Select all Collapse
#translate <x> | <y>  =>  HB_BITOR( <x>, <y> )
but this failed in codeblocks
kind regards

Stefan

Continue the discussion