cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Streamline your workflows and master BIM coordination! Program starts April 28!

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

converting text to integers?

TomWaltz
Participant
I've been rooting around in the GDL manual & cookbook, without any luck so far....

Is there a way to convert a text string of numbers (such as "4" fed from a "Values" list) to be an integer, so I can use it for calculation?

I keep thinking there has to be one, and I'm just not looking in the right place.

Thanks!
Tom Waltz
4 REPLIES 4
TomWaltz wrote:
I've been rooting around in the GDL manual & cookbook, without any luck so far....
Is there a way to convert a text string of numbers (such as "4" fed from a "Values" list) to be an integer, so I can use it for calculation?
The answer is SPLIT(), look in the Index of the Cookbook for that, if its Cookbook 3 that you have. Should be in the manual too.
SPLIT will take that first digit and make it into an integer number.
sometimes it would be nice if the index could be more like a thesaurus with expressions like 'string parsing' included. the new CB4 will have a clearer structure.
Not applicable
You can use integers in a values list by just leaving the numbers out of quotes. (Ex. - values "c" 2,3,4). This keeps the value as a number, not as text. Just be sure your parameters are for integers or real numbers when setting it up.
TomWaltz
Participant
it was the quotes. Doh!!

My problem now is that my numbers are reading 4.00 and 12.00.... how do I kill the decimal points?

Thanks!
Tom Waltz
David Larrew
Booster
TomWaltz wrote:
it was the quotes. Doh!!

My problem now is that my numbers are reading 4.00 and 12.00.... how do I kill the decimal points?
Be sure that the Parameter type is "Integer" and not "Real Number".
David Larrew, AIA, GDLA, GSRC

Architectural Technology Specialist

a r c h i S O L U T I O N S



WIN7-10/ OSX 10.15.7

AC 5.1-25 USA