VBScript Basics, Part 63 | Change and Remove (Dictionary)

preview_player
Показать описание
Visual Basic Script (.vbs) Basic Tutorial:
Learn how to change a key or item in a dictionary, or remove/delete them from your dictionary.
Рекомендации по теме
Комментарии
Автор

If I wanted to create a random array, how can I remove the previous choice? ....for example: Explicit
Dim C, Y, X, = 12
set Y = CreateObject
with Y.OpenTextFile C = CreateObject ("Scripting.Dictionary")
C.add "Jack", "Hearts"
C.add "Queen", "Hearts"
C.add "King", "Hearts"
C.add "Ten", "Hearts"
C.add "Nine", "Hearts"
C.add "eight", "Hearts"
C.add "seven", "Hearts"
C.add "six", "Hearts"
C.add "Five", "Hearts"
C.add "Four", "Hearts"
C.add "three", "Hearts"
C.add "two", "Hearts"
C.add "Ace", "Hearts"for A = 12 to 0
Randomize
X = int(A*Rnd)
.writeLine C.keys()(x)

next....end with
msgbox "Finished"

Troylglover