Open secret in a lookup

Hello again friends,
I have a lookup procedure that puts in the room number when it matches the teachers name in the Lookup File. My question is can I use “opensecret”? I don’t necessarily want to have the “SGCS Teachers Lookup,19_20” open all the time. Any help would as always be appreciated.

;This procedure will put in the room number when a teacher is selected

«Room.1»=lookup(“SGCS Teachers Lookup.19_20”,«Teacher»,«Teacher.1»,«Room»,"")

Yes. That’s probably the main reason that opensecret exists.

I realize that it is useful. Maybe I was not clear. Where do I put the “opensecret”?
Does it go into the lookup procedure or is it a separate line?

Anytime prior to the actual lookup. It could be earlier in the same procedure. It could be in the .Initialize of the database that will be doing the lookups. Once the database is opened in secret, it will normally stay open until you quit Panorama, or run some code to make it active and close it.

Thanks Dave.
I did not know that I could do the “opensecret” of a file in the .Initialize
This is what I did in the procedure and it works just fine:

;This procedure will put in the room number when a teacher is selected
opensecret “SGCS Teachers Lookup.19_20.pandb”
«Room.1»=lookup(“SGCS Teachers Lookup.19_20”,«Teacher»,«Teacher.1»,«Room»,"")

Just curious: why do I have to put the extension at the end of the file in opensecret but not in the lookup?

The opensecret is looking for a file on the disk. It has to ask the operating system to open it, and the operating system wants the entire name, including the extension. Otherwise it wouldn’t know if Panorama was asking for foo.txt, foo.jpg, or foo.pandb. Once Panorama has a database open, the name it gives to the file in RAM doesn’t include the extension.

1 Like