Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Array
Questo oggetto fornisce un modo per memorizzare pi di un valore per un dato nome. Si pu accedere a
questi valori tramite un indice.
Operations
ContainsIndex
Array.ContainsIndex(array, index)
index
L'indice da controllare.
Returns
"True" o "False" a seconda che l'indice sia presente nel vettore
specificato o meno.
ContainsValue
Array.ContainsValue(array, value)
Returns
Il numero di elementi nel vettore specificato.
IsArray
Array.IsArray(array)
Returns
"True" se la variabile specificata un vettore. Altrimenti "False" .
SetValue
Array.SetValue(arrayName, index, value)
index
Il nome dell'indice.
value
il valore da impostare.
array
Returns
Il vettore da verificare.
Nothing
value
Il valore da controllare.
Returns
"True" o "False" a seconda che il valore sia presente nel vettore
specificato.
GetAllIndices
GetValue
Array.GetValue(arrayName, index)
index
Array.GetAllIndices(array)
Il nome dell'indice.
Returns
array
RemoveValue
Array.RemoveValue(arrayName, index)
Returns
Un vettore caricato con tutti gli indici del vettore specificato. L'indice
del vettore restituito inizia da 1.
GetItemCount
arrayName
Il nome del vettore.
index
Array.GetItemCount(array)
Returns
array
Nothing
Clock
Questa classe fornisce accesso all'orologio di sistema
Properties
Time (This property is read-only.)
Clock.Time
Clock.Second
Controls
L'oggetto Controls consente di aggiungere, spostare e interagire con i controlli.
Properties
LastClickedButton (This property is read-only.)
Controls.LastClickedButton
left
Controls.LastTypedTextBox
Events
ButtonClicked
Controls.ButtonClicked
top
La coordinata Y della casella di testo.
Returns
AddMultiLineTextBox
Controls.AddMultiLineTextBox(left, top)
top
La coordinata Y della casella di testo.
Returns
Controls.TextTyped
Controls.GetTextBoxText(textBoxName)
GetTextBoxText
Restituisce il testo attuale del TextBox specificato.
Operations
AddButton
textBoxName
left
La coordinata x del pulsante.
top
La coordinata y del pulsante.
Returns
Il pulsante che stato appena aggiunto alla Finestra Grafica.
GetButtonCaption
Controls.GetButtonCaption(buttonName)
Returns
Il testo attuale del pulsante.
SetButtonCaption
Controls.SetButtonCaption(buttonName, caption)
caption
Il nuovo testo del pulsante.
Returns
Nothing
AddTextBox
Returns
SetTextBoxText
Controls.SetTextBoxText(textBoxName, text)
text
Il nuovo testo per il TextBox.
Returns
Nothing
Remove
Controls.Remove(controlName)
Returns
Nothing
Move
Controls.Move(control, x, y)
x
La coordinata x della nuova posizione.
y
La coordinata y della nuova posizione.
Returns
Nothing
Controls.AddTextBox(left, top)
SetSize
controlName
control
Il nome del controllo da ridimensionare.
width
Returns
Nothing
ShowControl
Controls.ShowControl(controlName)
height
controlName
Returns
Nothing
HideControl
Returns
Nothing
Controls.HideControl(controlName)
Desktop
Questa classe fornisce metodi per interagire con il desktop.
Properties
Width (This property is read-only.)
Operations
SetWallPaper
Desktop.Width
Desktop.SetWallPaper(fileOrUrl)
Desktop.Height
fileOrUrl
Returns
Nothing
Dictionary
Questa classe fornisce accesso ad un servizio di Dizionario online.
Operations
GetDefinition
Dictionary.GetDefinition(word)
Returns
GetDefinitionInFrench
Dictionary.GetDefinitionInFrench(word)
Returns
La/le definizione/i della parola specificata.
File
L'oggetto File fornisce metodi per accedere, leggere e scrivere informazioni da/ad un file su disco.
Utilizzando questo oggetto, possibile salvare e leggere impostazioni tra diverse sessioni del vostro
programma.
Properties
LastError
File.LastError
Operations
ReadContents
File.ReadContents(filePath)
Returns
L'intero contenuto del file.
WriteContents
File.WriteContents(filePath, contents)
contents
il contenuto da scrivere nel file specificato.
Returns
Restituir "SUCCESS" se l'operazione stata eseguita
correttamente. Altrimenti restituir "FAILED".
ReadLine
File.ReadLine(filePath, lineNumber)
destinationFilePath
La locazione di destinazione o il persorso del file.
Returns
Restituir "SUCCESS" se l'operazione stata eseguita
correttamente. Altrimenti restituir "FAILED".
DeleteFile
File.DeleteFile(filePath)
filePath
filePath
lineNumber
Returns
Returns
il testo alla riga specificata del file indicato.
WriteLine
CreateDirectory
File.CreateDirectory(directoryPath)
filePath
Il percorso completo del file da leggere. Ad esempio
c:\temp\settings.data.
lineNumber
directoryPath
il persorso completo della cartella da creare.
Returns
Restituir "SUCCESS" se l'operazione stata eseguita
correttamente. Altrimenti restituir "FAILED".
DeleteDirectory
File.DeleteDirectory(directoryPath)
contents
Returns
Restituir "SUCCESS" se l'operazione stata eseguita
correttamente. Altrimenti restituir "FAILED".
InsertLine
File.InsertLine(filePath, lineNumber, contents)
directoryPath
Il percorso completo della cartella da eliminare.
Returns
Restituir "SUCCESS" se l'operazione stata eseguita
correttamente. Altrimenti restituir "FAILED".
GetFiles
File.GetFiles(directoryPath)
filePath
directoryPath
lineNumber
contents
il contenuto da inserire nel file.
Returns
Restituir "SUCCESS" se l'operazione stata eseguita
correttamente. Altrimenti restituir "FAILED".
AppendContents
File.AppendContents(filePath, contents)
contents
Il contenuto da appendere alla fine del file.
Returns
Restituir "SUCCESS" se l'operazione stata eseguita
correttamente. Altrimenti restituir "FAILED".
CopyFile
File.CopyFile(sourceFilePath, destinationFilePath)
GetDirectories
File.GetDirectories(directoryPath)
Returns
Restituir "SUCCESS" se l'operazione stata eseguita
correttamente. Altrimenti restituir "FAILED".
GetTemporaryFilePath
File.GetTemporaryFilePath()
GetSettingsFilePath
File.GetSettingsFilePath()
Returns
Flickr
Questa classe fornisce accesso ai servizi di Flickr.
Operations
GetPictureOfMoment
GetRandomPicture
Flickr.GetRandomPicture(tag)
Returns
tag
Flickr.GetPictureOfMoment()
Returns
L'URL del file dell'immagine casuale di Flickr
GraphicsWindow
La finestra Grafica fornisce funzionalit di input e output grafiche. Per esempio, usando questa
classe, possibile disegnare e riempire cerchi e rettangoli.
Properties
BackgroundColor
GraphicsWindow.BackgroundColor
GraphicsWindow.BrushColor
GraphicsWindow.Height
GraphicsWindow.CanResize
GraphicsWindow.Width
GraphicsWindow.FontItalic
GraphicsWindow.KeyDown
GraphicsWindow.FontBold
La coordinata X dell'ellisse.
GraphicsWindow.KeyUp
La larghezza dell'ellisse.
y
La coordinata Y dell'ellisse.
width
height
L'altezza dell'ellisse.
Returns
Nothing
FillEllipse
GraphicsWindow.FillEllipse(x, y, width, height)
y
La coordinata Y dell'ellisse.
width
GraphicsWindow.MouseMove
La larghezza dell'ellisse.
height
GraphicsWindow.TextInput
Nothing
L'altezza dell'ellisse.
Returns
DrawTriangle
GraphicsWindow.DrawTriangle(x1, y1, x2, y2, x3, y3)
GraphicsWindow.Show()
y1
Returns
Nothing
Hide
GraphicsWindow.Hide()
x2
La coordinata x del secondo punto.
y2
La coordinata y del secondo punto.
x3
La coordinata x del terzo punto.
Returns
y3
Nothing
DrawRectangle
Returns
Nothing
FillTriangle
x1
width
y1
height
x2
Returns
y2
Nothing
FillRectangle
x3
y3
x
La coordinata x del rettangolo.
Returns
Nothing
DrawLine
width
height
x1
Returns
y1
Nothing
DrawEllipse
x2
y2
Returns
Nothing
DrawText
GraphicsWindow.DrawText(x, y, text)
y
La coordinata Y del punto di inizio del testo.
text
Il testo da disegnare
Returns
SetPixel
GraphicsWindow.SetPixel(x, y, color)
y
La coordinata y del pixel.
color
Il colore del pixel.
Returns
Nothing
Nothing
DrawBoundText
GraphicsWindow.DrawBoundText(x, y, width, text)
y
La coordinata Y del punto di inizio del testo.
width
La larghezza massima disponibile. Questo parametro aiuta a
definire quando il testo deve andare accapo.
text
Il testo da disegnare.
GetPixel
GraphicsWindow.GetPixel(x, y)
y
la coordinata y del pixel.
Returns
Il colore del pixel.
GetRandomColor
GraphicsWindow.GetRandomColor()
Returns
Nothing
Returns
DrawResizedImage
GetColorFromRGB
x
La coordinata x del punto in cui disegnare l'immagine.
y
La coordinata y del punto in cui disegnare l'immagine.
width
La larghezza in cui disegnare l'immagine.
height
L'altezza in cui disegnare l'immagine.
green
Il componente verde del colore (0-255).
blue
Il componente blu del colore (0-255).
Returns
Restituisce un colore che pu essere utilizzato per per impostare il
colore di una penna o un pennello.
Clear
Returns
GraphicsWindow.Clear()
Nothing
Pulisce la finestra.
DrawImage
Returns
GraphicsWindow.DrawImage(imageName, x, y)
Nothing
GraphicsWindow.ShowMessage(text, title)
ShowMessage
imageName
text
title
Returns
Returns
Nothing
Nothing
ImageList
Questa classe aiuta a caricare e memorizzare immagini in memoria.
Operations
LoadImage
ImageList.LoadImage(fileNameOrUrl)
Returns
GetWidthOfImage
ImageList.GetWidthOfImage(imageName)
ImageList.GetHeightOfImage(imageName)
imageName
imageName
Returns
Returns
GetHeightOfImage
Math
La classe Math fornisce numerosi metodi matematici utili
Properties
Pi (This property is read-only.)
Math.Pi
Returns
Il coseno dell'angolo dato.
Sin
Math.Sin(angle)
Math.Abs(number)
Returns
Tan
number
Math.Tan(angle)
Returns
Il valore assoluto del numero dato.
Ceiling
angle
L'angolo di cui richiesta la tangente (in radianti).
Returns
Math.Ceiling(number)
Math.ArcSin(sinValue)
ArcSin
number
sinValue
Returns
Returns
Floor
Math.Floor(number)
ArcCos
Math.ArcCos(cosValue)
number
cosValue
Returns
Returns
NaturalLog
ArcTan
Math.NaturalLog(number)
Math.ArcTan(tanValue)
number
tanValue
Returns
Returns
Log
GetDegrees
Math.Log(number)
Math.GetDegrees(angle)
number
Il numero di cui si desidera il valore del logaritmo
Returns
Il valore del logaritmo del numero specificato
Cos
angle
L'angolo in radianti.
Returns
L'angolo convertito in gradi.
GetRadians
Math.GetRadians(angle)
Math.Cos(angle)
angle
angle
L'angolo di cui richiesto il coseno (in radianti).
L'angolo in gradi.
Returns
L'angolo convertito in radianti.
9
SquareRoot
Math.SquareRoot(number)
number2
Il secondo dei due numeri da confrontare.
Returns
Il maggiore dei due numeri.
Min
Returns
La radice quadrata del valore dato.
Math.Min(number1, number2)
Power
Math.Power(baseNumber, exponent)
number2
Il secondo dei due numeri da confrontare.
Returns
Il minore dei due numeri.
Remainder
exponent
Math.Remainder(dividend, divisor)
Returns
baseNumber elevato allo specifico esponente.
Round
dividend
Il numero da dividere.
Math.Round(number)
divisor
number
Il numero di cui si richiede l'approssimazione.
Returns
Il valore arrotondato del numero dato.
Max
Returns
Il resto della divisione.
GetRandomNumber
Math.GetRandomNumber(maxNumber)
Math.Max(number1, number2)
Returns
number1
Mouse
La classe mouse fornisce accessori per recuperare o impostare le propriet relative al mouse, quali la
posizione del cursore, il puntatore, ecc.
Properties
MouseX
Mouse.MouseX
Mouse.IsRightButtonDown
Returns
Mouse.IsLeftButtonDown
Nothing
ShowCursor
Mouse.ShowCursor()
Returns
Nothing
Network
Questa classe privata fornisce metodi per l'acceso alla rete
Operations
DownloadFile
Network.DownloadFile(url)
url
L'indirizzo del file sulla rete.
Returns
Il nome del file locale su cui il file remoto stato scaricato.
GetWebPageContents
10
Network.GetWebPageContents(url)
Returns
url
Program
La classe Program fornisce metodi per controllare l'esecuzione del programma.
Properties
ArgumentCount (This property is read-only.)
Returns
Nothing
End
Program.ArgumentCount
Program.End()
Termina il programma.
Returns
Nothing
GetArgument
Program.GetArgument(index)
Returns
L'argomento della linea di comando all'indice specificato.
La quantit di ritardo.
Shapes
L'oggetto Shapes consente di aggiungere, spostare e ruotare forme nella finestra Grafica.
Operations
AddRectangle
Shapes.AddRectangle(width, height)
height
L'altezza del rettangolo.
Returns
Il rettangolo che stato appena aggiunto alla finestra Grafica.
AddEllipse
Shapes.AddEllipse(width, height)
y3
La coordinata y del terzo punto.
Returns
Il triangolo che appena stato aggiunto alla finestra Grafica.
AddLine
Shapes.AddLine(x1, y1, x2, y2)
y1
La coordinata y del primo punto.
x2
La coordinata x del secondo punto.
y2
La coordinata y del secondo punto.
Returns
La linea che appena stata aggiunta alla finestra Grafica.
AddImage
height
Shapes.AddImage(imageName)
L'altezza dell'ellisse.
Returns
L'ellisse che appena stata aggiunta alla finestra Grafica.
AddTriangle
Shapes.AddTriangle(x1, y1, x2, y2, x3, y3)
imageName
Il nome dell'immagine da disegnare.
Returns
L'immagine che appena stata aggiunta alla finestra Grafica.
AddText
x1
Shapes.AddText(text)
y1
La coordinata y del primo punto.
x2
La coordinata x del secondo punto.
y2
La coordinata y del secondo punto.
x3
La coordinata x del terzo punto.
text
Il testo da aggiungere.
Returns
La forma del testo che stata appena aggiunta alla Finestra
Grafica.
SetText
11
Shapes.SetText(shapeName, text)
shapeName
text
duration
Returns
Returns
Nothing
Nothing
Remove
GetLeft
Shapes.Remove(shapeName)
Shapes.GetLeft(shapeName)
shapeName
shapeName
Returns
Returns
Nothing
Move
GetTop
Shapes.Move(shapeName, x, y)
Shapes.GetTop(shapeName)
shapeName
Il nome della forma da spostare.
x
La coordinata x della nuova posizione.
shapeName
Il nome della forma.
Returns
La coordinata pi alta della forma.
GetOpacity
Shapes.GetOpacity(shapeName)
Returns
shapeName
Nothing
Rotate
Shapes.Rotate(shapeName, angle)
Returns
L'opacit dell'oggetto come valore tra 0 e 100. 0 equivale a
completamente trasparente, mentre 100 corrisponde a
completamente opaco.
SetOpacity
Shapes.SetOpacity(shapeName, level)
angle
shapeName
Returns
Nothing
level
Zoom
Shapes.Zoom(shapeName, scaleX, scaleY)
scaleX
Il livello di zoom dell'asse X.
scaleY
Il livello di zoom dell'asse Y.
Returns
Nothing
Animate
Shapes.Animate(shapeName, x, y, duration)
Returns
Nothing
HideShape
Shapes.HideShape(shapeName)
Returns
Nothing
ShowShape
Shapes.ShowShape(shapeName)
Returns
Nothing
Sound
L'oggetto Sound fornisce operazioni che consentono la riproduzione di suoni. Alcuni suoni di esempio
sono forniti con la libreria.
Operations
PlayClick
Sound.PlayClick()
Returns
Nothing
PlayClickAndWait
Sound.PlayClickAndWait()
12
Nothing
Returns
Sound.Play(filePath)
Nothing
PlayChime
Sound.PlayChime()
PlayChimeAndWait
Sound.PlayChimeAndWait()
PlayChimes
Sound.PlayChimes()
PlayChimesAndWait
Play
Riproduce il suono Clic.
filePath
Returns
Nothing
PlayAndWait
Sound.PlayAndWait(filePath)
Returns
Sound.PlayChimesAndWait()
Nothing
Sound.Pause(filePath)
Returns
Nothing
PlayBellRing
Pause
Pausa la riproduzione di un file audio. Se il file non era
in fase di riproduzione, questa operazione non far
nulla.
Sound.PlayBellRing()
filePath
Il percorso del file audio. Questo potrebbe essere un file locale (ad
es.: c:\musica\traccia1.mp3) o un file sulla rete (ad es.:
http://contoso.com/traccia01.wma).
Returns
Nothing
PlayBellRingAndWait
Sound.PlayBellRingAndWait()
PlayMusic
Sound.PlayMusic(notes)
Returns
Nothing
Stop
Sound.Stop(filePath)
Returns
Nothing
Returns
Stack
Questo oggetto fornisce un metodo di memorizzazione dei valori simile ad impilare piatti. possibile
aggiungere un valore in cima alla pila e poi rimuoverlo. Si possono solo rimuovere valori ad uno ad uno
dalla cima della pila, quindi l'ultimo valore aggiunto sar il primo ad essere rimosso.
Operations
PushValue
Stack.PushValue(stackName, value)
value
Il valore da rimovere.
Returns
Nothing
GetCount
Stack.GetCount(stackName)
Returns
Il numero di elementi nella pila specificata.
PopValue
Stack.PopValue(stackName)
Returns
TextWindow
La finestra Testo fornisce funzionalit di input e output di tipo testo. Ad esempio, utilizzando questa
classe possibile scrivere o leggere testo o numeri nella/dalla finestra di testo.
Properties
ForegroundColor
TextWindow.ForegroundColor
PauseIfVisible
TextWindow.PauseIfVisible()
Returns
TextWindow.CursorLeft
Nothing
PauseWithoutMessage
TextWindow.PauseWithoutMessage()
Returns
Nothing
Read
TextWindow.CursorTop
TextWindow.Read()
TextWindow.Left
Returns
TextWindow.Title
ReadNumber
TextWindow.ReadNumber()
TextWindow.Top
Returns
TextWindow.Show()
Hide
TextWindow.Hide()
Clear
TextWindow.Clear()
Pause
TextWindow.Pause()
WriteLine
TextWindow.WriteLine(data)
Returns
Nothing
Write
TextWindow.Write(data)
Returns
Nothing
14
Text
L'oggetto Text fornisce utili operazioni per lavorare con testi.
Operations
Append
Text.Append(text1, text2)
length
Specifica la lunghezza del sotto-testo.
Returns
Il sotto-testo richiesto
GetSubTextToEnd
Text.GetSubTextToEnd(text, start)
text1
text
text2
start
Returns
Returns
Il sotto-testo richiesto.
GetLength
GetIndexOf
Text.GetLength(text)
Text.GetIndexOf(text, subText)
text
Il testo di cui si richiede la lunghezza .
Returns
La lunghezza del testo dato.
IsSubText
text
Il testo in cui cercare.
subText
Il testo da trovare.
Text.IsSubText(text, subText)
Returns
text
ConvertToLowerCase
Text.ConvertToLowerCase(text)
subText
Il sotto-testo da cercare.
text
Returns
Returns
EndsWith
Text.EndsWith(text, subText)
ConvertToUpperCase
Text.ConvertToUpperCase(text)
text
text
subText
Returns
Il sotto-testo da cercare.
Returns
True se il sotto-testo stato trovato alla fine di un dato testo.
StartsWith
Text.StartsWith(text, subText)
subText
Il sotto-testo da cercare.
Returns
True se il sotto-testo stato trovato all'inizio di un dato testo.
GetSubText
Text.GetSubText(text, start, length)
start
GetCharacter
Text.GetCharacter(characterCode)
Returns
Il carattere Unicode che corrisponde al codice specificato.
GetCharacterCode
Text.GetCharacterCode(character)
Returns
15
Timer
L'oggetto Timer fornisce un modo semplice per eseguire operazioni in modo ripetuto e ad un intervallo
costante.
Properties
Interval
Operations
Pause
Timer.Interval
Timer.Pause()
Timer.Tick
Returns
Nothing
Resume
Timer.Resume()
Turtle
La Tartaruga fornisce funzionalit come il linguaggio Logo per disegnare forme manipolando le
propriet di una penna e fornisce primitive per il disegno.
Properties
Speed
Nothing
PenDown
Turtle.Speed
Turtle.PenDown()
Returns
Turtle.Angle
PenUp
Turtle.PenUp()
Turtle.X
Move
Turtle.Move(distance)
Turtle.Y
Returns
Turtle.Show()
Hide
Turtle.Hide()
Nothing
MoveTo
Turtle.MoveTo(x, y)
y
La coordinata Y del punto di destinazione.
Returns
Nothing
Turn
Turtle.Turn(angle)
16
Returns
Nothing
TurnRight
Turtle.TurnRight()
TurnLeft
Turtle.TurnLeft()
17