ID : 315
DefSng
Function
To declare local variable for Single Precision Real Number Type.
Syntax
DefSng variable name [=initial value][,variable name 2[=initial value 2]…]
Guaranteed entry
- Variable name
- Designate a variable name. Each name must be specified in accordance with the Naming convention.
- Initial value
- Designate an initial value for the variable you created.
- Variable name 2, initial value 2
- You can declare multiple local variables of Single Precision Real Number Type at the same time. ", (comma)" can be used for a separation.
Description
-
Related Terms
-
Attention
This command is RC7M compatible, but an unrecommended command. This might be no longer supported, so use Dim for future use.
When you don't put any value in initial value, "0" will be assigned.
Example
'!TITLE "Declaration of Single Precision Real Number Type Data"
' Assign a value to declared variable and display it on the message output window
Sub Sample_DefSng
' Declare a variable named aaa in single precision real number type data
DefSng aaa
' Declare a variable named bbb in single precision real number type data
DefSng bbb
aaa = 1234.567
bbb = 1234.5678
' Display "1234.567" on the message output window
PrintDbg aaa
' Display "1234.568" on the message output window
PrintDbg bbb
End Sub
ID : 315