xsharp.eu • Tagxxx() functions
Page 1 of 1

Tagxxx() functions

Posted: Tue Jun 30, 2020 5:21 pm
by Karl-Heinz
Hi Robert and Chris,

While trying out some Tagxx() functions i noticed some problems. The sample uses a structural and a non-structual compound index. Each CDX has 3 Tags

-TagCount () does not differentiate whether a CDX is specified or not. The func always returns the number of all available (6) TAGs.

-The Tag() function needs a parameter check since I always have to type e.g. Tag ( , 1) instead of Tag (1)

-My FP-DOS Order() results are different than the X# Order() results. I created a Order_Fix() function that shows the same results as FP-DOS. Maybe someone from the VFP community verifies that ?

the required DBF and CDXs are attached.

Code: Select all


/*

	FP-dialect
   
	xsharp.core
	xsharp.rt
	xsharp.vfp 

*/

FUNCTION Start( ) AS VOID 
LOCAL cPath, cDBF, cCDX AS STRING 

    ? RddSetDefault() // "DBFVFP"
    ?
    
	cPath = "d:test"
	
	cDBF = "small.dbf" 
	cCDX = "small1x.cdx" 
	
	
	DbUseArea ( TRUE, , cPath + cDBF )  // auto opens small.cdx  
	
	DbSetIndex ( cPath + cCDX )  // open small1x.cdx
	  
	DbSetOrder ( 5 )
	
	? "Total No. of Tags" , DbOrderInfo(DBOI_ORDERCOUNT )  // 6    ok 
	?  
	? "No. of SMALL Tags" ,  DbOrderInfo(DBOI_ORDERCOUNT , "SMALL" ) , "must show 3" // 6 instead of 3  , VO shows correctly 3
	? "TagCount() SMALL" , TagCount ( "SMALL" ) , "must show 3" // 6   instead of 3
	? 
	? "No. of SMALL1X Tags" , DbOrderInfo(DBOI_ORDERCOUNT , "SMALL1X" ) , "must show 3" // 6 instead of 3  , VO shows correctly 3
	? "TagCount() SMALL1X" , TagCount ( "SMALL1X" ) , "must show 3" // 6   instead of 3 
	? 
	? 
	
	FOR VAR i = 1 TO TagCount() 
		 ? Cdx (i) , TAG_FIX( i ) , TagNo ( Tag ( , i) ,Cdx(i) )  
	NEXT
    ? 
    
    // note: above, the active order was set to 5 . That´s "ORDER2" of the small1x.cdx  
    
	? "*" , Order("small",1)	// ok, "d:testsmall1x.cdx"
	? "*" , Order("small" )		// wrong  "d:testsmall1x.cdx"
	? "*" , Order( 1 )			// wrong  "d:testsmall1x.cdx"                                       
	? "*" , Order ()			// wrong  "d:testsmall1x.cdx"
	?	
	? "*" , Order_Fix("small",1)	// ok, "d:testsmall1x.cdx"
	? "*" , Order_Fix("small" )		// ok, "ORDER2" 
	? "*" , Order_Fix( 1 ) 			// ok, "ORDER2"                                        
	? "*" , Order_Fix ()    		// ok, "ORDER2" 
	? 
	
    DbSetOrder(0)
    
	// ok, shows empty strings only
	
	? "*" , Order("small",1) 
	? "*" , Order("small" ) 
	? "*" , Order( 1 )                                        
	? "*" , Order ()
	?
	? "*" , Order_Fix("small",1) 
	? "*" , Order_Fix("small" ) 
	? "*" , Order_Fix( 1 )                                        
	? "*" , Order_Fix ()    	   
    
    DbCloseArea()
      
RETURN

FUNCTION TAG_FIX ( CDXFileName, nTagNumber, uArea ) AS STRING CLIPPER
    
	// a param check is needed, something like ...
	
	IF PCount() = 1 
		IF IsNumeric ( CDXFileName )  
			nTagNumber = CdxFileName
			CdxFileName = NIL 			
		ENDIF 
	ENDIF 
			
	RETURN Tag ( CDXFileName , nTagNumber , uArea ) 
	
FUNCTION Order_Fix ( uArea, nPath) AS STRING 
	
	IF PCount() == 0 
		RETURN DbOrderInfo(DBOI_NAME, , 0) // Tag ( , 0) 
		
	ELSEIF PCount() == 1 
		RETURN (uArea)->DbOrderInfo(DBOI_NAME, , 0)  //nTag ( , 0) 
		
	ELSEIF PCount() == 2 
		IF IsNumeric ( nPath ) 
		   RETURN (uArea)-> DbOrderInfo(DBOI_BAGNAME) 
		ENDIF 
		
	ENDIF 
	
	RETURN ""	
regards
Karl-Heinz

Tagxxx() functions

Posted: Wed Jul 01, 2020 7:01 am
by robert
Karl-Heinz ,

Thanks for the report. This is indeed not correct.
We'll fix this, but this will not be included in build 2.5 that we'll release any time now.

Robert

Tagxxx() functions

Posted: Thu Jul 02, 2020 11:08 am
by Karl-Heinz
Hi Robert,

should i open a ticket ?

BTW. I subscribed to the "Announcement" option a few days ago, but I didn't receive a notification about the new build. When I log in, i see the button text "Unsubscribe", so I'm registered, right ? Did anyone who signed up receive a notification ??

https://www.xsharp.eu/forum/announcemen ... um-created

regards
Karl-Heinz

Tagxxx() functions

Posted: Thu Jul 02, 2020 11:58 am
by robert
Karl-Heinz,
Yes please open a ticket.
And w.r.t. the announcement: I see no subscription to the Announcement forum in your forum profile.
I have added this for you now.
There are several others (Wolfgang, Johan, Karl) who were subscribed to this forum and they should have received the notification.

Robert

Tagxxx() functions

Posted: Thu Jul 02, 2020 12:15 pm
by FFF
Robert,
Nope, no mail. Got two from the forum re my Xide question, but none other...
EDIT:Strange, while sitting at the strand, i saw a message on the mobil, about 17:53 - but back in the house it seems to be gone. Never mind...

Tagxxx() functions

Posted: Thu Jul 02, 2020 3:34 pm
by Karl-Heinz
Hi Robert,

Argghhh,... it seems i triggered the [subscribe] button that´s below your very first topic "New announcement forum created" , and not the "Announcements" forum button

regards
Karl-Heinz

Tagxxx() functions

Posted: Thu Jul 02, 2020 4:54 pm
by wriedmann
Hi Robert,
I can confirm that I have received this notification.
Wolfgang