Format Text to Decimal

buble
Member Posts: 16
Hi,
how can I format a text field to decimal field.
I used the function COPYSTRING to copy a part from a text field. Now I will use the part of the text field for calculation.
Thanks for your support.
buble
how can I format a text field to decimal field.
I used the function COPYSTRING to copy a part from a text field. Now I will use the part of the text field for calculation.
Thanks for your support.
buble
Ciao
buble
buble
0
Comments
-
EVALUATE
Use this function to evaluate a string representation of a value into its normal representation. The system assigns the result to a variable.
[Ok :=] EVALUATE(Variable, String)
Ok
Data type: boolean
A return code which reflects whether an error occurred during the evaluation of the string.
If Ok is...
It means...
TRUE
No errors occurred during the evaluation of the string. The system assigned the value to Variable.
FALSE
Errors occurred during the evaluation of the string. The system did not modify the original value of Variable.
If you omit this optional return value and an error occurs during the evaluation of the string, a run-time error occurs. If you include it, the system assumes you will handle any errors.
Variable
Data type: boolean, integer, option, date, time, text constant or code
Any type of variable. The value of the string is assigned to the variable.
String
Data type: text constant or code
A string containing a value of any simple C/AL data type.
Example
This example shows how the EVALUATE function works when called with three different types of variables.
Value := '010196';
Ok1 := EVALUATE(VarInteger, Value);
Ok2 := EVALUATE(VarDate, Value);
Ok3 := EVALUATE(VarYesNo, Value);
MESSAGE(Text000 + Text001 + Text002,
VarInteger, Ok1, VarDate, Ok2, VarYesNo, Ok3)
Create the following text constants in the C/AL Globals window:
Text Constant
ENU Value
Text000
'VarInteger = #1######, and the return code is: %2\'
Text001
'VarDate = #3######, and the return code is: %4\'
Text002
'VarYesNo = #5######, and the return code is: %6'
The message window shows:
VarInteger = 10196 , and the return code is: Yes
VarDate = 01/01/96, and the return code is: Yes
VarYesNo = No , and the return code is: No
This example shows that while the system can interpret Value ('010196') as both an integer and a date expression, it cannot interpret it as a boolean expression. This causes an error, shown in the return code Ok3 (=FALSE0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions