Corretta creazione della chiave
git-svn-id: svn://10.65.10.50/trunk@3730 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									880ce20da5
								
							
						
					
					
						commit
						b9b081562b
					
				@ -619,18 +619,22 @@ HIDDEN void do_key(char *fname, RecDes *r, TAG4INFO *tag_info, int n_keys)
 | 
				
			|||||||
      
 | 
					      
 | 
				
			||||||
      strcat(tag_info[i].expression,r->Fd[nf].Name); /* Append field name */
 | 
					      strcat(tag_info[i].expression,r->Fd[nf].Name); /* Append field name */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (r->Ky[i].FromCh[j] != 255)                 /* If partial field was specified */
 | 
					      /* If partial field was specified */
 | 
				
			||||||
      {                                              /* add parameters to SUBSTR */
 | 
					      /* add parameters to SUBSTR */
 | 
				
			||||||
 | 
					/*      
 | 
				
			||||||
 | 
					      if (r->Ky[i].FromCh[j] != 255)                 
 | 
				
			||||||
 | 
					      {                                           
 | 
				
			||||||
        char ts[8];
 | 
					        char ts[8];
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        strcat(tag_info[i].expression,",");
 | 
					        strcat(tag_info[i].expression,",");
 | 
				
			||||||
        sprintf(ts,"%d",r->Ky[i].FromCh[j]);
 | 
					        sprintf(ts,"%d",r->Ky[i].FromCh[j] + 1);
 | 
				
			||||||
        strcat(tag_info[i].expression,ts);
 | 
					        strcat(tag_info[i].expression,ts);
 | 
				
			||||||
        strcat(tag_info[i].expression,",");
 | 
					        strcat(tag_info[i].expression,",");
 | 
				
			||||||
        sprintf(ts,"%d",r->Ky[i].ToCh[j] - r->Ky[i].FromCh[j] + 1);
 | 
					        sprintf(ts,"%d",r->Ky[i].ToCh[j] - r->Ky[i].FromCh[j] + 1);
 | 
				
			||||||
        strcat(tag_info[i].expression,ts);
 | 
					        strcat(tag_info[i].expression,ts);
 | 
				
			||||||
        strcat(tag_info[i].expression,")");
 | 
					        strcat(tag_info[i].expression,")");
 | 
				
			||||||
      }           
 | 
					      }           
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
      switch (r->Fd[nf].TypeF)                 /* If numeric field was specified  */
 | 
					      switch (r->Fd[nf].TypeF)                 /* If numeric field was specified  */
 | 
				
			||||||
      {                                        /* add parameters to STR */
 | 
					      {                                        /* add parameters to STR */
 | 
				
			||||||
@ -658,6 +662,18 @@ HIDDEN void do_key(char *fname, RecDes *r, TAG4INFO *tag_info, int n_keys)
 | 
				
			|||||||
      /* Close parentheses if UPPER or DTOS operators were used: */
 | 
					      /* Close parentheses if UPPER or DTOS operators were used: */
 | 
				
			||||||
      if (r->Ky[i].FieldSeq[j] > MaxFields || (r->Fd[nf].TypeF == _datefld)) 
 | 
					      if (r->Ky[i].FieldSeq[j] > MaxFields || (r->Fd[nf].TypeF == _datefld)) 
 | 
				
			||||||
        strcat(tag_info[i].expression,")");    
 | 
					        strcat(tag_info[i].expression,")");    
 | 
				
			||||||
 | 
					      if (r->Ky[i].FromCh[j] != 255)                 /* If partial field was specified */
 | 
				
			||||||
 | 
					      {                                              /* add parameters to SUBSTR */
 | 
				
			||||||
 | 
					        char ts[8];
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        strcat(tag_info[i].expression,",");
 | 
				
			||||||
 | 
					        sprintf(ts,"%d",r->Ky[i].FromCh[j] + 1);
 | 
				
			||||||
 | 
					        strcat(tag_info[i].expression,ts);
 | 
				
			||||||
 | 
					        strcat(tag_info[i].expression,",");
 | 
				
			||||||
 | 
					        sprintf(ts,"%d",r->Ky[i].ToCh[j] - r->Ky[i].FromCh[j] + 1);
 | 
				
			||||||
 | 
					        strcat(tag_info[i].expression,ts);
 | 
				
			||||||
 | 
					        strcat(tag_info[i].expression,")");
 | 
				
			||||||
 | 
					      }           
 | 
				
			||||||
      /* If there's another field in key adds "+" operator: */
 | 
					      /* If there's another field in key adds "+" operator: */
 | 
				
			||||||
      if ((j < (r->Ky[i].NkFields-1)) && (strlen(r->Fd[nf].Name) > 0))           
 | 
					      if ((j < (r->Ky[i].NkFields-1)) && (strlen(r->Fd[nf].Name) > 0))           
 | 
				
			||||||
        strcat(tag_info[i].expression,"+");
 | 
					        strcat(tag_info[i].expression,"+");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user