0% found this document useful (0 votes)
10 views

'Clear A Textbox 'Or 'Declare A Variable and Store Data From The Textbox

The document discusses various concepts related to arrays, text files, functions, and procedures in .NET including: 1) Declaring and populating single and multi-dimensional arrays. 2) Reading from and writing to text files using StreamReader and StreamWriter. 3) Using buttons, listboxes, and textboxes as controls. 4) Creating and using sub procedures and functions with arguments.

Uploaded by

Cedric Cedric
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

'Clear A Textbox 'Or 'Declare A Variable and Store Data From The Textbox

The document discusses various concepts related to arrays, text files, functions, and procedures in .NET including: 1) Declaring and populating single and multi-dimensional arrays. 2) Reading from and writing to text files using StreamReader and StreamWriter. 3) Using buttons, listboxes, and textboxes as controls. 4) Creating and using sub procedures and functions with arguments.

Uploaded by

Cedric Cedric
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Our project was based on text files and arrays so please allocate more effort on this please you

have to look at your paste papers for anything about arrays and text files. There some questions relating to use of arrays and text files .you got go through them please. Am talking about 1 looping array ! declaring arrays " working with two dimensional arrays and text files # $opulating array using..for..next loop or for each loop % using streamreader and streamwriter & controls e.g buttons'listboxes'textboxes etc ( how to use sub procedures and functions ) how to use arguments within function or sub procedures * textiles+reading and writing 1, -ou have to know how to declare things .ote/$aste paper are good ....check how to answer the questions please.

'clear a textbox TextBox1.Clear() 'or TextBox1.Text = "" 'declare a variable and store data from the textbox Dim strname As Strin = TextBox1.Text Dim intx As !nte er = Convert.To!nt"#(TextBox1.Text) 'add data to listbox $istBox1.!tems.Add("%&alim'") 'delete selected item in listbox $istBox1.!tems.(emoveAt($istBox1.Selected!ndex) 'clear listbox $istBox1.!tems.Clear() 'declare an arra) Dim names() As Strin = *"+a'l", "-en". 'or Dim st'dents(#) As Strin st'dents(/) = "+eter"

st'dents(1) = "+a'l" st'dents(#) = "rachael" 'declare a t&o dimensional arra) Dim ne&name(,) As Strin ne&name(/, /) = "+a'line" ne&name(/, 1) = "-imani" 'loo+ an arra) Dim arr() As !nte er Dim iloo+er As !nte er 0or iloo+er = / To arr.1et2++erBo'nd(/) messa ebox.Sho&(arr(iloo+er) 3ext 'or 0or 4ach iloo+er !n arr %essa eBox.Sho&(arr(iloo+er)) 3ext 'loo+ a t&o dimensional arra) Dim ne&n'mber(", ") As !nte er Dim x, ) As !nte er 0or x = / To ne&n'mber.1et2++erBo'nd(/) 0or ) = / To ne&n'mber.1et2++erBo'nd(/) %essa eBox.Sho&(ne&n'mber(x, ))) 3ext 3ext

'test if a file exists !f !5.0ile.4xists("c67-eni.txt") Then 4nd !f '&rite somethin on a textfile

Dim ob8&rieter As 3e& !5.Stream9riter("c67-eni.txt") ob8&rieter.9rite$ine("m&alim'")

'read from text file Dim ob8reader As 3e& !5.Stream(eader("c67-eni.txt") Dim strdata As Strin = ob8reader.(eadTo4nd 'close file to be 'sed b) other +ro rams ob8reader.Close()

'declare as f'nction +roced're 0'nction min's() As !nte er (et'rn 1// 4nd 0'nction ''se ar 'ments &ithin a f'nction 0'nction addition(B):al x As !nte er) As !nte er (et'rn x 4nd 0'nction 'create a s'b +roced're S'b add() 4nd S'bvv

You might also like