1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-20 19:45:15 +00:00
qb64/internal/help/_DEFINE.txt
Luke Ceddia b586eafd3b Integrated _BLINEINPUT into regular LINE INPUT for BINARY files
LINE INPUT will now use the faster method if passed a file handle
that has been opened FOR BINARY. As such, the _BLINEINPUT command
has been removed.

qb64.bas now takes advantage of this for reading from '$include files,
at least in Include Manager 1. Some tweaking of internal/source/main.txt
was required to get things into a sane state, so I'm holing off changing
the compiler any further so the auto-builder can make sure everything's
smoothed over.

Note: Everything should still compile as normal; I'm just being overcautious.
2014-07-27 00:06:17 +10:00

42 lines
2.1 KiB
Plaintext

'''_DEFINE''' defines a range of variable names according to their first character as a datatype.
{{PageSyntax}}
:{{KW|_DEFINE}} {{Parameter|range or letter}}[, {{Parameter|range2 or letter2}}[, {{Parameter|range3 or letter3}}[, ...]]] {{KW|AS}} [{{KW|_UNSIGNED}}] {{Parameter|datatype}}
{{PageDescription}}
* Variable start letter range is in the form firstletter-endingletter (like A-C) or just a single letter.
* Datatypes: [[INTEGER]], [[SINGLE]], [[DOUBLE]], [[LONG]], [[STRING]], [[_BIT]], [[_BYTE]], [[_INTEGER64]], [[_FLOAT]], [[_OFFSET]], [[_MEM]]
* Can also use the [[_UNSIGNED]] definition for positive numerical values only.
* '''When a variable has not been defined or has no type suffix, the value defaults to [[SINGLE]].'''
* '''NOTE: Many Qbasic keyword variable names CAN be used with a [[STRING]] suffix($) ONLY! You CANNOT use them without the suffix, use a numerical suffix or use [[DIM]], [[REDIM]], [[_DEFINE]], [[BYVAL]] or [[TYPE]] variable [[AS]] statements!'''
* '''Qbasic's IDE''' may add DEF statements before any [[SUB]] or [[FUNCTION]]. QB64(like QB) will change all variable types in subsequent sub-procedures to that default variable type without giving a [[ERROR Codes|"Parameter Type Mismatch"]] warning or adding the proper DEF statement to subsequent procedures! If you do not want that to occur, either remove that DEF statement or add the proper DEF type statements to subsequent procedures. May also affect [[$INCLUDE]] procedures!
''Example:'' Defining variables that start with the letters A, B, C or F as unsigned integers, including the ''Add2'' [[FUNCTION]].
{{CodeStart}} '' ''
{{Cl|_DEFINE}} A-C, F {{Cl|AS}} {{Cl|_UNSIGNED}} {{Cl|INTEGER}}
{{Cl|PRINT}} Add2(-1.1, -2.2)
{{Cl|END}}
{{Cl|FUNCTION}} Add2 (one, two)
Add2 = one + two
{{Cl|END FUNCTION}} '' ''
{{CodeEnd}}
{{OutputStart}}65533
{{OutputEnd}}
: ''Explanation:'' Unsigned integers can only return positive values while ordinary [[INTEGER|integers]] can also return negative values.
{{PageSeeAlso}}
* [[DEFSTR]], [[DEFLNG]], [[DEFINT]], [[DEFSNG]], [[DEFDBL]]
* [[DIM]], [[REDIM]]
* [[COMMON]], [[SHARED]]
* [[_UNSIGNED]]
{{PageNavigation}}