Eseguire
una ricerca veloce nell' archivio delle risorse di Visual Basic
Italia®:
|
Preso
dall'archivio...
Premere il pulsante sotto per accedere direttamente ad un articolo
o ad un esempio preso in modo casuale dall'archivio.
|
Ultimo
e-book pubblicato:
"INTRODUZIONE
AI CSS"
Lo scopo del CSS language è quello di controllare lo
stile dei vari elementi che concorrono a formare un
documento HTML.
Si può operare in tre modi collegamento ad un foglio di stile
esterno;definizione degli stili all'inizio
del documento utilizzo della proprietà style all'interno
di un Tag HTML (embedded style). Questo e-book introduttivo
servirà per apprendere tali nozioni fondametali dei fogli
di stile.
Prezzo: € 0.0.
|
Contatti.
Utilizzare l'email generica per domande relative al sito:
oppure scrivere
ad un responsabile di area.
Responsabile
del sito: >Andrea
Martelli
Responsabile area "Corso di VB":
> Giorgio Abraini
|
|
|
|
Basic/visual basic e porte lpt |
Lama su |
18/08/2005 |
Difficoltà:
Principiante
|
|
Salve
atutti!
Io
ho
un
piccolo
problema:
ho
bisogno
di
comandare
la
porta
lpt
(parallela)
del
mio
computer
ma
non
ho
la
minima
idea
di
come
fare.
Il
fatto
è
che
ho
trovato
un
listato
in
basic
che
fa
ciò
che
voglio,
ma
se
non
so
come
settare
la
porta
non
so
neppure
come
"tradurlo"
in
visual
basic.
Qualcuno
può
aiutarmmi?
vi
allego
il
listato
New
10
REM
Test
Program
Four
-
RG
9305.11
11
REM
Walking
Program
For
BORIS
Connected
to
PC
Parallel
Port
12
REM
Control
from
numeric
keypad:
UP
arrow
=
Forward,
etc.
13
REM
14
REM
Send
bits
to
the
parallel
port
With
LPRINT
CHR$(Bits);
15
REM
16
REM
Bits
=
1*n
+
2*n
+
4*n
+
8*n
+
16*n
+
32*n
+
64*n
+
128*n
17
REM
18
REM
Bits
equation
sets
bits
On
If
n
=
1
Or
OFF
If
n
=
0
19
REM
First
position
(1*n)
Is
bit
0
20
REM
Last
position
(128*n)
Is
bit
7
21
REM
Calculate
With
each
n
to
1
Or
0
For
other
Output
patterns
22
REM
23
REM
Note:
Ending
semicolon
(;)
On
LPRINT
command
holds
24
REM
bit
pattern
at
parallel
port
Until
Next
LPRINT
25
REM
30
DELAY
=
350:
REM
Increase
For
slower
walk,
decrease
For
faster
40
Print
"Press
keypad
arrow
keys
For
Fwd,
Back,
Left,
Right"
50
Print
"Press
space
bar
For
Stop"
60
Print
"Press
Q
at
any
time
to
Quit"
100
REM
Stop
walking
110
LPRINT
CHR$(0);
:
GOSUB
1000:
REM
Clear
All
Bits
120
Goto
100
200
REM
Walk
Forward
210
LPRINT
CHR$(65);
:
GOSUB
1000:
REM
Bit
6,
0
On
220
LPRINT
CHR$(4);
:
GOSUB
1000:
REM
Bit
2
On
230
LPRINT
CHR$(130);
:
GOSUB
1000:
REM
Bit
7,
1
On
240
LPRINT
CHR$(32);
:
GOSUB
1000:
REM
Bit
5
On
250
Goto
200
300
REM
Walk
Reverse
310
LPRINT
CHR$(65);
:
GOSUB
1000:
REM
Bit
6,
0
On
320
LPRINT
CHR$(32);
:
GOSUB
1000:
REM
Bit
5
On
330
LPRINT
CHR$(130);
:
GOSUB
1000:
REM
Bit
7,
1
On
340
LPRINT
CHR$(4);
:
GOSUB
1000:
REM
Bit
2
On
350
Goto
300
400
REM
Rotate
Left
410
LPRINT
CHR$(66);
:
GOSUB
1000:
REM
Bit
6,
1
On
420
LPRINT
CHR$(32);
:
GOSUB
1000:
REM
Bit
5
On
430
LPRINT
CHR$(129);
:
GOSUB
1000:
REM
Bit
7,
0
On
440
LPRINT
CHR$(4);
:
GOSUB
1000:
REM
Bit
2
On
450
Goto
400
500
REM
Rotate
Right
510
LPRINT
CHR$(66);
:
GOSUB
1000:
REM
Bit
6,
1
On
520
LPRINT
CHR$(4);
:
GOSUB
1000:
REM
Bit
2
On
530
LPRINT
CHR$(129);
:
GOSUB
1000:
REM
Bit
7,
0
On
540
LPRINT
CHR$(32);
:
GOSUB
1000:
REM
Bit
5
On
550
Goto
500
1000
REM
Check
Key
Press
And
Do
Delay
Loop
1010
A$
=
INKEY$
1020
If
A$
=
"
"
Then
Print
"Stop":
LPRINT
CHR$(0);
:
Goto
100
1030
If
A$
=
CHR$(0)
+
"H"
Then
Print
"Forward":
LPRINT
CHR$(0);
:
Goto
200
1050
If
A$
=
CHR$(0)
+
"P"
Then
Print
"Reverse":
LPRINT
CHR$(0);
:
Goto
300
1060
If
A$
=
CHR$(0)
+
"K"
Then
Print
"Left"
:
LPRINT
CHR$(0);
:
Goto
400
1070
If
A$
=
CHR$(0)
+
"M"
Then
Print
"Right"
:
LPRINT
CHR$(0);
:
Goto
500
1080
If
A$
=
"Q"
Or
A$
=
"q"
Then
LPRINT
CHR$(0);
:
End
1100
For
I
=
1
TO
DELAY
1110
Next
I
1120
RETURN
1900
End
RUN
|
|