Playback starts YouTube’s embedded player (privacy-enhanced mode).
Free Pascal App Tutorial 6 - Simple Calculator Part 2 - String Conversion - Lazarus
ChannelSchoolFreewareDescription from the creator
schoolfreeware.com
Performing Calculations and Math Using EditBoxes
User input with editboxes are entered as a string datatype. The computer can not perform calculate using strings. The computer needs numbers in an integer or floating point datatype to make mathematical calculations. The solution is to convert the string into an integer or floating point number, perform the calculation, then convert the calculation back to a string so the answer can be displayed in the editbox or label.
IntToStr() - Converts an Integer to a String
StrToInt() - Converts a String to an Integer
FloatToStr() - Converts a Floating Point to a String
StrToFloat() - Converts a String to a Floating Point
Example:
Label1.Text := FloatToStr(StrToFloat(Edit1.Text) + StrToFloat(Edit2.Text));
Performing Calculations and Math Using EditBoxes
User input with editboxes are entered as a string datatype. The computer can not perform calculate using strings. The computer needs numbers in an integer or floating point datatype to make mathematical calculations. The solution is to convert the string into an integer or floating point number, perform the calculation, then convert the calculation back to a string so the answer can be displayed in the editbox or label.
IntToStr() - Converts an Integer to a String
StrToInt() - Converts a String to an Integer
FloatToStr() - Converts a Floating Point to a String
StrToFloat() - Converts a String to a Floating Point
Example:
Label1.Text := FloatToStr(StrToFloat(Edit1.Text) + StrToFloat(Edit2.Text));
About this tutorial
SchoolFreeware published this 4:31 video tutorial on November 8, 2012. It has been watched 32,412 times on YouTube.
- Channel
- SchoolFreeware
- Category
- Science & Technology
- Duration
- 4:31
- Published
- November 8, 2012
- Views
- 32,412
- Likes
- 139
Tags
Share
This tutorial in other languages
- FRFree Pascal App Tutoriel 6 - Simple Calculator Partie 2 - Conversion chaîne - Lazare
- ESFree Pascal Aplicación Tutorial 6 - Simple calculadora Parte 2 - cadena de conversión - Lázaro
- PTFree Pascal App Tutorial 6 - simples calculadora Parte 2 - corda Conversão - Lázaro
- ITFree Pascal App Tutorial 6 - semplice calcolatrice Parte 2 - String conversione - Lazarus
- DEFree Pascal App Tutorial 6 - Einfach Calculator Teil 2 - String Conversion - Lazarus
- NLFree Pascal App Tutorial 6 - Simple Calculator Deel 2 - String Conversion - Lazarus
- RUFree Pascal App Учебник 6 - Простой калькулятор Часть 2 - Строка преобразования - Lazarus
- PLFree Pascal App Tutorial 6 - Prosty kalkulator Część 2 - String konwersji - Lazarus
- JAFree Pascalのアプリケーションのチュートリアル6 - シンプルな電卓パート2 - 文字列の変換 - ラザロ
- ARباسكال الحرة التطبيق دروس 6 - بسيطة حاسبة الجزء 2 - سلسلة التحويل - لازاروس
- HIमुफ्त पास्कल अनुप्रयोग ट्यूटोरियल 6 - सरल कैलक्यूलेटर भाग 2 - स्ट्रिंग रूपांतरण - लाजर
- IDFree Pascal App Tutorial 6 - Simple Calculator Part 2 - String Konversi - Lazarus