By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,885 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

How to read information from more than one line with out loop from file(plz help)

P: 5
hmmmm...thanks to all that are willing to help i am using VB 6...theres more than one question i wish to ask please bare with me...i have to read in information from a file which the program origannly write to. i first had a while to EOF loop to read in all the information and place it into an array..i then got stuck and didnt know where to go from there. i couldnt find a way to print out the information from the array into several text.boxs(several being 7) i wud normally use a loop to print it out but the program runs so fast that before u can see the 1st set of information it is reprinted and reprinted again till it reaches the last bit..Also the array code i used i couldn't find a way to delete information from a file while i am viewing it in text.boxs in the VB program...is there any way u can delete information from a file via the VB program???

Last question is there anyway i can use variables that i declared and used and stored information in the code which i used for a command button in another code for a different command button...
example
if i was to declare a variable called (anything) and save information in it under a command button called (anything) in that same program will i be able to use the same variable called (anything) in another command button called (anything2) and will it have the information that was stored in it earlier

please help
thanks in advance
Apr 17 '07 #1
Share this Question
Share on Google+
5 Replies


Tig201
100+
P: 103
............Last question is there anyway i can use variables that i declared and used and stored information in the code which i used for a command button in another code for a different command button...
example
if i was to declare a variable called (anything) and save information in it under a command button called (anything) in that same program will i be able to use the same variable called (anything) in another command button called (anything2) and will it have the information that was stored in it earlier

please help
thanks in advance
Declare the variable at the top of your code page outside of any subs or functions and it will be a module variable and accessible to anything on the form.
Apr 17 '07 #2

P: 5
tig201 thank you so much for your help with that question
Apr 17 '07 #3

P: 5
Declare the variable at the top of your code page outside of any subs or functions and it will be a module variable and accessible to anything on the form.
I declared the variable at the top of code and made it an integer which worked and i am grateful for but i then an error called overflow so i then placed
val(variable) = val(text.box) - 40 and so forth and i now get an error called
function call on left-hand side of assignment must return Variant or Object

thank you for ur help
Apr 17 '07 #4

Tig201
100+
P: 103
In VB6 an integer is a number from "-32768 to 32767"
if your number is outside of this range try declaring it as a long which can be a value from
"-2147483648 to 2147483647".
This should correct the overflow error.
Also Change “val(variable) = val(text.box) – 40” to “variable = val(text.box) – 40”
Apr 17 '07 #5

P: 5
In VB6 an integer is a number from "-32768 to 32767"
if your number is outside of this range try declaring it as a long which can be a value from
"-2147483648 to 2147483647".
This should correct the overflow error.
Also Change “val(variable) = val(text.box) – 40” to “variable = val(text.box) – 40”
thank you so much for your help i didnt know about the integer's range u have been very helpful and i appreciate it.

thank you again
Apr 17 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.