473,503 Members | 1,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

5 New Member
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
5 1553
Tig201
103 New Member
............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
john009
5 New Member
tig201 thank you so much for your help with that question
Apr 17 '07 #3
john009
5 New Member
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
103 New Member
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
john009
5 New Member
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

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

Similar topics

7
2230
by: Naren | last post by:
Hello All, Can any one help me in this file read problem. #include <stdio.h> int main() {
5
1792
by: Marc Violette | last post by:
<Reply-To: veejunk@sympatico.ca> Hello, I'm hoping someone can help me out here... I'm a beginner ASP.NET developper, and am trying to follow a series of exercises in the book entitled...
0
1046
by: Inspired | last post by:
hi guys.. im writing an application that uses windows service to listen (as a tcplistener) for any data sent (by a tcpclient) ... one kind of the requests might be a file sent by client and the...
1
1556
by: mulham.haffar | last post by:
hi guys.. im writing an application that uses windows service to listen (as a tcplistener) for any data sent (by a tcpclient) ... one kind of the requests might be a file sent by client and the...
0
980
by: mulham.haffar | last post by:
hi guys.. im writing an application that uses windows service to listen (as a tcplistener) for any data sent (by a tcpclient) ... one kind of the requests might be a file sent by client and the...
3
1592
by: eric dexter | last post by:
This seems to write everything to the shell but not out to a disk file def get_instr(from_file, to_file, instr_num): instr_num_str = str(instr_num) out_list = infile =...
2
1040
by: madhu7sudan | last post by:
HI here is the stored procedure CREATE Procedure dm_deleteBBPost ( @TopicID numeric, @ForumID numeric ) As declare @netCount as int
1
1101
by: alivip | last post by:
How can I get every Token (word) and PreviousToken(Previous word) From text file For example if the text file content is "Every man has a price. Every woman has a price." First Token(word) is...
3
1218
by: George | last post by:
There is a file name file.txt with content below: 11 21 31 41 41 31 21 11 31 21 11 41 How can I read the file line by line, and then print the first three...
0
7089
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.