| | |
BASIC Languages File I/O Help
Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2007
Posts: 6
Reputation:
Solved Threads: 1
Ok I mainly use Liberty BASIC, which is very, very similar to Visual BASIC, and I am having a hard time with a program. I made my program take a user's input, and save it in a text file, like so:
Username=Name,Phone#,Email
John Doe=John Doe,000-0000,email@email.com
But that isn't my problem. The problem is, is that I want the program to allow someone to type in "John Doe" and display it like so:
Username: John Doe
------------------------
Name: John Doe
Phone #: 000-0000
Email Address: email@email.com
Please explain in detail, in any BASIC language(s) that you may know, it doesn't matter, they are all similar!
Username=Name,Phone#,Email
John Doe=John Doe,000-0000,email@email.com
But that isn't my problem. The problem is, is that I want the program to allow someone to type in "John Doe" and display it like so:
Username: John Doe
------------------------
Name: John Doe
Phone #: 000-0000
Email Address: email@email.com
Please explain in detail, in any BASIC language(s) that you may know, it doesn't matter, they are all similar!
Last edited by gamingfan1993; Jun 8th, 2007 at 8:46 pm. Reason: Rewrite
#1: Never bump your messages!!!! People will respond when they see it, and 5 hours is not a long time.
#2: If all Basics are so similar, there is no detail needed. And since you already know they are similar, why are you asking? And where do you get your info that they are similar? They aren't that close in my experience....
#2: If all Basics are so similar, there is no detail needed. And since you already know they are similar, why are you asking? And where do you get your info that they are similar? They aren't that close in my experience....
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
The rudeness of some people on this forum floors me.
gamingfan1993, here's a rough sketch (in QBASIC):
My suggestion, get away from BASIC languages - they get you into a lot of bad habits.
gamingfan1993, here's a rough sketch (in QBASIC):
INPUT "User to look up: ", lookup$
OPEN "data.txt" FOR READ AS #1
lengthoflookup% = LENGTH(lookup$)
WHILE NOT EOF(1)
LINE INPUT #1, buffer$
IF LEFT$(buffer$, lengthoflookup%) = lookup$ THEN
username$ = LEFT$(buffer$, lengthoflookup%)
realname$ = MID$(buffer$, lengthoflookup% + 2, lengthoflookup%)
phonenumber$ = MID$(buffer$, lengthoflookup% * 2 + 4, 8)
email$ = MID$(buffer$, (lengthoflookup% * 2) + 14, (lengthoflookup% * 2 + 14) - lengthoflookup%)
BREAK
WEND
PRINT "Username: "; username$
PRINT STRING$(20, "-")
PRINT "Name: "; realname$
PRINT "Phone Number: "; phonenumber$
PRINT "Email: "; email$
CLOSE #1My suggestion, get away from BASIC languages - they get you into a lot of bad habits.
Angel-headed hipsters burning for the ancient heavenly connection, to the starry dynamo in the machinery of the night.
-Ginsburg
Don't tell me to "google it" - I already have.
-Ginsburg
Don't tell me to "google it" - I already have.
•
•
Join Date: Sep 2007
Posts: 3
Reputation:
Solved Threads: 0
Nice one, I was going to drop in a few of my favorite VisualBasic/QuickBasic library functions and show how to use the first line as a format specifier for the rest of the file, but liberty basic I remember has a weird sub style of whose memory I've tried to forget the horror...
Speaking of horror is there a way to take the address of a QuickBasic Function or Sub, once I have my pointer to function loaded with the address I know how to call it, but...
I don't mind coding in assembly, if I had some idea what I was trying to do?
I've thought about making the sub call an asm proc walking the stack to find the calling sub then rewinding the code to find the a stackframe push. but I don't have any idea exactly how I would write something like that...
Speaking of horror is there a way to take the address of a QuickBasic Function or Sub, once I have my pointer to function loaded with the address I know how to call it, but...
I don't mind coding in assembly, if I had some idea what I was trying to do?
I've thought about making the sub call an asm proc walking the stack to find the calling sub then rewinding the code to find the a stackframe push. but I don't have any idea exactly how I would write something like that...
Last edited by bregalad; Sep 4th, 2007 at 3:56 am.
•
•
Join Date: Oct 2006
Posts: 179
Reputation:
Solved Threads: 2
If you use liberty basic then use liberty basic forum http://libertybasic.conforums.com/ Im not saying dont come to daniweb but the people at LB forum might be able to help you more in relation to liberty
You know your a geek, if you introduce your wife as "mylady@home.wife"
•
•
•
•
Ok I mainly use Liberty BASIC, which is very, very similar to Visual BASIC, and I am having a hard time with a program. I made my program take a user's input, and save it in a text file, like so:
Username=Name,Phone#,Email
John Doe=John Doe,000-0000,email@email.com
But that isn't my problem. The problem is, is that I want the program to allow someone to type in "John Doe" and display it like so:
Username: John Doe
------------------------
Name: John Doe
Phone #: 000-0000
Email Address: email@email.com
Please explain in detail, in any BASIC language(s) that you may know, it doesn't matter, they are all similar!
Sub main()
Dim name As String
Dim phone As String
Dim email As String
name = InputBox("Enter name: ")
phone = InputBox("Enter phone: ")
email = InputBox("Enter e-mail: ")
Call MsgBox("Name = " & name & ", phone = " & phone & ", E-mail = " & email)
End SubHoppy
![]() |
Similar Threads
- basic file i/o (Java)
- which language ? (Computer Science)
- Visual basic why does my exe file need dotnetfx? (VB.NET)
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: ftp inside function in korn shell script
- Next Thread: 2d to 3d mapping....
Views: 2702 | Replies: 7
| Thread Tools | Search this Thread |
Tag cloud for Legacy and Other Languages






