The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 How to get cell data type and distinguish same %1?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
hkkim 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
}
...
----------------------------------------------------------------------
2   L A T E S T    R E P L I E S    (Newest First)
hkkim Posted - 10/05/2012 : 04:50:59 AM
Hello, DrBob,
Thank you for your help! My script works well now!
Drbobshepherd 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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000