02-21-2008
BT-Basic Read File
I'm a real newby to BT-Basic and I have this task at hand.
I have to input a user name and password in a BT-Basic program. I would like to compare this input to a name list in root and if found, continue. If not loop back to the input.
I have this:
Oper_Id_Prompt$ = "Enter ID"
print using """"&Oper_Id_Prompt$&""",#"
input "",Oper$
Oper_Pass_Prompt$ = "Enter Password"
print using """"&Oper_Pass_Prompt$&""",#"
input "",Pass$
I also have a file called "users" in root with lines of text:
user1|password1
user2|password2
user3|password3
user4|password4
I would like to read this file for a legal user and password and continue if found, loop back to Oper_Id_Prompt$ = "Enter ID" if not found.
I'm not sure how to open/close/read files and build arrays in this BT-Basic.
Can one of you gurus give me a "snippet" or some advise?
Thanks
Tim
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,
I am looking to create a single file called outputa.txt, which will show the contents of my directorya and its sub directories, and all file and directory permissions.
What command would be used for this?
Cheers
Kev (2 Replies)
Discussion started by: kev112
2 Replies
2. Programming
# include <stdio.h>
# include <fcntl.h>
# include <stdlib.h>
# include <sys/stat.h>
int main(int argc, char *argv)
{
int fRead, fPadded, padVal;
int btRead;
int BUFFSIZE = 512;
char buff;
if (argc != 4)
{
printf ("Please provide all of the... (3 Replies)
Discussion started by: naranja18she
3 Replies
3. Shell Programming and Scripting
hi friends
well m facing a different sort of issue in my cron.
i hav set job like this
30 09 * * 1 /bin/backup14M
01 14 * * 1 /bin/backup14N
20 18 * * 1 /bin/backup14E
that is for every Monday at three different times.
but, first job executes well, later ones do not. I checked my... (13 Replies)
Discussion started by: oracle.test2
13 Replies
4. UNIX for Dummies Questions & Answers
I have a csv file with 3 columns. Column 1 is a date "mm/dd/yyyy", column 2 is a dollar amount (e.g. "100.00") & column 3 in a description of where the transaction took place (e.g. "CHECK CRD PURCHASE 10/07 ACME INC USA")
so...
"10/01/2009","100.00", "CHECK CRD PURCHASE 10/07 ACME INC USA"
I... (1 Reply)
Discussion started by: watingo
1 Replies
5. UNIX for Dummies Questions & Answers
Hello,
Little new to unix scripting. I need to create a script that will do the following.
Check in a directory for a file that will be present between 19:00 and 23:00. If the file is present a e-mail then needs to be sent to myself confirming. I did write something basic...as below...
... (3 Replies)
Discussion started by: Thundercat1
3 Replies
6. UNIX for Dummies Questions & Answers
Hello All,
i am a newbie and need some help when reading a csv file in a bourne shell script. I want to read 10 lines, then wait for a minute and then do a reading of another 10 lines and so on in the same way. I want to do this till the end of file.
Any inputs are appreciated
... (3 Replies)
Discussion started by: victor.s
3 Replies
7. Shell Programming and Scripting
Hi,
I am facing issues with the below:
I have a lookup file say lookup.lkp.This lookup.lkp file contains strings delimited by comma(,).
Now i want to read this command from file and execute it.
So my code below is :
Contents in the lookup.lkp file is :
c_e,m,a,`cd $BOX | ls cef_*|tail... (7 Replies)
Discussion started by: vital_parsley
7 Replies
8. Shell Programming and Scripting
Hello!
I have a small shell project that is due next week, that I'd appreciate some help with.
task: Write a shell program that can analyze at least 2 types of log files and print them in an easily readable way. Make it so that you can switch between log file types. The two file types should be... (1 Reply)
Discussion started by: malfiory
1 Replies