question

William Proctor avatar image
2 Likes"
William Proctor asked Matthew Gillespie commented

Is there a way to identify the data type of a row in a table (text vs. number)

I'm using a loop to populate an output table. The table has mixed data types so I want to know what type of data is in each row before I import it. Is there an easy way to do this?

FlexSim 16.1.0
tablesdata typefunction
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

William Proctor avatar image William Proctor commented ·

Would the following code work if I wanted to look at the type of data in a specific table cell?

if(getvartype(gettablecell("Harvest_Data",1,1))==3)

0 Likes 0 ·

1 Answer

·
Matthew Gillespie avatar image
2 Likes"
Matthew Gillespie answered Matthew Gillespie commented

You'll want to use the getdatatype() command.

To test if the cell is number data:

if(getdatatype(gettablecell("GlobalTable1", 1, 1)) == DATATYPE_NUMBER)

To test if the cell is string data:

if(getdatatype(gettablecell("GlobalTable1", 1, 1)) == DATATYPE_STRING)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

William Proctor avatar image William Proctor commented ·

Awesome - Thanks!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.