User Profile

140 views
Skip to first unread message

Jackson Ramos

unread,
Jan 21, 2022, 1:35:25 PM1/21/22
to Pick and MultiValue Databases
So im trying to play around with ex.012 in Jon Sisk's A Programmers Guide, however i would like to enter a username instead to pull information from a script and if it doesn't have any information in the script then make a new item. The script has 13 values delimited by value marks. So far i got
   
116 1000 * USER CAN ENTER USER INITIALS
117 *
118   PRINT @(-1) :  ; * CLEAR SCREEN
119   CRT @(32,0): "USER PROFILE"
120   LOOP
121      PRINT @(0,23) : "Enter username: " :
122      INPUT USER.ID
123   EXECUTE 'unix /opt/pbs/bin/PBgetUserProfile ':USER.ID CAPTURING PROFILE
124   UNTIL USER.ID > '' DO REPEAT
125   IF USER.ID = "END" THEN EXIT.FLAG = TRUE ELSE EXIT.FLAG = FALSE
126 *
127 * READ ITEM
128 *
129   NEW.ITEM.FLAG = FALSE
130   MATREAD USER.ITEM FROM USER.FILE, USER.ID ELSE
131      MAT USER.ITEM = ''
132      NEW.ITEM.FLAG = TRUE
133   END
134   RETURN    ; * DONE WITH ENTER INITIALS AND READ ITEM
135 *
136 2000 * EDIT ITEM
137 *
138   GOSUB 10000   ; * PRINT LABELS
any suggestions?

chandru murthi

unread,
Jan 21, 2022, 5:00:57 PM1/21/22
to Pick and MultiValue Databases
What suggestions are you looking for?

If entered id is "END" what's the point is doing the MAT READ? Exit the program.

Chandru

Brian Speirs

unread,
Jan 22, 2022, 7:34:21 PM1/22/22
to Pick and MultiValue Databases
As Chandru has said, it isn't really clear what you are looking for - particularly in how your user profile fits in with the user item ... That said, here is one way of re-writing that bit of code:

get.userid:

new.item.flag = @FALSE
exit.flag = @FALSE
exits = CONVERT(',', @AM, 'X,Q,END')
MAT user.item = ''
profile = ''

CRT CLR.SCR:@(32, 0):'User profile'

LOOP
  CRT @(0, 23):'Enter username: ':
  INPUT user.id:
  LOCATE UPCASE(user.id) IN exits SETTING xpos THEN
    exit.flag = @TRUE
        RETURN
  END
  IF (user.id NE '') THEN EXIT
REPEAT

cmd = 'unix/opt/pbs/bin/PBgetUserProfile ':user.id
EXECUTE cmd CAPTURING profile

IF (profile EQ '') THEN
  MATREAD user.item FROM user.file, user.id ELSE new.item.flag = @TRUE
END

RETURN

A few things here:
  • Most variables are initialised at the start of the routine. This is particularly important for the MATREAD which in PICK settings is NOT set to null when the read fails (i.e. it retains previous values).
  • CLR.SCR is simply an EQUATED value that returns @(-1)
  • If the user enters any of the exit values, then you return immediately from the subroutine (after setting the exit flag)
  • The profile read does not occur until after the loop has terminated
  • Likewise, the read of the user item only occurs if the profile read has failed.
I don't really like the use of "hard" screen positions at it implies your screen is set to a particular size. I typically have AccuTerm running with screen sizes of 150 characters wide by 35 lines deep, or more - so I would be assessing the screen size, and then writing to some position based on that screen size ... or more typically, I am just using a GUI application, and terminal applications don't need to bother with screen layout.

Maybe this is what you are looking for ... maybe it isn't.

Cheers,

Brian

Jackson Ramos

unread,
Jan 24, 2022, 1:30:15 PM1/24/22
to Pick and MultiValue Databases
Pretty much what i am looking for Brian. This helped out a lot. Thanks 


Jackson

jes

unread,
Jan 24, 2022, 4:16:10 PM1/24/22
to Pick and MultiValue Databases

It was suggested that the OP contact me for training early in his series of posts. He had already done that when that advice was given. I spent a fair amount of time trying to assess his sketchy needs - he wouldn’t identify company, platform, app or even his goals. I even tried the phone number he gave me then didn't answer. All I could discern from his LinkedIn profile - where he invited me to connect - was that he was currently a “Laborer” with no business connections listed. I can only guess he wanted to lift himself from Laboring into the exciting growth sector of Pick Programming. When he learned there were actual costs attached to training, he ghosted me and switched to crowdsourcing his education here. If he had been honest I could have cut him some slack or even handled it Pro Bono. Maybe it will take this community to raise this one.

jes

Jackson Ramos

unread,
Jan 24, 2022, 4:21:43 PM1/24/22
to Pick and MultiValue Databases
I apologize Jon if i was disrespectful in anyway. I'm happy to provide the information now if you want. I just knew my higher ups wouldn't handle the costs of education And also i was in the hospital for a fair amount of time because of COVID so it's not like i could've been educated in anyway. Even so i apologize if i came looking for information in the wrong places.

jes

unread,
Jan 24, 2022, 7:12:20 PM1/24/22
to Pick and MultiValue Databases
On Monday, January 24, 2022 at 4:21:43 PM UTC-5 jackso...@qualco.com wrote:
I apologize Jon if i was disrespectful in anyway. I'm happy to provide the information now if you want. I just knew my higher ups wouldn't handle the costs of education And also i was in the hospital for a fair amount of time because of COVID so it's not like i could've been educated in anyway. Even so i apologize if i came looking for information in the wrong places.

You have definitely come to the right place. This group is uniquely inhabited by thousands of years of experience combined with the ancient language skills of Indiana Jones along with the availability of the Maytag Repair Man. One or two of them may write 800 words on why they don’t have time to reply, but don’t let this discourage you.

Brian Speirs

unread,
Jan 24, 2022, 9:57:05 PM1/24/22
to Pick and MultiValue Databases
For other learning resources, look at the "Getting Started in OpenQM" books at www.rushflat.co.nz

Even if you are using a database other than QM, there will be a high degree of similarity. In any event, they will help you understand how to query the database, and to write programs to use the data contained there.

Cheers,

Brian

geneb

unread,
Jan 25, 2022, 10:05:13 AM1/25/22
to Pick and MultiValue Databases
On Mon, 24 Jan 2022, Brian Speirs wrote:

> For other learning resources, look at the "Getting Started in OpenQM" books
> at www.rushflat.co.nz
>

I'll second this. Brian's stuff is an excellent introduction to
Multi-Value systems.

g.

--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.diy-cockpits.org/coll - Go Collimated or Go Home.
Some people collect things for a hobby. Geeks collect hobbies.

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://scarlet.deltasoft.com - Get it _today_!

Will Johnson

unread,
Jan 25, 2022, 1:39:48 PM1/25/22
to Pick and MultiValue Databases
Qualco is a very small operation, in Passaic.
Looks like their website is even hopelessly broken

Probably one of those shops, where the prior person who knew anything retired or quit, and they failed to connect themselves into the larger community.  Perhaps even fired their outside software support people.

I feel this pain.  I've been called into *many* sites like that where no one really knew what was what.
Reply all
Reply to author
Forward
0 new messages