Source language: Translate to:

Prob

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Prob

Postby Alex » Fri Oct 13, 2006 6:35 am

I have Lexicon.dbf and when I click on button “OK” I would like that it puts several different answers to me, i.e., that every second time or on 3 it changes me the answer, it is for when somebody has 2 different addresses, I click on Go after having entered its name, then it leaves me one its 2 addresses.

(see:http://neobookfrance.free.fr/forum/viewtopic.php?t=36&postdays=0&postorder=asc&start=30). This puts does not go for DataBank.

Thank you

Alex
Last edited by Alex on Tue Oct 31, 2006 11:36 am, edited 1 time in total.
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Neobook » Fri Oct 13, 2006 11:41 pm

Hi,

Very interesse your idee, but I think that need maybe 2 Lexincons.
Neobook
 
Posts: 131
Joined: Sat Jul 01, 2006 7:07 am

Postby Alex » Sat Oct 14, 2006 4:45 am

Hi,

No, if I do 2 answers, it cans chose 1 time out of 2, but I don't How do ???

Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Alex » Tue Oct 17, 2006 9:35 am

Hello !!!
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Neosoft Support » Tue Oct 17, 2006 2:46 pm

I'm sorry, I don't understand your question.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Leos » Wed Oct 18, 2006 4:01 am

I don´t know if i understand your question, but it seems that you can this:

You mus have two databases relationated by the some id (the value ID in the first must be the same ID at the second database)

In the first you have something like this:

The first dataBase1

ID, Name, 1Adress

example:
1, My Name, Coimbra
2, Your Name, Buenos Aires


The second dataBase2

ID, 2Adress
ID, 3Adress
ID, 4Adress

example:

1, Lisboa
1, New York
1, Mexico City
2, Paris
2, London


Your Ok button must have the code

dbfquery "Database2" "ID=="[dataBase1.ID]"

When you have in dataBase 1 ID=1 it returns the values from the second:

1, Lisboa
1, New York
1, Mexico City
User avatar
Leos
 
Posts: 178
Joined: Mon Apr 04, 2005 11:13 am
Location: Coimbra, Portugal

Postby Alex » Wed Oct 18, 2006 4:28 am

Thanks,

But my question was :

How can I do a multi-answer, it's mean, my friend Vadim has 2 e-mail adress, and when I search his information, it's say his name... and for the e-mail adress, I want to have 2 answers 1 time out of 2.

For example it writes for the first time : vadim@aol.fr
and in the second time when I search still, it writes me : vadim@free.fr

Thanks
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Gaev » Wed Oct 18, 2006 4:58 am

Alex:

Can you define "first time" and "second time" in more detail ? i.e. can user

- ask for Vadim ... program responds with vadim@aol.fr

- ask for Alex ... program responds with alex@abc.com

- aske for Chris ... program responds with chris@xyz.com

... and then if user asks for Vadim again, do you want program to respond with vadim@free.fr ? ... in other words, keep track of last displayed address item for EACH user ? ... or do you just want to display as many addresses that a user has ?

If you have a database with fields like UserName and EmailAddr ... then you could do a dbfQuery with a filter of UserName=Vadim (or UserName=[TextEntry1] if TextEntry1 is where the request is entered) ... and then either show all matching results together (dbfShowTable) ... or loop through [dbfQueryResult] records (using dbfNext) ... and display one record at a time.

Keeping track of last displayed address for CURRENT user is simple ... but keeping track of last displayed address for EACH user is very complex.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Alex » Sat Oct 21, 2006 3:00 am

Hi,

Look, when I search the information about Vadim, the program give me for the first time when I had clique of OK the first e-mail adress of Vadim.
When I research for the seconde time Vadim's information, it's give me Vadim's seconds e-mail adress.

The first time when I search Vadim, the lexicon give me : vadim@aol.fr
and when I search Vadim in a second time, the lexicon give me : vadim@free.fr
And when I want to search the information of Vadim for the third the lexicon star again with vadim@aol.fr

Thanks

Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Gaev » Sat Oct 21, 2006 7:50 am

Alex:

I understand the requirement in your last post ... where you want to display the items in the list in a circular sequence .. something not mentioned in your earlier posts ... it is possible to do this ... but you DID NOT answer my question ... the suggested design depends on this answer ... so let me ask one more time ...

- user searches for Vadim ... program responds with vadim@aol.fr

- user searches for Alex ... program responds with alex@abc.com

- user searches for Chris ... program responds with chris@xyz.com


- and user searches for Vadim again ... do you want program to respond with


vadim@free.fr ?

or

vadim@aol.fr ?
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Alex » Sat Oct 21, 2006 11:08 pm

Hi,

Sorry

I have a case with : Name
a case with : Lastname
a case with : Age
a case with : Adress
a case with : e-mail adress1
a case with : e-mail adress2

I save this in Lexicon.dbf

When I search my friend Vadim I have :

Name : Vadim
Lastname : Dupont
Age : 45
Adress : 230 road Town
E-mail adress : vadim@aol.fr

Now, when I search my friend Vadim again the lexicon give me this :

Name : Vadim
Lastname : Dupont
Age : 45
Adress : 230 road Town
E-mail adress : vadim@free.fr

You can see, the e-mail adress have change.

And when I search Vadim again it begin from the star with vadim@aol.fr

I don't know how do this.

Thanks

Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Gaev » Sun Oct 22, 2006 6:24 am

Alex:

You are not answering my question ... so one last time ...

i) When you search Vadim you get :

Name : Vadim
Lastname : Dupont
Age : 45
Adress : 230 road Town
E-mail adress : vadim@aol.fr

ii) Then, when you search Alex you get :

Name : Alex
Lastname : Smith
Age : 15
Adress : 123 Street
E-mail adress : alex@abc.com



iii) If AFTER THIS SEQUENCE OF SEARCHES, you search Vadim again ... what do you expect to see ?

Name : Vadim
Lastname : Dupont
Age : 45
Adress : 230 road Town
E-mail adress : vadim@free.fr

OR

Name : Vadim
Lastname : Dupont
Age : 45
Adress : 230 road Town
E-mail adress : vadim@aol.fr


... in other words, do you want the program to ...


a) Always respond to a search for a NEW NAME by displaying content of e-mail address1 ?

OR

b) Remember which e-mail address was LAST displayed for each Name ... and then display the other one ?


If the answer is (b), all you need to do is add another field (case) called LastShow (string, 1 byte) ... then ...
Code: Select all
If "[lexicon.LastShow]" "<>" "1"
   SetVar "[ShowEMail]" "lexicon.email1]"
   SetVar "[LastShow]" "1"
Else
   SetVar "[ShowEMail]" "lexicon.email2]"
   SetVar "[LastShow]" "2"
Endif
... and in your TextBox, you display content of variable [ShowEmail]

If the answer is (a), the logic is more complex ... you have to save the "last searched name" in a variable ... and each time it changes, you have to reset [lexicon.LastShow] (to something other than 1) ... then do as above.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Alex » Sun Oct 22, 2006 6:53 am

Thank you very much

It was the answer B
And where have I to put this code ?
Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Gaev » Sun Oct 22, 2006 7:52 am

Alex:
And where have I to put this code ?
... immediately after the place where you have the code [i]to search for the (lexicon) record with the same Name as the one your user entered (in some kind of TextEntry Box ?) and (perhaps) clicked on a button labelled Search ?

I am assuming you already know enough about the NeoBookDB plugin ... to be able to use dbfOpen, dbfQuery etc. ... if not, take a look at the example pubs that are included with the plugin ... to understand how you query a database for required records.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Alex » Sun Oct 22, 2006 9:14 am

Thanks

Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Next

Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest