Advertisement
2002C Data Structures #11015

split function with a textbox

Good example of the split and randomize commands. lets you place a long list of text in a textbox and randomly grab a line. My use for this was I had about 500 cd keys to issue to customers as they would callin. I would run this script, give them a number, remove from my list later, etc. Possible uses might be for numbers, tip of the day quotes, etc. Rokinroj

AI

Podsumowanie AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kod źródłowy
original-source
Private sArray() As String
Private Sub cmdGetKey_Click()
Dim RandNum As Long
  Randomize
  RandNum = Int(Rnd * 1446) + 1
  Text1.Text = sArray(RandNum)
  
End Sub
Private Sub Form_Load()
   sArray() = Split(txtKeys.Text, vbCrLf)
End Sub
Oryginalne komentarze (3)
Odzyskane z Wayback Machine