Explore chapters and articles related to this topic
Programming, Automation and Scripting
Published in Ionuţ Gabriel Ghionea, Cristian Ioan Tarbă, Saša Ćuković, CATIA v5, 2023
Ionuţ Gabriel Ghionea, Cristian Ioan Tarbă, Saša Ćuković
A VBA program in CATIA v5 or a Macro is a subroutine called CATMain (). In this function, the variables (using the statement) are declared as type and a value (using the Set statement) is associated with them. The data types used can be single, double, integer, string, etc., or even object. The fact that the object can be a data type makes CATIA v5 object-oriented programming (OOP). Understanding the principles of the OOP is critical to the success of macro programming. Thus, in the OOP, programmers define not only the type of data, but also the types of operations or functions that can be applied to the data structure. Everything in CATIA v5 is an object; data fields are properties; and functions and subroutines are called methods. In CATIA v5, the user can distinguish: Object – an entity (in CATIA v5 or VB): points, pads, ribs and parameters;Property – a characteristic of an object: name, mass and color;Method – an action performed by an object: PartDocument.SaveAs ();Collection – a group or list of objects, grouped for a specific purpose.
Introduction
Published in Randall L. Eubank, Ana Kupresanin, Statistical Computing in C++ and R, 2011
Randall L. Eubank, Ana Kupresanin
The syntax char* pf in the program says that pf is a pointer to char. This means it is a variable whose value is the address in memory that is occupied by a char variable. The address that has been assigned to pf is essentially that of the floating-point variable f which is obtained through the syntax &f. The problem is that &f is the address of a float while pf is expecting to receive the address of a char for its value. To make the transition from a float to a char address, a cast is used. In general, casting is the process of changing a variable from one data type into another in terms of how it is viewed by the compiler. C++ performs implicit casting in standard cases such as transforming an integer into a floating-point value and similar types of conversions. More generally, an explicit cast of a variable x to a new data type newType is accomplished with syntax of the form
Principles of Software Design and Development
Published in Sharon Yull, BTEC National for IT Practitioners: Core Units, 2009
Data types define the format or context of the data. For example, a data type could be classed as: Text – can include any alphanumeric characters, for example abc123. Text benefits from the flexibility of combining both characters and numbers together, a good example being in an address field.Integer – a whole number such as 1, 2, 3 or 4. Benefits of using an integer are that less storage space is required, a counter can be used, mathematical operations can be performed and comparisons can be made.Floating point –a ‘real number’, in that it has a decimal point. The benefits of using a floating point are that percentages, areas, measurements and computations can be stored. An example of this is calculating the area of a circle: the value of pi, 3.14 … .Byte – used for storing binary data in a computer system.Date – will represent data in a specific date format that is beneficial to users as it will prompt them to enter the date in a set format, for example --/--/----, 22/02/1972.Boolean – a logic value that will return a ‘true’ or ‘false’ value. Boolean data types are very small, requiring one bit, 0 or 1, representing true or false.
Semantic typing of linked geoprocessing workflows
Published in International Journal of Digital Earth, 2018
Simon Scheider, Andrea Ballatore
Data types generally increase the transparency and clarity of a program, helping developers express expected inputs and outputs of computational resources, for example specifying whether a function input is a string, an integer, a raster dataset, or another function. The success of types in object-oriented programming lies in information hiding, which is a way of abstracting from implementation details (Guttag and Horning 1978). More specifically, type constraints allow for modularity, that is, they guide the choice of a function, and open slots can be filled with particular data of a corresponding type to obtain a desired result. A second advantage is constructivity, the ability to construct a variety of types by combining primitive ones. And a third advantage is type inference, that is, the possibility to use inference rules to automatically guess the types of output and input when applying an operation. In practice, this greatly reduces a programmer's efforts of documenting code.