Discussione:
Gwbasic
(troppo vecchio per rispondere)
BIG (Umberto)
2010-10-15 19:08:50 UTC
Permalink
Sono passati tanti e tanti anni, ma mi trovo in questo periodo, di fare alcuni
programmini.
Debbo estrapolare da un file in testo puro, di un sorgente software per plc, ma
anche in linguaggio iso per cnc, una tabella dei parametri usati di un certo
tipo.
I programmi che ho fatto, funzionano, a patto di avere definito nel file basic
stesso, i nomidei file su cui operare ed il tipo di parametri su cui fare la
tabella di quelli usati.
Volendo generalizzare la cosa, vorrei leggere da riga di comando le variabili
(semplice testo-stringa) da usare.

Un qualcosa tipo:

gwbasic.exe pippo.bas parametro1 parametro2

Con il qbasic, ero riuscito a farlo, ma con il gwbasic, non saprei come fare.

Qualcuno si ricorda come si fa?
--
+---------------------------------------------------------------------------+
| Aho e che palle, so' tre giorni che ci sminchiazzi le cosiddette! |
| Ma la sera ci dai di get/put o ti limiti all'handshaking e ti vieni a |
| sfogare co' noi? |
+-----#32--------------------Campagna contro le pubblicita` idiote.---------+
Reventlov
2010-10-15 21:11:18 UTC
Permalink
Post by BIG (Umberto)
Sono passati tanti e tanti anni, ma mi trovo in questo periodo, di fare alcuni
programmini.
Debbo estrapolare da un file in testo puro, di un sorgente software per plc, ma
anche in linguaggio iso per cnc, una tabella dei parametri usati di un certo
tipo.
I programmi che ho fatto, funzionano, a patto di avere definito nel file basic
stesso, i nomidei file su cui operare ed il tipo di parametri su cui fare la
tabella di quelli usati.
Volendo generalizzare la cosa, vorrei leggere da riga di comando le variabili
(semplice testo-stringa) da usare.
gwbasic.exe pippo.bas parametro1 parametro2
gwbasic MYPROG <DATA.IN
Data read by the INPUT and LINE INPUT statements comes from data.in.

Bisognerebbe provare.
Ogni line input legge una riga dal file data.in anzichè chiedere dati all'utente.
--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--
Ammammata
2010-10-16 17:13:33 UTC
Permalink
Post by BIG (Umberto)
gwbasic.exe pippo.bas parametro1 parametro2
mah... non so: ci sono diversi parametri possibili ma l'altro post forse ha
dato la risposta giusta


Source: GW-BASIC User's Guide
Address : <http://www.antonis.de/qbebooks/gwbasman/chapter%202.html>

2.3 The GW-BASIC Command Line Format

The GW-BASIC command line lets you change the environment or the conditions
that apply while using GW-BASIC.

Note

When you specify modifications to the operating environment of GW-BASIC, be
sure to maintain the parameter sequence shown in the syntax statement. To
skip a parameter, insert a comma. This will let the computer know that you
have no changes to that particular parameter.

GW-BASIC uses a command line of the following form:

gwbasic[filename][<stdin][[>]>stdout][/f:n][/i][/s:n][/c:n][/m:[n][,n]][/d]

filename is the name of a GW-BASIC program file. If this parameter is
present, GW-BASIC proceeds as if a RUN command had been given. If no
extension is provided for the filename, a default file extension of .BAS is
assumed. The .BAS extension indicates that the file is a GW-BASIC file. The
maximum number of characters a filename may contain is eight with a decimal
and three extension characters.

<stdin redirects GW-BASIC's standard input to be read from the specified
file. When used, it must appear before any switches.

This might be used when you have multiple files that might be used by your
program and you wish to specify a particular input file.
Post by BIG (Umberto)
stdout redirects GW-BASIC's standard output to the specified file or device.
When used, it must appear before any switches. Using >> before stdout causes
output to be appended.

GW-BASIC can be redirected to read from standard input (keyboard) and write
to standard output (screen) by providing the input and output filenames on
the command line as follows:

gwbasic program name <input file[>]>output file

An explanation of file redirection follows this discussion of the GW-BASIC
command line.

Switches appear frequently in command lines; they designate a specified
course of action for the command, as opposed to using the default for that
setting. A switch parameter is preceded by a slash (/).

/f:n sets the maximum number of files that may be opened simultaneously
during the execution of a GW-BASIC program. Each file requires 194 bytes for
the File Control Block (FCB) plus 128 bytes for the data buffer. The data
buffer size may be altered with the /s: switch. If the /f: switch is omitted,
the maximum number of open files defaults to 3. This switch is ignored unless
the /i switch is also specified on the command line.

/i makes GW-BASIC statically allocate space required for file operations,
based on the /s and /f switches.

/s:n sets the maximum record length allowed for use with files. The record
length option in the OPEN statement cannot exceed this value. If the /s:
switch is omitted, the record length defaults to 128 bytes. The maximum
record size is 32767.

/c:n controls RS-232 communications. If RS-232 cards are present, /c:0
disables RS-232 support, and any subsequent I/O attempts for each RS-232 card
present. If the /c: switch is omitted, 256 bytes are allocated for the
receive buffer and 128 bytes for the transmit buffer for each card present.

The /c: switch has no affect when RS-232 cards are not present. The /c:n
switch allocates n bytes for the receive buffer and 128 bytes for the
transmit buffer for each RS-232 card present.

/m:n[,n] sets the highest memory location (first n) and maximum block size
(second n) used by GW-BASIC. GW-BASIC attempts to allocate 64K bytes of
memory for the data and stack segments. If machine language subroutines are
to be used with GW-BASIC programs, use the /m: switch to set the highest
location that GW-BASIC can use. The maximum block size is in multiples of 16.
It is used to reserve space for user programs (assembly language subroutines)
beyond GW-BASIC's workspace.

The default for maximum block size is the highest memory location. The
default for the highest memory location is 64K bytes unless maximum block
size is specified, in which case the default is the maximum block size (in
multiples of 16).

/d allows certain functions to return double-precision results. When the /d
switch is specified, approximately 3000 bytes of additional code space are
used. The functions affected are ATN, COS, EXP, LOG, SIN, SQR, and TAN.

Note

All switch numbers may be specified as decimal, octal (preceded by &O), or
hexadecimal (preceded by &H).

Sample GW-BASIC command lines are as follows:

The following uses 64K bytes of memory and three files; loads and executes
the program file payroll.bas:

A>gwbasic PAYROLL

The following uses 64K bytes of memory and six files; loads and executes the
program file invent.bas:

A>gwbasic INVENT /F:6

The following disables RS-232 support and uses only the first 32K bytes of
memory. 32K bytes above that are reserved for user programs:

A>gwbasic /C:0 /M:32768,4096

The following uses four files and allows a maximum record length of 512
bytes:

A>gwbasic /F:4 /S:512

The following uses 64K bytes of memory and three files. Allocates 512 bytes
to RS-232 receive buffers and 128 bytes to transmit buffers, and loads and
executes the program file tty.bas:

A>gwbasic TTY /C:512

For more information about RS-232 Communications, see Appendix F.
--
/-\ /\/\ /\/\ /-\ /\/\ /\/\ /-\ T /-\
Post by BIG (Umberto)
http://www.bb2002.it :) <<<<<
Loading...