fbpx
Welcome, Guest
Username: Password: Remember me
This public forum is meant for questions and discussions about Visual FoxPro
  • Page:
  • 1

TOPIC: Tagxxx() functions

Tagxxx() functions 30 Jun 2020 19:21 #15079

  • Karl-Heinz's Avatar

  • Karl-Heinz

  • Topic Author


  • Posts: 575
  • 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.
    /*
    
    	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:\test\small1x.cdx"
    	? "*" , Order("small" )		// wrong  "d:\test\small1x.cdx"
    	? "*" , Order( 1 )			// wrong  "d:\test\small1x.cdx"                                       
    	? "*" , Order ()			// wrong  "d:\test\small1x.cdx"
    	?	
    	? "*" , Order_Fix("small",1)	// ok, "d:\test\small1x.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
    Attachments:

    Please Log in or Create an account to join the conversation.

    Tagxxx() functions 01 Jul 2020 09:01 #15081

  • robert's Avatar

  • robert


  • Posts: 1746
  • 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
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Tagxxx() functions 02 Jul 2020 13:08 #15089

  • Karl-Heinz's Avatar

  • Karl-Heinz

  • Topic Author


  • Posts: 575
  • 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 ??

    www.xsharp.info/forum/announcements/1987...cement-forum-created

    regards
    Karl-Heinz

    Please Log in or Create an account to join the conversation.

    Tagxxx() functions 02 Jul 2020 13:58 #15090

  • robert's Avatar

  • robert


  • Posts: 1746
  • 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
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Tagxxx() functions 02 Jul 2020 14:15 #15091

  • FFF's Avatar

  • FFF


  • Posts: 956
  • 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...
    Regards
    Karl (X# 2.5a; Xide 1.25; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    Last edit: by FFF.

    Tagxxx() functions 02 Jul 2020 17:34 #15092

  • Karl-Heinz's Avatar

  • Karl-Heinz

  • Topic Author


  • Posts: 575
  • 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

    Please Log in or Create an account to join the conversation.

    Tagxxx() functions 02 Jul 2020 18:54 #15094

  • wriedmann's Avatar

  • wriedmann


  • Posts: 2281
  • Hi Robert,
    I can confirm that I have received this notification.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1