| 
        
          | 
              
                | Author |  Topic  |           |  
                | hkkim
 
                Republic of Korea35 Posts
 | 
                    
                      |  Posted - 10/04/2012 :  03:59:49 AM           
 |  
                      | Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.1 SR3 Operating System: Windows XP
 
 
 1) I want to know the data type(string or numeric) of a worksheet cell when it has some data. Is there any function or method to get a cell data type? I wonder the '...' part in a script below.
 
 2) Is there any method to distinguish argument "%1" in DOS command and macro call in LabTalk?
 
 Thank you!
 hkkim
 
 ----------------------------------------------------------------------
 ...
 for(ii=1; ii<=100; ii++)
 {
 // This will terminate the loop early if true
 if (Cell(ii,1)$ > "end")  break;
 if (Cell(ii,1)$ == 'string') && (Cell(ii,2) == 'numeric')) macroA ii // macro call with a row number
 }
 ...
 ----------------------------------------------------------------------
 
 |  |  
                | Drbobshepherd
 
                USAPosts
 | 
                    
                      |  Posted - 10/04/2012 :  11:30:10 AM           
 |  
                      | hkkim, 
 You can write an if statement to test for type string. For example:
 
 if(cell(3,2)==(1/0)) type "String";else type "Numeric";
 
 Actually, this statement is testing for NAN, but by process of elimination, if the cell value is not a number, it must be a string.
 
 DrBob
 
 |  
                      |  |  |  
                | hkkim
 
                Republic of Korea35 Posts
 | 
                    
                      |  Posted - 10/05/2012 :  04:50:59 AM           
 |  
                      | Hello, DrBob, Thank you for your help! My script works well now!
 
 |  
                      |  |  |  
                |  |  Topic  |           |  |  |