1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-20 22:05:15 +00:00
qb64/internal/help/COMMAND$.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

47 lines
1.6 KiB
Plaintext

The '''COMMAND$''' function returns the DOS commandline arguments passed when a program is run.
''Syntax:'' variable$ = COMMAND$
* The [[STRING|string]] return value is any parameter following the filename in a [[RUN]] or command line statement.
* Qbasic returns [[UCASE$|uppercase]] [[STRING]] parameters no matter what case they were sent originally.
* '''QB64''' does not '''require or return all [[UCASE$|uppercase]]''' values so keep that fact in mind when checking parameters passed!
* Useful when the programmer wants to add options to the command line of a program for later use by another program.
* COMMAND$ was not available in QuickBasic versions below 4.0
''Example:'' Compile both programs. ProgramA [[RUN]]s ProgramB with a parameter passed following the filename:
{{CodeStart}}
{{Cl|LOCATE}} 12, 36: {{Cl|PRINT}} "ProgramA"
{{Cl|LOCATE}} 23, 25: {{Cl|PRINT}} "Press any key to run ProgramB"
K$ = {{Cl|INPUT$}}(1)
{{Cl|RUN}} "ProgramB FS" 'pass FS parameter to ProgramB in QB64
{{Cl|END}}
{{CodeEnd}}
: ''ProgramB'' checks for fullscreen parameter pass in QB64 and goes full screen.
{{CodeStart}} '' ''
{{Cl|LOCATE}} 12, 36: {{Cl|PRINT}} "ProgramB"
parameter$ = {{Cl|UCASE$}}({{Cl|COMMAND$}})
{{Cl|LOCATE}} 20, 33: {{Cl|PRINT}} "Parameter = " + parameter$
{{Cl|IF...THEN|IF}} {{Cl|LEFT$}}(parameter$, 2) = "FS" {{Cl|THEN}} {{Cl|_FULLSCREEN}} 'parameter changes to full screen
{{Cl|END}} '' ''
{{CodeEnd}}
{{OutputStart}} Parameter = FS.EXE
{{OutputEnd}}
''See also:''
* [[SHELL]], [[RUN]]
* [[UCASE$]], [[LCASE$]]
{{PageNavigation}}