Hot Topic (More than 10 Replies) @XlistValues  and @Popupmenu (Read 1850 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
@XlistValues  and @Popupmenu
Jan 20th, 2004 at 7:53pm
Print Post Print Post  
I am working with @XlistValues  and @Popupmenu and could use some help.

If my database is called num1.db in the c:\sesame\Data directory do I understand correctly that the syntax for @XListvalues translates to

@XListValues(“data\num1.db”

The form is Physican
The source element is PhysMedicalGroupName

@XListValues( “data\num1.db”,”Physican! PhysMedicalGroupName”)

Then to create a pop up I am using the logic

var Str1 as string
var str2 as string

str1 = @XListValues("data\num1.db","physican!physmedgroupname") // This should create semicolon-delimited string

str2 = @PopupMenu(str1, "Medical Group Name") // This should make my menu/selection pop-up list.

Writeln(str2)

It does not work the way I thought Why?

This example also brings up a design question. With commands like XListValues instead of using an absolute name and path should I be using a Global Value to set the db name and path so when I save as a new application (different name) I do not have to change it in all the program layouts coding?
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @XlistValues  and @Popupmenu
Reply #1 - Jan 20th, 2004 at 8:41pm
Print Post Print Post  
Bob, What did you expect to have in WriteLN? Str2 is a graphic box with str1 string values. How WriteLn box which only displays text is going to display graphics?

You mean,

writeln str1

that should display semicolon delimited data.

What did Writeln window display for str2 value?
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: @XlistValues  and @Popupmenu
Reply #2 - Jan 20th, 2004 at 8:53pm
Print Post Print Post  
Bharat_Naik,

I was following the example on page 157 of the programming guide.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @XlistValues  and @Popupmenu
Reply #3 - Jan 20th, 2004 at 9:06pm
Print Post Print Post  
Bob:  I see, What value did Writeln window display?

I am looking at page 157, and I do not get that

WriteLn (str2)

As I understand, writeln used mainly for debugging and provide the results of programming.

In the example, 3rd line

GemType = str2    

makes more sense.
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: @XlistValues  and @Popupmenu
Reply #4 - Jan 20th, 2004 at 9:41pm
Print Post Print Post  
I did not understand the reason either but I figured there was a reason for the Writeln(str2).

I was just playing with examples from the manual. I thought I would create a  popup selection menu from a database form with a list of names from an element that is on a database form in the database application.

Basically the application name is num1.db

The database that I am calling the popup from  is Basicinfo
The layout form is called basicinfo
The element that is calling the popup is eventphysican that is a subform from the database event.
The data that @XListValues is using is coming from a database called Physican and the element named PhysMedicalGroupName.

I have not been successful at grabbing the data and making the menu. I am figuring I am referencing the wrong name somewere.

I have the most difficult time with the new naming convention.

I have element down fine. This is what I used to call a field.
Each group of data is called a database
Each form is a layout
And the entire group of databases is called a database (.db) this is most confusing to me. I just refer to this as my application.
When the manual refers to database such as page 171 @XListvalues I think it means my whole application name. (the .DB name)
When it refers to element Path I think it means the database the element is contained in.

I can not wait to be farther along on the learning curve. Smiley
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @XlistValues  and @Popupmenu
Reply #5 - Jan 20th, 2004 at 10:37pm
Print Post Print Post  
Quote:
The database that I am calling the popup from  is Basicinfo
The layout form is called basicinfo
The element that is calling the popup is eventphysican that is a subform from the database event.
The data that @XListValues is using is coming from a database called Physican and the element named PhysMedicalGroupName.

I have not been successful at grabbing the data and making the menu. I am figuring I am referencing the wrong name somewere.

I have the most difficult time with the new naming convention.

I have element down fine. This is what I used to call a field.
Each group of data is called a database 
Each form is a layout



Bob,  Let us get it right.

Basicinfo is a layout form
Physician is Database
num1.db is application

str1 = @XListValues("data\num1.db","physican!physmedgroupname")

In the above statement physician should be replaced by Basicinfo  (because that is you layout Form)

So the correct syntax should be

str1 = @XListValues("data\num1.db","Basicinfo!physmedgroupname")


I think....
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: @XlistValues  and @Popupmenu
Reply #6 - Jan 20th, 2004 at 11:44pm
Print Post Print Post  
But the element is really on the layout form Physicans and it is in the subform on Basicinfo

I tried your syntax and it still does not work.

To simplify things I stopped working with the subform and have gone to a single simple form named events.

I am now trying it from the layout form events (no subforms no command buttons nuttin)

The database is still data\num1.db
The layout form is Events
The element data that I am returning is physmedgroupname from a database named  Physicans

So this is my logic

var Str1 as string
var str2 as string

// Step1
str1 = @XListValues("data\num1.db","Physicians!physmedgroupname") 

I believe this is getting the data from the element physmedgroupname from the layout form Physicians in the Num1.db located on c:\sesame\data and creating them as a semicolon-delimited string as str1

// Step2
str2 = @PopupMenu(str1, "Medical Group Name")

I am hoping this is taking the data from str1 and placing it in str2 as a organized menu

//Step3
Writeln(str1)

I am guessing this is displaying the menu from str2

It would seem step 1 is correct
Step 2 seems like it would be more like just @PopupMenu(str1, "Medical Group Name")

Step 3 makes no sense to me

But for all I know the example I am following has nothing to do with what I am attempting or is a misprint. I am at the point were I am best to walk away from this for a few hours and try this again with a clear mind tonight.

The guys with the straight jackets are almost here Wink
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @XlistValues  and @Popupmenu
Reply #7 - Jan 21st, 2004 at 12:29am
Print Post Print Post  
Bob, I agree with you that the nomanclature in Sesame is confusing and more so, when you have used other database programs.

Whatever little I understand is this:

Application
database
Layout forms
Layout Element

The first two terms are very confusing. To confuse the matter further, Application, Database and Layout form could have the same name and if you translate the database from Q&A, precisely all three of them are given the same name.

Now one which is at the top is application which is .db and it could have more than one database in it.  .db file in not database but it is an application. One Database could have one or more  Layout Forms.  In the syntax we are not supposed to use Database name anywhere, database is always in the background. It is not referred anywhere in the programming syntax. In the programming syntax is only Application (i.e. .db), Layout Form, and layout elements are used. 

We unfortunately use application and database  interchangably and that creates a lot of confusion. While talking or working with syntax, it is better if we do not use word database.

Having said this, Database is the only real thing that holds the data.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @XlistValues  and @Popupmenu
Reply #8 - Jan 21st, 2004 at 1:19pm
Print Post Print Post  
Bob,

The WriteLn is just a way of showing the result of the example. It should display whatever you pick from the popup list. What results are you getting? Do you get a popup list at all?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: @XlistValues  and @Popupmenu
Reply #9 - Jan 21st, 2004 at 1:38pm
Print Post Print Post  
Bob,

Gave it a try using Customers.db and Gems.db. In a mass update program in Customers.db, accessing a LE in Gems.db in the "Gem Types" form.

---------------------
var str1 as string
var str2 as string

str1 = @XListValues("Gems.db", "Gem Types!Description")
str2 = @PopupMenu(str1, "My Long List of Descriptions")
writeln(str2)
---------------------

Works well to get a field from the parent form.

---------------------
var str1 as string
var str2 as string

str1 = @XListValues("Gems.db", "Gems!Origin")
str2 = @PopupMenu(str1, "My Long List of Origins")
writeln(str2)
---------------------

Gets and displays values from the "Gems" subform. But remember that, because it is a subform, XListValues cannot determine which parent form you want, so you have to access the subform in its standalone "mode" - that gets you all the "origins" for all of the "Gems" without regard for which "Gem Type" they appear under.

To debug a program that uses @XListValues and @PopupMenu together, you may consider using writeln to see the string coming back from @XListValues, instead of passing right it to @PopupMenu. If it is blank, then you need to look at the syntax you are passing to @XListValues - either it can't find/access the .db file, or the path to the LE is not correct. If the .db file you are accessing contains multiple forms, you must include the specific form name in the LE path passed to @XListValues, separated from the LE name using a "!" (bang).

It is meaningless to pass more than one form name in the path to the LE name.

i.e.:
@XListValues("Gems.db", "Gem Types!Gems!Origin")

Because it can't know *which* "Gem Types" you want.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: @XlistValues  and @Popupmenu
Reply #10 - Jan 21st, 2004 at 2:16pm
Print Post Print Post  
Thanks for the guidance. Smiley

The examples and suggestions that you post are such a booster to the learning curve. It gets us close enough to our objective that we can be dangerous.Cheesy

It is also great getting help, encouragement and views from all the other users out here. There is great comfort in knowing you are not alone.(In happiness or frustration) Grin

I will play with it more and eventually I will comprehend it (I hope)  Undecided

Thanks Again.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged